From 7ae1445b6a28e620233997e8cf5db05b1b697ced Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Nov 11 2008 18:10:24 +0000 Subject: * Tue Nov 11 2008 Jef Spaleta 2008i-1 - Update to latest, now using timezone files provided by tzdata package --- diff --git a/.cvsignore b/.cvsignore index d35d7e8..89c5ba9 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -pytz-2006p.tar.bz2 +pytz-2008i.tar.gz diff --git a/pytz.spec b/pytz.spec index 00e1eee..6f0953e 100644 --- a/pytz.spec +++ b/pytz.spec @@ -1,19 +1,22 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: pytz -Version: 2006p -Release: 3%{?dist} +Version: 2008i +Release: 1%{?dist} Summary: World Timezone Definitions for Python Group: Development/Languages License: MIT URL: http://pytz.sourceforge.net/ -Source0: http://dl.sf.net/%{name}/%{name}-%{version}.tar.bz2 +Source0: http://dl.sf.net/%{name}/%{name}-%{version}.tar.gz +Patch0: pytz_zoneinfo.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel +Requires: tzdata + %description pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.3 or higher. It @@ -25,7 +28,7 @@ Amost all (over 540) of the Olson timezones are supported. %prep %setup -q - +%patch0 -p0 %build %{__python} setup.py build @@ -35,7 +38,7 @@ Amost all (over 540) of the Olson timezones are supported. rm -rf $RPM_BUILD_ROOT %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT chmod +x $RPM_BUILD_ROOT%{python_sitelib}/pytz/*.py - +rm -rf $RPM_BUILD_ROOT%{python_sitelib}/pytz/zoneinfo %clean rm -rf $RPM_BUILD_ROOT @@ -48,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/*.egg-info %changelog +* Tue Nov 11 2008 Jef Spaleta 2008i-1 +- Update to latest, now using timezone files provided by tzdata package + * Fri Jan 04 2008 Jef Spaleta 2006p-3 - Fix for egg-info file creation diff --git a/pytz_zoneinfo.patch b/pytz_zoneinfo.patch new file mode 100644 index 0000000..cfa2dee --- /dev/null +++ b/pytz_zoneinfo.patch @@ -0,0 +1,31 @@ +--- pytz/tzfile.py.old 2008-11-11 08:30:45.000000000 -0900 ++++ pytz/tzfile.py 2008-11-11 08:31:02.000000000 -0900 +@@ -103,7 +103,7 @@ + if __name__ == '__main__': + import os.path + from pprint import pprint +- base = os.path.join(os.path.dirname(__file__), 'zoneinfo') ++ base = os.path.join(os.path.dirname(__file__), '/usr/share/zoneinfo') + tz = build_tzinfo('Australia/Melbourne', + open(os.path.join(base,'Australia','Melbourne'), 'rb')) + tz = build_tzinfo('US/Eastern', + +--- pytz/__init__.py.old 2008-11-11 08:30:05.000000000 -0900 ++++ pytz/__init__.py 2008-11-11 08:30:31.000000000 -0900 +@@ -50,14 +50,14 @@ + Uses the pkg_resources module if available. + """ + if resource_stream is not None: +- return resource_stream(__name__, 'zoneinfo/' + name) ++ return resource_stream(__name__, '/usr/share/zoneinfo/' + name) + else: + 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(os.path.dirname(__file__), +- 'zoneinfo', *name_parts) ++ '/usr/share/zoneinfo', *name_parts) + return open(filename, 'rb') + + diff --git a/sources b/sources index 2836427..768d158 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ae3569bc2831d30d2ee1fabac54c43dd pytz-2006p.tar.bz2 +15468bcc36c506639b29e55e4b0f52f6 pytz-2008i.tar.gz