Blame SPECS/python-isodate.spec

38cb0e
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
38cb0e
%{!?python2_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
38cb0e
%endif
38cb0e
38cb0e
%global modulename isodate
38cb0e
%global with_python3 0
38cb0e
38cb0e
Name:           python-%{modulename}
38cb0e
Version:        0.5.4
38cb0e
Release:        8%{?dist}
38cb0e
Summary:        An ISO 8601 date/time/duration parser and formatter
38cb0e
Group:          Development/Languages
38cb0e
License:        BSD
38cb0e
URL:            http://pypi.python.org/pypi/%{modulename}
38cb0e
Source0:        %{modulename}-%{version}.tar.gz
38cb0e
BuildArch:      noarch
38cb0e
BuildRequires:  python-devel
38cb0e
BuildRequires:  python-setuptools
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
BuildRequires:  python3-devel
38cb0e
BuildRequires:  python3-setuptools
38cb0e
%endif # if with_python3
38cb0e
38cb0e
%description
38cb0e
This module implements ISO 8601 date, time and duration parsing. The
38cb0e
implementation follows ISO8601:2004 standard, and implements only date/time
38cb0e
representations mentioned in the standard. If something is not mentioned there,
38cb0e
then it is treated as non existent, and not as an allowed option.
38cb0e
38cb0e
For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended
38cb0e
by this module to support 2 digit years. (while it may still be valid as ISO
38cb0e
date, because it is not explicitly forbidden.) Another example is, when no time
38cb0e
zone information is given for a time, then it should be interpreted as local
38cb0e
time, and not UTC.
38cb0e
38cb0e
As this module maps ISO 8601 dates/times to standard Python data types, like
38cb0e
date, time, datetime and timedelta, it is not possible to convert all possible
38cb0e
ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by
38cb0e
the Python date and datetime classes. Additionally fractional seconds are
38cb0e
limited to microseconds. That means if the parser finds for instance
38cb0e
nanoseconds it will round it to microseconds.
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
%package -n python3-%{modulename}
38cb0e
Summary:        An ISO 8601 date/time/duration parser and formatter
38cb0e
Group:          Development/Languages
38cb0e
38cb0e
%description -n python3-%{modulename}
38cb0e
This module implements ISO 8601 date, time and duration parsing. The
38cb0e
implementation follows ISO8601:2004 standard, and implements only date/time
38cb0e
representations mentioned in the standard. If something is not mentioned there,
38cb0e
then it is treated as non existent, and not as an allowed option.
38cb0e
38cb0e
For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended
38cb0e
by this module to support 2 digit years. (while it may still be valid as ISO
38cb0e
date, because it is not explicitly forbidden.) Another example is, when no time
38cb0e
zone information is given for a time, then it should be interpreted as local
38cb0e
time, and not UTC.
38cb0e
38cb0e
As this module maps ISO 8601 dates/times to standard Python data types, like
38cb0e
date, time, datetime and timedelta, it is not possible to convert all possible
38cb0e
ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by
38cb0e
the Python date and datetime classes. Additionally fractional seconds are
38cb0e
limited to microseconds. That means if the parser finds for instance
38cb0e
nanoseconds it will round it to microseconds.
38cb0e
%endif
38cb0e
38cb0e
%prep
38cb0e
%setup -qn %{modulename}-%{version}
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
rm -rf %{py3dir}
38cb0e
cp -a . %{py3dir}
38cb0e
%endif
38cb0e
38cb0e
%build
38cb0e
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
38cb0e
%{__python2} setup.py build
38cb0e
%else
38cb0e
CFLAGS="%{optflags}" %{__python2} -c 'import setuptools; execfile("setup.py")' build
38cb0e
%endif
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
pushd %{py3dir}
38cb0e
%{__python3} setup.py build
38cb0e
popd
38cb0e
%endif
38cb0e
38cb0e
%install
38cb0e
rm -rf %{buildroot}
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
pushd %{py3dir}
38cb0e
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
38cb0e
popd
38cb0e
%endif
38cb0e
38cb0e
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
38cb0e
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
38cb0e
%else
38cb0e
%{__python2} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot}
38cb0e
%endif
38cb0e
38cb0e
%clean
38cb0e
rm -rf %{buildroot}
38cb0e
38cb0e
%check
38cb0e
%{__python2} setup.py test
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
pushd %{py3dir}
38cb0e
%{__python3} setup.py test
38cb0e
popd
38cb0e
%endif
38cb0e
38cb0e
38cb0e
%files
38cb0e
%defattr(-,root,root,-)
38cb0e
%doc CHANGES.txt README.rst TODO.txt
38cb0e
%{python2_sitelib}/%{modulename}*.egg-info
38cb0e
%{python2_sitelib}/%{modulename}
38cb0e
38cb0e
%if 0%{?with_python3}
38cb0e
%files -n python3-%{modulename}
38cb0e
%doc CHANGES.txt README.rst TODO.txt
38cb0e
%{python3_sitelib}/%{modulename}-*.egg-info
38cb0e
%{python3_sitelib}/%{modulename}
38cb0e
%endif 
38cb0e
38cb0e
%changelog
38cb0e
* Tue Dec  5 2017 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.5.4-8
38cb0e
- Initial build for RHEL7
38cb0e
38cb0e
  Resolves: rhbz#1511223
38cb0e
38cb0e
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-6
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
38cb0e
38cb0e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-5
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
38cb0e
38cb0e
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.5.4-4
38cb0e
- Rebuild for Python 3.6
38cb0e
38cb0e
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.4-3
38cb0e
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
38cb0e
38cb0e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-2
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
38cb0e
38cb0e
* Thu Nov 19 2015 John Matthews <jwmatthews@gmail.com> - 0.5.4-1
38cb0e
- Update to 0.5.4
38cb0e
38cb0e
* Tue Nov 03 2015 Robert Kuska <rkuska@redhat.com> - 0.5.0-5
38cb0e
- Rebuilt for Python3.5 rebuild
38cb0e
38cb0e
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
38cb0e
38cb0e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
38cb0e
38cb0e
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.5.0-2
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
38cb0e
38cb0e
* Fri Apr 18 2014 Dan Scott <dan@coffeecode.net> - 0.5.0-1
38cb0e
- Update to 0.5.0
38cb0e
- Add a Python3 build
38cb0e
- Run unit tests
38cb0e
- Remove python-setuptools-devel BR per https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel
38cb0e
38cb0e
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-4
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
38cb0e
38cb0e
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-3
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
38cb0e
38cb0e
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-2
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
38cb0e
38cb0e
* Thu Jan 26 2012 James Laska <jlaska@redhat.com> - 0.4.7-1
38cb0e
- Update to 0.4.7
38cb0e
38cb0e
* Mon Jan 23 2012 James Laska <jlaska@redhat.com> - 0.4.6-1
38cb0e
- Update to 0.4.6
38cb0e
38cb0e
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-2
38cb0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
38cb0e
38cb0e
* Wed Sep 28 2011 James Laska <jlaska@redhat.com> - 0.4.4-1
38cb0e
- Initial package build