]>
Commit | Line | Data |
---|---|---|
0089fbb2 AF |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x modules | |
4 | %bcond_without python3 # Python 3.x modules | |
db98e45d | 5 | %bcond_without tests # unit tests |
0089fbb2 | 6 | # |
0b9d7830 | 7 | # NOTE: |
6d89867b | 8 | # - as we use system tzdata package, keeping this pkg up to the latest is |
0b9d7830 JB |
9 | # pointless if only data has changed |
10 | # - ...but other packages may require newer version anyway, through egg dependencies | |
e6b8d84a ER |
11 | %define module pytz |
12 | %define pypi_name pytz | |
0b9d7830 | 13 | %define olsonver 2018e |
1d169444 | 14 | Summary: pytz - Olson timezone database in Python |
e0abfc56 | 15 | Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie |
1d169444 | 16 | Name: python-%{module} |
0b9d7830 JB |
17 | Version: 2018.5 |
18 | Release: 1 | |
17510524 | 19 | License: MIT or ZPL v2.1 |
1d169444 | 20 | Group: Libraries/Python |
db98e45d JB |
21 | #Source0Download: https://pypi.org/simple/pytz/ |
22 | Source0: https://files.pythonhosted.org/packages/source/p/pytz/%{pypi_name}-%{version}.tar.gz | |
0b9d7830 | 23 | # Source0-md5: 45409cbfa3927bdd2f3ee914dd5b1060 |
b3e14e5b | 24 | Patch0: zoneinfo.patch |
76c65347 | 25 | URL: http://pytz.sourceforge.net/ |
db98e45d | 26 | BuildRequires: rpmbuild(macros) >= 1.714 |
0dbea9c1 | 27 | BuildRequires: sed >= 4.0 |
0089fbb2 | 28 | %if %{with python2} |
3342699d | 29 | BuildRequires: python >= 1:2.3 |
0b9d7830 | 30 | BuildRequires: python-devel >= 1:2.4 |
d30d1254 | 31 | BuildRequires: python-setuptools |
0089fbb2 AF |
32 | %endif |
33 | %if %{with python3} | |
db98e45d | 34 | BuildRequires: python3-devel >= 1:3.2 |
d30d1254 | 35 | BuildRequires: python3-setuptools |
0089fbb2 | 36 | %endif |
0b9d7830 | 37 | Requires: python-modules >= 1:2.4 |
fa19a5fc | 38 | Requires: tzdata-zoneinfo >= %{olsonver} |
1d169444 MG |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | pytz brings the Olson tz database into Python. This library allows | |
44 | accurate and cross platform timezone calculations using Python 2.3 or | |
45 | higher. | |
46 | ||
a49ed86c JR |
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, | |
3342699d | 50 | niezależnych od platformy obliczeń uwzględniających strefy czasowe |
a49ed86c | 51 | przy użyciu Pythona w wersji co najmniej 2.3. |
1d169444 | 52 | |
0089fbb2 AF |
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 | |
db98e45d | 57 | Requires: python3-modules >= 1:3.2 |
fa19a5fc | 58 | Requires: tzdata-zoneinfo >= %{olsonver} |
0089fbb2 AF |
59 | |
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 | |
63 | ||
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 | |
69 | ||
1d169444 MG |
70 | %prep |
71 | %setup -q -n %{module}-%{version} | |
6d89867b ER |
72 | |
73 | # strip zones list before patching | |
0dbea9c1 JB |
74 | %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \ |
75 | -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py | |
6d89867b | 76 | |
b3e14e5b | 77 | %patch0 -p1 |
1d169444 MG |
78 | |
79 | %build | |
59e720fb ER |
80 | v=$(sed -rne "s/^OLSON_VERSION = '(.+)'/\1/p" pytz/__init__.py) |
81 | test "$v" = "%{olsonver}" | |
82 | ||
0089fbb2 | 83 | %if %{with python2} |
4ccf24df | 84 | %py_build |
82cff73e | 85 | %py_lint |
db98e45d JB |
86 | |
87 | %if %{with tests} | |
88 | %{__python} -munittest discover -s pytz/tests | |
0089fbb2 | 89 | %endif |
db98e45d JB |
90 | %endif |
91 | ||
0089fbb2 | 92 | %if %{with python3} |
4ccf24df | 93 | %py3_build |
db98e45d JB |
94 | |
95 | %if %{with tests} | |
96 | %{__python3} -munittest discover -s pytz/tests | |
97 | %endif | |
0089fbb2 | 98 | %endif |
1d169444 MG |
99 | |
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
db98e45d | 102 | |
0089fbb2 | 103 | %if %{with python2} |
4ccf24df | 104 | %py_install |
db98e45d | 105 | |
3342699d | 106 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo |
63825ff4 | 107 | %py_postclean |
0089fbb2 AF |
108 | %endif |
109 | ||
110 | %if %{with python3} | |
4ccf24df | 111 | %py3_install |
db98e45d JB |
112 | |
113 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytz/zoneinfo | |
0089fbb2 | 114 | %endif |
1d169444 MG |
115 | |
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
0089fbb2 | 119 | %if %{with python2} |
1d169444 MG |
120 | %files |
121 | %defattr(644,root,root,755) | |
db98e45d | 122 | %doc LICENSE.txt README.txt |
1d169444 | 123 | %{py_sitescriptdir}/pytz |
2df1d822 | 124 | %{py_sitescriptdir}/pytz-%{version}-py*.egg-info |
0089fbb2 AF |
125 | %endif |
126 | ||
127 | %if %{with python3} | |
128 | %files -n python3-%{module} | |
129 | %defattr(644,root,root,755) | |
db98e45d | 130 | %doc LICENSE.txt README.txt |
0089fbb2 AF |
131 | %{py3_sitescriptdir}/pytz |
132 | %{py3_sitescriptdir}/pytz-%{version}-py*.egg-info | |
133 | %endif |