Blob Blame History Raw
%global with_python3 1

%if 0%{?fedora}
%{!?python3_pkgversion: %global python3_pkgversion 3}
%else
%{!?python3_pkgversion: %global python3_pkgversion 34}
%endif

%global modname arrow

Name:               python-%{modname}
Version:            0.7.0
Release:            1%{?dist}
Summary:            Better dates and times for Python

Group:              Development/Libraries
License:            ASL 2.0
URL:                http://pypi.python.org/pypi/arrow
Source0:            http://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch
BuildRequires:      python2-devel
BuildRequires:      python-setuptools
BuildRequires:      python-chai
BuildRequires:      python-dateutil
BuildRequires:      python-six
BuildRequires:      python-nose
BuildRequires:      python-simplejson

Requires:           python-dateutil
Requires:           python-six

%if 0%{?with_python3}
BuildRequires:      python%{python3_pkgversion}-devel
BuildRequires:      python%{python3_pkgversion}-setuptools
BuildRequires:      python%{python3_pkgversion}-chai
BuildRequires:      python%{python3_pkgversion}-dateutil
BuildRequires:      python%{python3_pkgversion}-six
BuildRequires:      python%{python3_pkgversion}-nose
BuildRequires:      python%{python3_pkgversion}-simplejson
%endif

%description
Arrow is a Python library that offers a sensible, human-friendly approach to
creating, manipulating, formatting and converting dates, times, and timestamps.
It implements and updates the datetime type, plugging gaps in functionality,
and provides an intelligent module API that supports many common creation
scenarios.
Simply put, it helps you work with dates and times with fewer imports and a lot
less code.


%if 0%{?with_python3}
%package -n         python%{python3_pkgversion}-%{modname}
Summary:            Better dates and times for Python
Group:              Development/Libraries
Requires:           python%{python3_pkgversion}-dateutil
Requires:           python%{python3_pkgversion}-six

%description -n python%{python3_pkgversion}-arrow
Arrow is a Python library that offers a sensible, human-friendly approach to
creating, manipulating, formatting and converting dates, times, and timestamps.
It implements and updates the datetime type, plugging gaps in functionality,
and provides an intelligent module API that supports many common creation
scenarios.
Simply put, it helps you work with dates and times with fewer imports and a lot
less code.
%endif

%prep
%setup -q -n %{modname}-%{version}

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%check
%if 0%{?with_python3}
pushd %{py3dir}
nosetests-%{python3_version} --all-modules arrow tests
popd
%endif

nosetests --all-modules arrow tests

%files
%doc README.rst HISTORY.md
%license LICENSE
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{modname}
%doc README.rst HISTORY.md
%license LICENSE
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*
%endif

%changelog
* Sat Oct 24 2015 Ralph Bean <rbean@redhat.com> - 0.7.0-1
- new version

* Wed Sep 16 2015 Ralph Bean <rbean@redhat.com> - 0.6.0-1
- new version
- Include license file, now shipped by upstream
- Run tests the way upstream does in their Makefile.

* Tue Sep 15 2015 Ralph Bean <rbean@redhat.com> - 0.5.0-3
- Get ready for Python34 on EPEL7.

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jan 22 2015 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.5.0-1
- Update to 0.5.0

* Wed Jan 21 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.4-1
- Update to version 0.4.4
- Enable tests (#1183352)

* Wed Jul 09 2014 Ralph Bean <rbean@redhat.com> - 0.4.2-5
- Modernize python3 macro definition.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Tue Dec 17 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.4.2-1
- Add python-six and python-dateutil as Requires

* Wed Nov 27 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.4.2-1
- Update to 0.4.2
- Prepare for when the tests will be included in the releases
- Add BR to python-chai, python-dateutil and python-six

* Mon Oct 28 2013  Pierre-Yves Chibon <pingou@pingoured.fr> - 0.4.1-1
- initial package for Fedora