]> git.pld-linux.org Git - packages/python-pytz.git/blob - python-pytz.spec
e2781be8c4fbfb68b93b5d3940fff91ad464ab07
[packages/python-pytz.git] / python-pytz.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # Python 2.x modules
4 %bcond_without  python3 # Python 3.x modules
5 #
6 # NOTE
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
10 %define         module  pytz
11 Summary:        pytz - Olson timezone database in Python
12 Summary(pl.UTF-8):      pytz - baza stref czasowych Olsona w Pythonie
13 Name:           python-%{module}
14 Version:        2015.4
15 Release:        3
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
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.3
25 BuildRequires:  python >= 1:2.3
26 BuildRequires:  python-setuptools
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-devel
30 BuildRequires:  python3-setuptools
31 %endif
32 BuildRequires:  rpmbuild(macros) >= 1.710
33 %if %{with python2}
34 Requires:       python >= 1:2.3
35 %endif
36 Requires:       tzdata >= %{version}
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 pytz brings the Olson tz database into Python. This library allows
42 accurate and cross platform timezone calculations using Python 2.3 or
43 higher.
44
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.
50
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}
56
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
60
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
66
67 %prep
68 %setup -q -n %{module}-%{version}
69
70 # strip zones list before patching
71 %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
72         -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
73
74 %patch0 -p1
75
76 %build
77 %if %{with python2}
78 %py_build --build-base py2
79 %py_lint
80 %endif
81 %if %{with python3}
82 %py3_build --build-base py3
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87 %if %{with python2}
88 %{__python} setup.py \
89         build --build-base py2 \
90         install \
91         --root=$RPM_BUILD_ROOT \
92         --optimize=2
93
94 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
95 %py_postclean
96 %endif
97
98 %if %{with python3}
99 %{__python3} setup.py \
100         build --build-base py3 \
101         install \
102         --root=$RPM_BUILD_ROOT \
103         --optimize=2
104 %endif
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %if %{with python2}
110 %files
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
115 %endif
116
117 %if %{with python3}
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
123 %endif
This page took 0.061615 seconds and 2 git commands to generate.