]> git.pld-linux.org Git - packages/python-pytz.git/blob - python-pytz.spec
- updated to 2013d
[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
9 %define         module  pytz
10 Summary:        pytz - Olson timezone database in Python
11 Summary(pl.UTF-8):      pytz - baza stref czasowych Olsona w Pythonie
12 Name:           python-%{module}
13 Version:        2013d
14 Release:        1
15 License:        MIT
16 Group:          Libraries/Python
17 Source0:        http://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
18 # Source0-md5:  634c5fab45c6ebaf35985acf0080011f
19 Patch0:         zoneinfo.patch
20 URL:            http://pytz.sourceforge.net/
21 BuildRequires:  sed >= 4.0
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.3
24 BuildRequires:  python >= 1:2.3
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel
28 %endif
29 BuildRequires:  rpmbuild(macros) >= 1.469
30 %if %{with python2}
31 Requires:       python >= 1:2.3
32 %endif
33 Requires:       tzdata >= %{version}
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
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,
45 niezależnych od platformy obliczeń uwzględniających strefy czasowe
46 przy użyciu Pythona w wersji co najmniej 2.3.
47
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
64 %prep
65 %setup -q -n %{module}-%{version}
66
67 # strip zones list before patching
68 %{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
69         -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
70
71 %patch0 -p1
72
73 %build
74 %if %{with python2}
75 %{__python} setup.py build --build-base py2
76 %py_lint
77 %endif
78 %if %{with python3}
79 %{__python3} setup.py build --build-base py3
80 %endif
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 %if %{with python2}
85 %{__python} setup.py \
86         build --build-base py2 \
87         install \
88         --root=$RPM_BUILD_ROOT \
89         --optimize=2
90
91 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
92 %py_postclean
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
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %files
108 %defattr(644,root,root,755)
109 %doc CHANGES.txt LICENSE.txt README.txt
110 %{py_sitescriptdir}/pytz
111 %{py_sitescriptdir}/pytz-%{version}-py*.egg-info
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
This page took 0.057448 seconds and 4 git commands to generate.