]> git.pld-linux.org Git - packages/python-tzlocal.git/blob - python-tzlocal.spec
rebuild with python 3.10
[packages/python-tzlocal.git] / python-tzlocal.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 %define         module  tzlocal
7 Summary:        tzinfo object for the local timezone
8 Name:           python-%{module}
9 Version:        2.1
10 Release:        3
11 License:        MIT
12 Group:          Development/Languages/Python
13 Source0:        https://pypi.python.org/packages/source/t/tzlocal/%{module}-%{version}.tar.gz
14 # Source0-md5:  c0877603ff9de71cd8ca6ee2b50d2ebd
15 URL:            https://github.com/regebro/tzlocal
16 BuildRequires:  rpm-pythonprov
17 BuildRequires:  rpmbuild(macros) >= 1.714
18 %if %{with python2}
19 BuildRequires:  python >= 1:2.7
20 BuildRequires:  python-setuptools
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3 >= 1:3.6
24 BuildRequires:  python3-setuptools
25 %endif
26 Requires:       python-modules >= 1:2.7
27 Requires:       python-pytz
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 This Python module returns a tzinfo object with the local timezone
33 information under Unix and Win-32. It requires pytz, and returns pytz
34 tzinfo objects.
35
36 This module attempts to fix a glaring hole in pytz, that there is no
37 way to get the local timezone information, unless you know the
38 zoneinfo name, and under several Linux distros that’s hard or
39 impossible to figure out.
40
41 %package -n python3-%{module}
42 Summary:        tzinfo object for the local timezone for Python 3
43 Group:          Development/Languages/Python
44 Requires:       python3-modules >= 1:3.6
45 Requires:       python3-pytz
46
47 %description -n python3-%{module}
48 This Python module returns a tzinfo object with the local timezone
49 information under Unix and Win-32. It requires pytz, and returns pytz
50 tzinfo objects.
51
52 This module attempts to fix a glaring hole in pytz, that there is no
53 way to get the local timezone information, unless you know the
54 zoneinfo name, and under several Linux distros that’s hard or
55 impossible to figure out.
56
57 %prep
58 %setup -q -n %{module}-%{version}
59
60 %build
61 %if %{with python2}
62 %py_build
63 %endif
64
65 %if %{with python3}
66 %py3_build
67 %endif
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71
72 %if %{with python2}
73 %py_install
74
75 %py_postclean
76 %endif
77
78 %if %{with python3}
79 %py3_install
80 %endif
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %if %{with python2}
86 %files
87 %defattr(644,root,root,755)
88 %doc CHANGES.txt README.rst
89 %dir %{py_sitescriptdir}/%{module}
90 %{py_sitescriptdir}/%{module}/*.py[co]
91 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
92 %endif
93
94 %if %{with python3}
95 %files -n python3-%{module}
96 %defattr(644,root,root,755)
97 %doc CHANGES.txt README.rst
98 %dir %{py3_sitescriptdir}/%{module}
99 %{py3_sitescriptdir}/%{module}/*.py
100 %{py3_sitescriptdir}/%{module}/__pycache__
101 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
102 %endif
This page took 0.051882 seconds and 3 git commands to generate.