3 %bcond_without python2 # Python 2.x modules
4 %bcond_without python3 # Python 3.x modules
7 # - as we use system tzdata package, keeping this pkg up to the latest is
8 # pointless if only data has changed
10 Summary: pytz - Olson timezone database in Python
11 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
12 Name: python-%{module}
16 Group: Libraries/Python
17 Source0: http://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
18 # Source0-md5: 634c5fab45c6ebaf35985acf0080011f
19 Patch0: zoneinfo.patch
20 URL: http://pytz.sourceforge.net/
21 BuildRequires: sed >= 4.0
23 BuildRequires: python-devel >= 1:2.3
24 BuildRequires: python >= 1:2.3
27 BuildRequires: python3-devel
29 BuildRequires: rpmbuild(macros) >= 1.469
31 Requires: python >= 1:2.3
33 Requires: tzdata >= %{version}
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 pytz brings the Olson tz database into Python. This library allows
39 accurate and cross platform timezone calculations using Python 2.3 or
42 %description -l pl.UTF-8
43 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
44 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
45 niezależnych od platformy obliczeń uwzględniających strefy czasowe
46 przy użyciu Pythona w wersji co najmniej 2.3.
48 %package -n python3-%{module}
49 Summary: pytz - Olson timezone database in Python 3.x
50 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie 3.x
51 Group: Libraries/Python
52 Requires: tzdata >= %{version}
54 %description -n python3-%{module}
55 pytz brings the Olson tz database into Python. This library allows
56 accurate and cross platform timezone calculations using Python 3.x
58 %description -n python3-%{module} -l pl.UTF-8
59 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
60 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
61 niezależnych od platformy obliczeń uwzględniających strefy czasowe
62 przy użyciu Pythona 3.x
65 %setup -q -n %{module}-%{version}
67 # strip zones list before patching
68 %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
69 -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
75 %{__python} setup.py build --build-base py2
79 %{__python3} setup.py build --build-base py3
83 rm -rf $RPM_BUILD_ROOT
85 %{__python} setup.py \
86 build --build-base py2 \
88 --root=$RPM_BUILD_ROOT \
91 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
96 %{__python3} setup.py \
97 build --build-base py3 \
99 --root=$RPM_BUILD_ROOT \
104 rm -rf $RPM_BUILD_ROOT
108 %defattr(644,root,root,755)
109 %doc CHANGES.txt LICENSE.txt README.txt
110 %{py_sitescriptdir}/pytz
111 %{py_sitescriptdir}/pytz-%{version}-py*.egg-info
115 %files -n python3-%{module}
116 %defattr(644,root,root,755)
117 %doc CHANGES.txt LICENSE.txt README.txt
118 %{py3_sitescriptdir}/pytz
119 %{py3_sitescriptdir}/pytz-%{version}-py*.egg-info