* Tue Nov 11 2008 Jef Spaleta <jspaleta at fedoraproject dot org> 2008i-1
- Update to latest, now using timezone files provided by tzdata package
This commit is contained in:
parent
a6d0429a70
commit
7ae1445b6a
@ -1 +1 @@
|
||||
pytz-2006p.tar.bz2
|
||||
pytz-2008i.tar.gz
|
||||
|
16
pytz.spec
16
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 <jspaleta at fedoraproject dot org> 2008i-1
|
||||
- Update to latest, now using timezone files provided by tzdata package
|
||||
|
||||
* Fri Jan 04 2008 Jef Spaleta <jspaleta@gmail.com> 2006p-3
|
||||
- Fix for egg-info file creation
|
||||
|
||||
|
31
pytz_zoneinfo.patch
Normal file
31
pytz_zoneinfo.patch
Normal file
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user