[python3-dateutil/f17] Initial import based on the python-dateutil package (#810859)

tomspur tomspur at fedoraproject.org
Wed Jul 4 18:47:09 UTC 2012


commit c202ce8879095c86248ea312d6f984aaa370e582
Author: Thomas Spura <thomas.spura at gmail.com>
Date:   Wed Jul 4 20:46:15 2012 +0200

    Initial import based on the python-dateutil package (#810859)

 .gitignore                                 |    1 +
 python3-dateutil-2.0-system-zoneinfo.patch |   74 +++++++++++++++++
 python3-dateutil.spec                      |  123 ++++++++++++++++++++++++++++
 sources                                    |    1 +
 4 files changed, 199 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..5702a84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/python-dateutil-2.0.tar.gz
diff --git a/python3-dateutil-2.0-system-zoneinfo.patch b/python3-dateutil-2.0-system-zoneinfo.patch
new file mode 100644
index 0000000..04277e0
--- /dev/null
+++ b/python3-dateutil-2.0-system-zoneinfo.patch
@@ -0,0 +1,74 @@
+diff -up python-dateutil-1.5/dateutil/zoneinfo/__init__.py\~ python-dateutil-1.5/dateutil/zoneinfo/__init__.py
+--- python-dateutil-1.5/dateutil/zoneinfo/__init__.py~	2005-12-22 19:13:50.000000000 +0100
++++ python-dateutil-1.5/dateutil/zoneinfo/__init__.py	2011-08-17 15:24:29.019214748 +0200
+@@ -15,6 +15,7 @@ __all__ = ["setcachesize", "gettz", "reb
+ 
+ CACHE = []
+ CACHESIZE = 10
++USE_SYSTEM_ZONEINFO = True # XXX configure at build time
+ 
+ class tzfile(tzfile):
+     def __reduce__(self):
+@@ -29,7 +30,8 @@ def getzoneinfofile():
+             return os.path.join(os.path.dirname(__file__), entry)
+     return None
+ 
+-ZONEINFOFILE = getzoneinfofile()
++ZONEINFOFILE = getzoneinfofile() if USE_SYSTEM_ZONEINFO else None
++ZONEINFODIR = (os.getenv("TZDIR") or "/usr/share/zoneinfo").rstrip(os.sep)
+ 
+ del getzoneinfofile
+ 
+@@ -39,22 +40,37 @@ def setcachesize(size):
+     del CACHE[size:]
+ 
+ def gettz(name):
+-    tzinfo = None
+-    if ZONEINFOFILE:
+-        for cachedname, tzinfo in CACHE:
+-            if cachedname == name:
+-                break
++    for cachedname, tzinfo in CACHE:
++        if cachedname == name:
++            return tzinfo
++
++    name_parts = name.lstrip('/').split('/')
++    for part in name_parts:
++        if part == os.path.pardir or os.path.sep in part:
++            raise ValueError('Bad path segment: %r' % part)
++    filename = os.path.join(ZONEINFODIR, *name_parts)
++    try:
++        zonefile = open(filename, "rb")
++    except:
++        tzinfo = None
++    else:
++        tzinfo = tzfile(zonefile)
++        zonefile.close()
++
++    if tzinfo is None and ZONEINFOFILE:
++        tf = TarFile.open(ZONEINFOFILE)
++        try:
++            zonefile = tf.extractfile(name)
++        except KeyError:
++            tzinfo = None
+         else:
+-            tf = TarFile.open(ZONEINFOFILE)
+-            try:
+-                zonefile = tf.extractfile(name)
+-            except KeyError:
+-                tzinfo = None
+-            else:
+-                tzinfo = tzfile(zonefile)
+-            tf.close()
+-            CACHE.insert(0, (name, tzinfo))
+-            del CACHE[CACHESIZE:]
++            tzinfo = tzfile(zonefile)
++        tf.close()
++
++    if tzinfo is not None:
++        CACHE.insert(0, (name, tzinfo))
++        del CACHE[CACHESIZE:]
++
+     return tzinfo
+ 
+ def rebuild(filename, tag=None, format="gz"):
diff --git a/python3-dateutil.spec b/python3-dateutil.spec
new file mode 100644
index 0000000..ac61c9a
--- /dev/null
+++ b/python3-dateutil.spec
@@ -0,0 +1,123 @@
+%global tar_name python-dateutil
+
+Name:           python3-dateutil
+Version:        2.0
+Release:        2%{?dist}
+Summary:        Powerful extensions to the standard datetime module
+
+Group:          Development/Languages
+License:        BSD
+URL:            http://labix.org/python-dateutil
+Source0:        http://labix.org/download/%{tar_name}/%{tar_name}-%{version}.tar.gz
+# Send upstream via mail on Wed Jul  4 2012
+Patch0:         python3-dateutil-2.0-system-zoneinfo.patch
+
+BuildArch:      noarch
+BuildRequires:  python3-devel,python3-setuptools
+Requires:       tzdata
+
+%description
+The dateutil module provides powerful extensions to the standard datetime
+module available in Python 2.3+.
+
+%prep
+%setup -q -n %{tar_name}-%{version}
+%patch0 -p1
+
+iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new
+mv NEWS.new NEWS
+
+%build
+%{__python3} setup.py build
+
+%install
+%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
+
+%check
+%{__python3} ./test.py -v
+
+%files -n python3-dateutil
+%doc example.py LICENSE NEWS README
+%{python3_sitelib}/dateutil/
+%exclude %{python3_sitelib}/dateutil/zoneinfo/zoneinfo-*.tar.gz
+%{python3_sitelib}/*.egg-info
+
+%changelog
+* Sat Jun 30 2012 Thomas Spura <tomspur at fedoraproject.org> - 2.0-2
+- correct patch naming
+
+* Mon Apr  9 2012 Thomas Spura <tomspur at fedoraproject.org> - 2.0-1
+- change anything to python3
+- update to new version
+- exclude ALL zoneinfo-*.tar.gz, not only one specific one
+- drop patch for setup.py (excluding has the same effect)
+- add check section
+- license is BSD and not Python
+
+* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Wed Sep 15 2011 Jef Spaleta <jspaleta at fedoraproject.org> - 1.5-3
+- Adjust patch to respect systemwide tzdata. Ref bug 729786
+
+* Wed Sep 15 2011 Jef Spaleta <jspaleta at fedoraproject.org> - 1.5-2
+- Added a patch to respect systemwide tzdata. Ref bug 729786
+
+* Wed Jul 13 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 1.5-1
+- New upstream release
+- Fix UTF8 encoding correctly
+- Drop buildroot, clean, defattr and use macro for Source
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm at redhat.com> - 1.4.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
+
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.1-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Feb 20 2009 Jef Spaleta <jspaleta AT fedoraproject DOT org> - 1.4.1-2
+- small specfile fix
+
+* Fri Feb 20 2009 Jef Spaleta <jspaleta AT fedoraproject DOT org> - 1.4.1-2
+- New upstream version
+
+* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm at gmail.com> - 1.4-3
+- Rebuild for Python 2.6
+
+* Fri Aug 29 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 1.4-2
+- fix license tag
+
+* Tue Jul 01 2008 Jef Spaleta <jspaleta AT fedoraproject DOT org> 1.4-1
+- Latest upstream release 
+
+* Fri Jan 04 2008 Jef Spaleta <jspaleta at fedoraproject.org> 1.2-2
+- Fix for egg-info file creation
+
+* Thu Jun 28 2007 Orion Poplawski <orion at cora.nwra.com> 1.2-1
+- Update to 1.2
+
+* Mon Dec 11 2006 Jef Spaleta <jspaleta at gmail.com> 1.1-5
+- Fix python-devel BR, as per discussion in maintainers-list
+
+* Mon Dec 11 2006 Jef Spaleta <jspaleta at gmail.com> 1.1-4
+- Release bump for rebuild against python 2.5 in devel tree
+
+* Wed Jul 26 2006 Orion Poplawski <orion at cora.nwra.com> 1.1-3
+- Add patch to fix building on x86_64
+
+* Wed Feb 15 2006 Orion Poplawski <orion at cora.nwra.com> 1.1-2
+- Rebuild for gcc/glibc changes
+
+* Thu Dec 22 2005 Orion Poplawski <orion at cora.nwra.com> 1.1-1
+- Update to 1.1
+
+* Thu Jul 28 2005 Orion Poplawski <orion at cora.nwra.com> 1.0-1
+- Update to 1.0
+
+* Tue Jul 05 2005 Orion Poplawski <orion at cora.nwra.com> 0.9-1
+- Initial Fedora Extras package
diff --git a/sources b/sources
index e69de29..6e22974 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+22297f7e891bcd79a80d9446d8b20542  python-dateutil-2.0.tar.gz


More information about the scm-commits mailing list