]>
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 | |
5 | # | |
6d89867b ER |
6 | # NOTE |
7 | # - as we use system tzdata package, keeping this pkg up to the latest is | |
8 | # pointless if only data has changed | |
1d169444 | 9 | %define module pytz |
1d169444 | 10 | Summary: pytz - Olson timezone database in Python |
e0abfc56 | 11 | Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie |
1d169444 | 12 | Name: python-%{module} |
9e927ab2 | 13 | Version: 2014.4 |
76c65347 | 14 | Release: 1 |
3342699d | 15 | License: MIT |
1d169444 | 16 | Group: Libraries/Python |
9e927ab2 JB |
17 | Source0: https://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2 |
18 | # Source0-md5: 69078b2e80eeb4e74c4c93089a101bcc | |
b3e14e5b | 19 | Patch0: zoneinfo.patch |
76c65347 | 20 | URL: http://pytz.sourceforge.net/ |
0dbea9c1 | 21 | BuildRequires: sed >= 4.0 |
0089fbb2 | 22 | %if %{with python2} |
a17a0084 | 23 | BuildRequires: python-devel >= 1:2.3 |
3342699d | 24 | BuildRequires: python >= 1:2.3 |
0089fbb2 AF |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
28 | %endif | |
82cff73e | 29 | BuildRequires: rpmbuild(macros) >= 1.469 |
0089fbb2 | 30 | %if %{with python2} |
3342699d | 31 | Requires: python >= 1:2.3 |
0089fbb2 | 32 | %endif |
3342699d | 33 | Requires: tzdata >= %{version} |
1d169444 MG |
34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | pytz brings the Olson tz database into Python. This library allows | |
39 | accurate and cross platform timezone calculations using Python 2.3 or | |
40 | higher. | |
41 | ||
a49ed86c JR |
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, | |
3342699d | 45 | niezależnych od platformy obliczeń uwzględniających strefy czasowe |
a49ed86c | 46 | przy użyciu Pythona w wersji co najmniej 2.3. |
1d169444 | 47 | |
0089fbb2 AF |
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} | |
53 | ||
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 | |
57 | ||
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 | |
63 | ||
1d169444 MG |
64 | %prep |
65 | %setup -q -n %{module}-%{version} | |
6d89867b ER |
66 | |
67 | # strip zones list before patching | |
0dbea9c1 JB |
68 | %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \ |
69 | -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py | |
6d89867b | 70 | |
b3e14e5b | 71 | %patch0 -p1 |
1d169444 MG |
72 | |
73 | %build | |
0089fbb2 AF |
74 | %if %{with python2} |
75 | %{__python} setup.py build --build-base py2 | |
82cff73e | 76 | %py_lint |
0089fbb2 AF |
77 | %endif |
78 | %if %{with python3} | |
79 | %{__python3} setup.py build --build-base py3 | |
80 | %endif | |
1d169444 MG |
81 | |
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
0089fbb2 AF |
84 | %if %{with python2} |
85 | %{__python} setup.py \ | |
86 | build --build-base py2 \ | |
87 | install \ | |
1d169444 | 88 | --root=$RPM_BUILD_ROOT \ |
0089fbb2 | 89 | --optimize=2 |
b3e14e5b | 90 | |
3342699d | 91 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo |
63825ff4 | 92 | %py_postclean |
0089fbb2 AF |
93 | %endif |
94 | ||
95 | %if %{with python3} | |
96 | %{__python3} setup.py \ | |
97 | build --build-base py3 \ | |
98 | install \ | |
99 | --root=$RPM_BUILD_ROOT \ | |
100 | --optimize=2 | |
101 | %endif | |
1d169444 MG |
102 | |
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
0089fbb2 | 106 | %if %{with python2} |
1d169444 MG |
107 | %files |
108 | %defattr(644,root,root,755) | |
3342699d | 109 | %doc CHANGES.txt LICENSE.txt README.txt |
1d169444 | 110 | %{py_sitescriptdir}/pytz |
2df1d822 | 111 | %{py_sitescriptdir}/pytz-%{version}-py*.egg-info |
0089fbb2 AF |
112 | %endif |
113 | ||
114 | %if %{with python3} | |
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 | |
120 | %endif |