]> git.pld-linux.org Git - packages/python-pytz.git/blame - python-pytz.spec
- up to 2013b
[packages/python-pytz.git] / python-pytz.spec
CommitLineData
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 10Summary: pytz - Olson timezone database in Python
e0abfc56 11Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
1d169444 12Name: python-%{module}
41af14b5 13Version: 2013b
76c65347 14Release: 1
3342699d 15License: MIT
1d169444 16Group: Libraries/Python
63825ff4 17Source0: http://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
41af14b5 18# Source0-md5: 34f47470eedd5cd1faf6c3da2741967b
b3e14e5b 19Patch0: zoneinfo.patch
76c65347 20URL: http://pytz.sourceforge.net/
0089fbb2 21%if %{with python2}
a17a0084 22BuildRequires: python-devel >= 1:2.3
3342699d 23BuildRequires: python >= 1:2.3
0089fbb2
AF
24%endif
25%if %{with python3}
26BuildRequires: python3-devel
27%endif
82cff73e 28BuildRequires: rpmbuild(macros) >= 1.469
0089fbb2 29%if %{with python2}
3342699d 30Requires: python >= 1:2.3
0089fbb2 31%endif
3342699d 32Requires: tzdata >= %{version}
1d169444
MG
33BuildArch: noarch
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37pytz brings the Olson tz database into Python. This library allows
38accurate and cross platform timezone calculations using Python 2.3 or
39higher.
40
a49ed86c
JR
41%description -l pl.UTF-8
42pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
43czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
3342699d 44niezależnych od platformy obliczeń uwzględniających strefy czasowe
a49ed86c 45przy użyciu Pythona w wersji co najmniej 2.3.
1d169444 46
0089fbb2
AF
47%package -n python3-%{module}
48Summary: pytz - Olson timezone database in Python 3.x
49Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie 3.x
50Group: Libraries/Python
51Requires: tzdata >= %{version}
52
53%description -n python3-%{module}
54pytz brings the Olson tz database into Python. This library allows
55accurate and cross platform timezone calculations using Python 3.x
56
57%description -n python3-%{module} -l pl.UTF-8
58pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
59czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
60niezależnych od platformy obliczeń uwzględniających strefy czasowe
61przy użyciu Pythona 3.x
62
1d169444
MG
63%prep
64%setup -q -n %{module}-%{version}
6d89867b
ER
65
66# strip zones list before patching
67mv pytz/__init__.py pytz/__init__.py.old
68cat pytz/__init__.py.old | \
69%{__sed} -e "/^all_timezones = \\\/,/^ 'WET',/d" | %{__sed} -e "/^common_timezones = \\\/,/ 'UTC'/d" \
70> pytz/__init__.py
71
b3e14e5b 72%patch0 -p1
1d169444
MG
73
74%build
0089fbb2
AF
75%if %{with python2}
76%{__python} setup.py build --build-base py2
82cff73e 77%py_lint
0089fbb2
AF
78%endif
79%if %{with python3}
80%{__python3} setup.py build --build-base py3
81%endif
1d169444
MG
82
83%install
84rm -rf $RPM_BUILD_ROOT
0089fbb2
AF
85%if %{with python2}
86%{__python} setup.py \
87 build --build-base py2 \
88 install \
1d169444 89 --root=$RPM_BUILD_ROOT \
0089fbb2 90 --optimize=2
b3e14e5b 91
3342699d 92%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
63825ff4 93%py_postclean
0089fbb2
AF
94%endif
95
96%if %{with python3}
97%{__python3} setup.py \
98 build --build-base py3 \
99 install \
100 --root=$RPM_BUILD_ROOT \
101 --optimize=2
102%endif
1d169444
MG
103
104%clean
105rm -rf $RPM_BUILD_ROOT
106
0089fbb2 107%if %{with python2}
1d169444
MG
108%files
109%defattr(644,root,root,755)
3342699d 110%doc CHANGES.txt LICENSE.txt README.txt
1d169444 111%{py_sitescriptdir}/pytz
2df1d822 112%{py_sitescriptdir}/pytz-%{version}-py*.egg-info
0089fbb2
AF
113%endif
114
115%if %{with python3}
116%files -n python3-%{module}
117%defattr(644,root,root,755)
118%doc CHANGES.txt LICENSE.txt README.txt
119%{py3_sitescriptdir}/pytz
120%{py3_sitescriptdir}/pytz-%{version}-py*.egg-info
121%endif
This page took 0.157254 seconds and 4 git commands to generate.