]> git.pld-linux.org Git - packages/python-pytz.git/blame_incremental - python-pytz.spec
- updated to 2019.2
[packages/python-pytz.git] / python-pytz.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without python2 # Python 2.x modules
4%bcond_without python3 # Python 3.x modules
5%bcond_without tests # unit tests
6#
7# NOTE:
8# - as we use system tzdata package, keeping this pkg up to the latest is
9# pointless if only data has changed
10# - ...but other packages may require newer version anyway, through egg dependencies
11%define module pytz
12%define pypi_name pytz
13%define olsonver 2019b
14Summary: pytz - Olson timezone database in Python
15Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
16Name: python-%{module}
17Version: 2019.2
18Release: 1
19License: MIT or ZPL v2.1
20Group: Libraries/Python
21#Source0Download: https://pypi.org/simple/pytz/
22Source0: https://files.pythonhosted.org/packages/source/p/pytz/%{pypi_name}-%{version}.tar.gz
23# Source0-md5: 8c21963449c3a793aa61ef122e171516
24Patch0: zoneinfo.patch
25URL: http://pytz.sourceforge.net/
26BuildRequires: rpmbuild(macros) >= 1.714
27BuildRequires: sed >= 4.0
28%if %{with python2}
29BuildRequires: python >= 1:2.3
30BuildRequires: python-devel >= 1:2.4
31BuildRequires: python-setuptools
32%endif
33%if %{with python3}
34BuildRequires: python3-devel >= 1:3.2
35BuildRequires: python3-setuptools
36%endif
37Requires: python-modules >= 1:2.4
38Requires: tzdata-zoneinfo >= %{olsonver}
39BuildArch: noarch
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42%description
43pytz brings the Olson tz database into Python. This library allows
44accurate and cross platform timezone calculations using Python 2.3 or
45higher.
46
47%description -l pl.UTF-8
48pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
49czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
50niezależnych od platformy obliczeń uwzględniających strefy czasowe
51przy użyciu Pythona w wersji co najmniej 2.3.
52
53%package -n python3-%{module}
54Summary: pytz - Olson timezone database in Python 3.x
55Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie 3.x
56Group: Libraries/Python
57Requires: python3-modules >= 1:3.2
58Requires: tzdata-zoneinfo >= %{olsonver}
59
60%description -n python3-%{module}
61pytz brings the Olson tz database into Python. This library allows
62accurate and cross platform timezone calculations using Python 3.x
63
64%description -n python3-%{module} -l pl.UTF-8
65pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
66czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
67niezależnych od platformy obliczeń uwzględniających strefy czasowe
68przy użyciu Pythona 3.x
69
70%prep
71%setup -q -n %{module}-%{version}
72
73# strip zones list before patching
74%{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
75 -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
76
77%patch0 -p1
78
79%build
80v=$(sed -rne "s/^OLSON_VERSION = '(.+)'/\1/p" pytz/__init__.py)
81test "$v" = "%{olsonver}"
82
83%if %{with python2}
84%py_build
85%py_lint
86
87%if %{with tests}
88%{__python} -munittest discover -s pytz/tests
89%endif
90%endif
91
92%if %{with python3}
93%py3_build
94
95%if %{with tests}
96%{__python3} -munittest discover -s pytz/tests
97%endif
98%endif
99
100%install
101rm -rf $RPM_BUILD_ROOT
102
103%if %{with python2}
104%py_install
105
106%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
107%py_postclean
108%endif
109
110%if %{with python3}
111%py3_install
112
113%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytz/zoneinfo
114%endif
115
116%clean
117rm -rf $RPM_BUILD_ROOT
118
119%if %{with python2}
120%files
121%defattr(644,root,root,755)
122%doc LICENSE.txt README.txt
123%{py_sitescriptdir}/pytz
124%{py_sitescriptdir}/pytz-%{version}-py*.egg-info
125%endif
126
127%if %{with python3}
128%files -n python3-%{module}
129%defattr(644,root,root,755)
130%doc LICENSE.txt README.txt
131%{py3_sitescriptdir}/pytz
132%{py3_sitescriptdir}/pytz-%{version}-py*.egg-info
133%endif
This page took 0.091281 seconds and 4 git commands to generate.