From aff05eeb74d8c01f2177c424466f63d28a8e7e5d Mon Sep 17 00:00:00 2001 From: James Laska Date: Fri, 30 Sep 2011 10:39:42 -0400 Subject: [PATCH] Initial import (#741945) --- .gitignore | 1 + python-isodate.spec | 78 +++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 80 insertions(+) create mode 100644 python-isodate.spec diff --git a/.gitignore b/.gitignore index e69de29..18eda97 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/isodate-0.4.4.tar.gz diff --git a/python-isodate.spec b/python-isodate.spec new file mode 100644 index 0000000..572314e --- /dev/null +++ b/python-isodate.spec @@ -0,0 +1,78 @@ +%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%endif + +Name: python-isodate +Version: 0.4.4 +Release: 1%{?dist} +Summary: An ISO 8601 date/time/duration parser and formater +Group: Development/Languages +License: BSD +URL: http://pypi.python.org/pypi/isodate +Source0: http://pypi.python.org/packages/source/i/isodate/isodate-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python2-devel +%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 +BuildRequires: python-setuptools-devel +%else +BuildRequires: python-setuptools +%endif +%if 0%{?with_python3} +BuildRequires: python3-devel +%endif # if with_python3 + +%description +This module implements ISO 8601 date, time and duration parsing. The +implementation follows ISO8601:2004 standard, and implements only date/time +representations mentioned in the standard. If something is not mentioned there, +then it is treated as non existent, and not as an allowed option. + +For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended +by this module to support 2 digit years. (while it may still be valid as ISO +date, because it is not explicitly forbidden.) Another example is, when no time +zone information is given for a time, then it should be interpreted as local +time, and not UTC. + +As this module maps ISO 8601 dates/times to standard Python data types, like +date, time, datetime and timedelta, it is not possible to convert all possible +ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by +the Python date and datetime classes. Additionally fractional seconds are +limited to microseconds. That means if the parser finds for instance +nanoseconds it will round it to microseconds. + + +%prep +%setup -qn isodate-%{version} + + +%build +%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 +%{__python} setup.py build +%else +CFLAGS="%{optflags}" %{__python} -c 'import setuptools; execfile("setup.py")' build +%endif + + +%install +rm -rf %{buildroot} +%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 +%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%else +%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%doc README.txt TODO.txt +%{python_sitelib}/isodate +%{python_sitelib}/isodate*.egg-info + + +%changelog +* Wed Sep 28 2011 James Laska - 0.4.4-1 +- Initial package build diff --git a/sources b/sources index e69de29..de9ac11 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +c331586a738ca77fb94190b35e2a5a11 isodate-0.4.4.tar.gz