James Laska aff05ee
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
de8e39d
%{!?python2_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
James Laska aff05ee
%endif
James Laska aff05ee
2cb1e06
%global modulename isodate
2cb1e06
%global with_python3 1
2cb1e06
2cb1e06
Name:           python-%{modulename}
John Matthews d6b086c
Version:        0.5.4
9338986
Release:        10%{?dist}
e374f5d
Summary:        An ISO 8601 date/time/duration parser and formatter
James Laska aff05ee
Group:          Development/Languages
James Laska aff05ee
License:        BSD
2cb1e06
URL:            http://pypi.python.org/pypi/%{modulename}
2cb1e06
Source0:        http://pypi.python.org/packages/source/i/%{modulename}/%{modulename}-%{version}.tar.gz
James Laska aff05ee
BuildArch:      noarch
James Laska aff05ee
BuildRequires:  python2-devel
dc8165c
BuildRequires:  python2-setuptools
2cb1e06
James Laska aff05ee
%if 0%{?with_python3}
James Laska aff05ee
BuildRequires:  python3-devel
2cb1e06
BuildRequires:  python3-setuptools
James Laska aff05ee
%endif # if with_python3
James Laska aff05ee
fd29b93
%global _description\
fd29b93
This module implements ISO 8601 date, time and duration parsing. The\
fd29b93
implementation follows ISO8601:2004 standard, and implements only date/time\
fd29b93
representations mentioned in the standard. If something is not mentioned there,\
fd29b93
then it is treated as non existent, and not as an allowed option.\
fd29b93
\
fd29b93
For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended\
fd29b93
by this module to support 2 digit years. (while it may still be valid as ISO\
fd29b93
date, because it is not explicitly forbidden.) Another example is, when no time\
fd29b93
zone information is given for a time, then it should be interpreted as local\
fd29b93
time, and not UTC.\
fd29b93
\
fd29b93
As this module maps ISO 8601 dates/times to standard Python data types, like\
fd29b93
date, time, datetime and timedelta, it is not possible to convert all possible\
fd29b93
ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by\
fd29b93
the Python date and datetime classes. Additionally fractional seconds are\
fd29b93
limited to microseconds. That means if the parser finds for instance\
fd29b93
nanoseconds it will round it to microseconds.
James Laska aff05ee
fd29b93
%description %_description
James Laska aff05ee
fd29b93
%package -n python2-%{modulename}
fd29b93
Summary: %summary
fd29b93
%{?python_provide:%python_provide python2-%{modulename}}
fd29b93
fd29b93
%description -n python2-%{modulename} %_description
James Laska aff05ee
2cb1e06
%if 0%{?with_python3}
2cb1e06
%package -n python3-%{modulename}
e374f5d
Summary:        An ISO 8601 date/time/duration parser and formatter
2cb1e06
Group:          Development/Languages
2cb1e06
2cb1e06
%description -n python3-%{modulename}
2cb1e06
This module implements ISO 8601 date, time and duration parsing. The
2cb1e06
implementation follows ISO8601:2004 standard, and implements only date/time
2cb1e06
representations mentioned in the standard. If something is not mentioned there,
2cb1e06
then it is treated as non existent, and not as an allowed option.
2cb1e06
2cb1e06
For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended
2cb1e06
by this module to support 2 digit years. (while it may still be valid as ISO
2cb1e06
date, because it is not explicitly forbidden.) Another example is, when no time
2cb1e06
zone information is given for a time, then it should be interpreted as local
2cb1e06
time, and not UTC.
2cb1e06
2cb1e06
As this module maps ISO 8601 dates/times to standard Python data types, like
2cb1e06
date, time, datetime and timedelta, it is not possible to convert all possible
2cb1e06
ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by
2cb1e06
the Python date and datetime classes. Additionally fractional seconds are
2cb1e06
limited to microseconds. That means if the parser finds for instance
2cb1e06
nanoseconds it will round it to microseconds.
2cb1e06
%endif
James Laska aff05ee
James Laska aff05ee
%prep
2cb1e06
%setup -qn %{modulename}-%{version}
James Laska aff05ee
2cb1e06
%if 0%{?with_python3}
2cb1e06
rm -rf %{py3dir}
2cb1e06
cp -a . %{py3dir}
2cb1e06
%endif
James Laska aff05ee
James Laska aff05ee
%build
James Laska aff05ee
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
de8e39d
%{__python2} setup.py build
James Laska aff05ee
%else
de8e39d
CFLAGS="%{optflags}" %{__python2} -c 'import setuptools; execfile("setup.py")' build
James Laska aff05ee
%endif
James Laska aff05ee
2cb1e06
%if 0%{?with_python3}
2cb1e06
pushd %{py3dir}
2cb1e06
%{__python3} setup.py build
2cb1e06
popd
2cb1e06
%endif
James Laska aff05ee
James Laska aff05ee
%install
James Laska aff05ee
rm -rf %{buildroot}
2cb1e06
2cb1e06
%if 0%{?with_python3}
2cb1e06
pushd %{py3dir}
2cb1e06
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
2cb1e06
popd
2cb1e06
%endif
2cb1e06
James Laska aff05ee
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
de8e39d
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
James Laska aff05ee
%else
de8e39d
%{__python2} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot}
James Laska aff05ee
%endif
James Laska aff05ee
cba5b07
%check
de8e39d
%{__python2} setup.py test
cba5b07
cba5b07
%if 0%{?with_python3}
cba5b07
pushd %{py3dir}
de8e39d
%{__python3} setup.py test
cba5b07
popd
cba5b07
%endif
cba5b07
James Laska aff05ee
fd29b93
%files -n python2-%{modulename}
2cb1e06
%doc CHANGES.txt README.rst TODO.txt
de8e39d
%{python2_sitelib}/%{modulename}*.egg-info
de8e39d
%{python2_sitelib}/%{modulename}
James Laska aff05ee
2cb1e06
%if 0%{?with_python3}
2cb1e06
%files -n python3-%{modulename}
2cb1e06
%doc CHANGES.txt README.rst TODO.txt
2cb1e06
%{python3_sitelib}/%{modulename}-*.egg-info
2cb1e06
%{python3_sitelib}/%{modulename}
2cb1e06
%endif 
James Laska aff05ee
James Laska aff05ee
%changelog
9338986
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 0.5.4-10
9338986
- Rebuilt for Python 3.7
9338986
dc8165c
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.5.4-9
dc8165c
- Update Python 2 dependency declarations to new packaging standards
dc8165c
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
dc8165c
21a7aec
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-8
21a7aec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
21a7aec
fd29b93
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.5.4-7
fd29b93
- Python 2 binary package renamed to python2-isodate
fd29b93
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
fd29b93
072e9fe
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-6
072e9fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
072e9fe
a9bdef0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-5
a9bdef0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a9bdef0
bac2e10
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.5.4-4
bac2e10
- Rebuild for Python 3.6
bac2e10
7653ca2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.4-3
7653ca2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7653ca2
88436bb
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-2
88436bb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
88436bb
John Matthews d6b086c
* Thu Nov 19 2015 John Matthews <jwmatthews@gmail.com> - 0.5.4-1
John Matthews d6b086c
- Update to 0.5.4
John Matthews d6b086c
Robert Kuska 146bf25
* Tue Nov 03 2015 Robert Kuska <rkuska@redhat.com> - 0.5.0-5
Robert Kuska 146bf25
- Rebuilt for Python3.5 rebuild
Robert Kuska 146bf25
da0bd0d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
da0bd0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
da0bd0d
111db20
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
111db20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
111db20
36c4886
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.5.0-2
36c4886
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
36c4886
2cb1e06
* Fri Apr 18 2014 Dan Scott <dan@coffeecode.net> - 0.5.0-1
2cb1e06
- Update to 0.5.0
2cb1e06
- Add a Python3 build
cba5b07
- Run unit tests
e374f5d
- Remove python-setuptools-devel BR per https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel
2cb1e06
caca815
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-4
caca815
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
caca815
847617b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-3
847617b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
847617b
9890a18
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-2
9890a18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9890a18
James Laska a9bac73
* Thu Jan 26 2012 James Laska <jlaska@redhat.com> - 0.4.7-1
James Laska a9bac73
- Update to 0.4.7
James Laska a9bac73
James Laska 74b650a
* Mon Jan 23 2012 James Laska <jlaska@redhat.com> - 0.4.6-1
James Laska 74b650a
- Update to 0.4.6
James Laska 74b650a
ff6fcd3
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-2
ff6fcd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ff6fcd3
James Laska aff05ee
* Wed Sep 28 2011 James Laska <jlaska@redhat.com> - 0.4.4-1
James Laska aff05ee
- Initial package build