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, but other packages may require
9 # newer version anyway, through egg dependencies
11 Summary: pytz - Olson timezone database in Python
12 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
13 Name: python-%{module}
16 License: MIT or ZPL v2.1
17 Group: Libraries/Python
18 Source0: https://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
19 # Source0-md5: 39f7375c4b1fa34cdcb4b4765d08f817
20 Patch0: zoneinfo.patch
21 URL: http://pytz.sourceforge.net/
22 BuildRequires: sed >= 4.0
24 BuildRequires: python-devel >= 1:2.3
25 BuildRequires: python >= 1:2.3
26 BuildRequires: python-setuptools
29 BuildRequires: python3-devel
30 BuildRequires: python3-setuptools
32 BuildRequires: rpmbuild(macros) >= 1.710
34 Requires: python >= 1:2.3
36 Requires: tzdata >= %{version}
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 pytz brings the Olson tz database into Python. This library allows
42 accurate and cross platform timezone calculations using Python 2.3 or
45 %description -l pl.UTF-8
46 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
47 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
48 niezależnych od platformy obliczeń uwzględniających strefy czasowe
49 przy użyciu Pythona w wersji co najmniej 2.3.
51 %package -n python3-%{module}
52 Summary: pytz - Olson timezone database in Python 3.x
53 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie 3.x
54 Group: Libraries/Python
55 Requires: tzdata >= %{version}
57 %description -n python3-%{module}
58 pytz brings the Olson tz database into Python. This library allows
59 accurate and cross platform timezone calculations using Python 3.x
61 %description -n python3-%{module} -l pl.UTF-8
62 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
63 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
64 niezależnych od platformy obliczeń uwzględniających strefy czasowe
65 przy użyciu Pythona 3.x
68 %setup -q -n %{module}-%{version}
70 # strip zones list before patching
71 %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
72 -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
78 %py_build --build-base py2
82 %py3_build --build-base py3
86 rm -rf $RPM_BUILD_ROOT
88 %{__python} setup.py \
89 build --build-base py2 \
91 --root=$RPM_BUILD_ROOT \
94 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
99 %{__python3} setup.py \
100 build --build-base py3 \
102 --root=$RPM_BUILD_ROOT \
107 rm -rf $RPM_BUILD_ROOT
111 %defattr(644,root,root,755)
112 %doc CHANGES.txt LICENSE.txt README.txt
113 %{py_sitescriptdir}/pytz
114 %{py_sitescriptdir}/pytz-%{version}-py*.egg-info
118 %files -n python3-%{module}
119 %defattr(644,root,root,755)
120 %doc CHANGES.txt LICENSE.txt README.txt
121 %{py3_sitescriptdir}/pytz
122 %{py3_sitescriptdir}/pytz-%{version}-py*.egg-info