]> git.pld-linux.org Git - packages/python-pytz.git/blame - python-pytz.spec
- updated to 2018.5
[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
db98e45d 5%bcond_without tests # unit tests
0089fbb2 6#
0b9d7830 7# NOTE:
6d89867b 8# - as we use system tzdata package, keeping this pkg up to the latest is
0b9d7830
JB
9# pointless if only data has changed
10# - ...but other packages may require newer version anyway, through egg dependencies
e6b8d84a
ER
11%define module pytz
12%define pypi_name pytz
0b9d7830 13%define olsonver 2018e
1d169444 14Summary: pytz - Olson timezone database in Python
e0abfc56 15Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
1d169444 16Name: python-%{module}
0b9d7830
JB
17Version: 2018.5
18Release: 1
17510524 19License: MIT or ZPL v2.1
1d169444 20Group: Libraries/Python
db98e45d
JB
21#Source0Download: https://pypi.org/simple/pytz/
22Source0: https://files.pythonhosted.org/packages/source/p/pytz/%{pypi_name}-%{version}.tar.gz
0b9d7830 23# Source0-md5: 45409cbfa3927bdd2f3ee914dd5b1060
b3e14e5b 24Patch0: zoneinfo.patch
76c65347 25URL: http://pytz.sourceforge.net/
db98e45d 26BuildRequires: rpmbuild(macros) >= 1.714
0dbea9c1 27BuildRequires: sed >= 4.0
0089fbb2 28%if %{with python2}
3342699d 29BuildRequires: python >= 1:2.3
0b9d7830 30BuildRequires: python-devel >= 1:2.4
d30d1254 31BuildRequires: python-setuptools
0089fbb2
AF
32%endif
33%if %{with python3}
db98e45d 34BuildRequires: python3-devel >= 1:3.2
d30d1254 35BuildRequires: python3-setuptools
0089fbb2 36%endif
0b9d7830 37Requires: python-modules >= 1:2.4
fa19a5fc 38Requires: tzdata-zoneinfo >= %{olsonver}
1d169444
MG
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
a49ed86c
JR
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,
3342699d 50niezależnych od platformy obliczeń uwzględniających strefy czasowe
a49ed86c 51przy użyciu Pythona w wersji co najmniej 2.3.
1d169444 52
0089fbb2
AF
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
db98e45d 57Requires: python3-modules >= 1:3.2
fa19a5fc 58Requires: tzdata-zoneinfo >= %{olsonver}
0089fbb2
AF
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
1d169444
MG
70%prep
71%setup -q -n %{module}-%{version}
6d89867b
ER
72
73# strip zones list before patching
0dbea9c1
JB
74%{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
75 -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
6d89867b 76
b3e14e5b 77%patch0 -p1
1d169444
MG
78
79%build
59e720fb
ER
80v=$(sed -rne "s/^OLSON_VERSION = '(.+)'/\1/p" pytz/__init__.py)
81test "$v" = "%{olsonver}"
82
0089fbb2 83%if %{with python2}
4ccf24df 84%py_build
82cff73e 85%py_lint
db98e45d
JB
86
87%if %{with tests}
88%{__python} -munittest discover -s pytz/tests
0089fbb2 89%endif
db98e45d
JB
90%endif
91
0089fbb2 92%if %{with python3}
4ccf24df 93%py3_build
db98e45d
JB
94
95%if %{with tests}
96%{__python3} -munittest discover -s pytz/tests
97%endif
0089fbb2 98%endif
1d169444
MG
99
100%install
101rm -rf $RPM_BUILD_ROOT
db98e45d 102
0089fbb2 103%if %{with python2}
4ccf24df 104%py_install
db98e45d 105
3342699d 106%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
63825ff4 107%py_postclean
0089fbb2
AF
108%endif
109
110%if %{with python3}
4ccf24df 111%py3_install
db98e45d
JB
112
113%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytz/zoneinfo
0089fbb2 114%endif
1d169444
MG
115
116%clean
117rm -rf $RPM_BUILD_ROOT
118
0089fbb2 119%if %{with python2}
1d169444
MG
120%files
121%defattr(644,root,root,755)
db98e45d 122%doc LICENSE.txt README.txt
1d169444 123%{py_sitescriptdir}/pytz
2df1d822 124%{py_sitescriptdir}/pytz-%{version}-py*.egg-info
0089fbb2
AF
125%endif
126
127%if %{with python3}
128%files -n python3-%{module}
129%defattr(644,root,root,755)
db98e45d 130%doc LICENSE.txt README.txt
0089fbb2
AF
131%{py3_sitescriptdir}/pytz
132%{py3_sitescriptdir}/pytz-%{version}-py*.egg-info
133%endif
This page took 0.125866 seconds and 4 git commands to generate.