3 %bcond_without python2 # Python 2.x modules
4 %bcond_without python3 # Python 3.x modules
5 %bcond_without tests # unit tests
8 # - as we use system tzdata package, keeping this pkg up to the latest is
9 # pointless if only data has changed
10 # - ...but other packages may require newer version anyway, through egg dependencies
12 # pytz/__init__.py /OLSON_VERSION
13 %define olsonver 2020e
14 Summary: pytz - Olson timezone database in Python
15 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
16 Name: python-%{module}
19 License: MIT or ZPL v2.1
20 Group: Libraries/Python
21 #Source0Download: https://pypi.org/simple/pytz/
22 Source0: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz
23 # Source0-md5: e7ebdeb16f0e0abdddc0e764af68052c
24 Patch0: zoneinfo.patch
25 URL: http://pytz.sourceforge.net/
26 BuildRequires: rpmbuild(macros) >= 1.714
27 BuildRequires: sed >= 4.0
29 BuildRequires: python >= 1:2.3
30 BuildRequires: python-devel >= 1:2.4
31 BuildRequires: python-setuptools
34 BuildRequires: python3-devel >= 1:3.2
35 BuildRequires: python3-setuptools
37 Requires: python-modules >= 1:2.4
38 Requires: tzdata-zoneinfo >= %{olsonver}
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 pytz brings the Olson tz database into Python. This library allows
44 accurate and cross platform timezone calculations using Python 2.3 or
47 %description -l pl.UTF-8
48 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
49 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
50 niezależnych od platformy obliczeń uwzględniających strefy czasowe
51 przy użyciu Pythona w wersji co najmniej 2.3.
53 %package -n python3-%{module}
54 Summary: pytz - Olson timezone database in Python 3.x
55 Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie 3.x
56 Group: Libraries/Python
57 Requires: python3-modules >= 1:3.2
58 Requires: tzdata-zoneinfo >= %{olsonver}
60 %description -n python3-%{module}
61 pytz brings the Olson tz database into Python. This library allows
62 accurate and cross platform timezone calculations using Python 3.x
64 %description -n python3-%{module} -l pl.UTF-8
65 pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
66 czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
67 niezależnych od platformy obliczeń uwzględniających strefy czasowe
68 przy użyciu Pythona 3.x
71 %setup -q -n %{module}-%{version}
73 # strip zones list before patching
74 %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
75 -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
80 v=$(sed -rne "s/^OLSON_VERSION = '(.+)'/\1/p" pytz/__init__.py)
81 test "$v" = "%{olsonver}"
88 %{__python} -munittest discover -s pytz/tests
96 %{__python3} -munittest discover -s pytz/tests
101 rm -rf $RPM_BUILD_ROOT
106 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
113 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytz/zoneinfo
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc LICENSE.txt README.rst
123 %{py_sitescriptdir}/pytz
124 %{py_sitescriptdir}/pytz-%{version}-py*.egg-info
128 %files -n python3-%{module}
129 %defattr(644,root,root,755)
130 %doc LICENSE.txt README.rst
131 %{py3_sitescriptdir}/pytz
132 %{py3_sitescriptdir}/pytz-%{version}-py*.egg-info