]> git.pld-linux.org Git - packages/python-tzlocal.git/blame - python-tzlocal.spec
rebuild with tests and docs
[packages/python-tzlocal.git] / python-tzlocal.spec
CommitLineData
a95ec29b
JP
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
7Summary: tzinfo object for the local timezone
8Name: python-%{module}
9Version: 2.1
feeb08d9 10Release: 5
a95ec29b
JP
11License: MIT
12Group: Development/Languages/Python
13Source0: https://pypi.python.org/packages/source/t/tzlocal/%{module}-%{version}.tar.gz
14# Source0-md5: c0877603ff9de71cd8ca6ee2b50d2ebd
15URL: https://github.com/regebro/tzlocal
16BuildRequires: rpm-pythonprov
17BuildRequires: rpmbuild(macros) >= 1.714
18%if %{with python2}
19BuildRequires: python >= 1:2.7
20BuildRequires: python-setuptools
21%endif
22%if %{with python3}
23BuildRequires: python3 >= 1:3.6
24BuildRequires: python3-setuptools
25%endif
26Requires: python-modules >= 1:2.7
27Requires: python-pytz
28BuildArch: noarch
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32This Python module returns a tzinfo object with the local timezone
33information under Unix and Win-32. It requires pytz, and returns pytz
34tzinfo objects.
35
36This module attempts to fix a glaring hole in pytz, that there is no
37way to get the local timezone information, unless you know the
38zoneinfo name, and under several Linux distros that’s hard or
39impossible to figure out.
40
41%package -n python3-%{module}
42Summary: tzinfo object for the local timezone for Python 3
43Group: Development/Languages/Python
44Requires: python3-modules >= 1:3.6
45Requires: python3-pytz
46
47%description -n python3-%{module}
48This Python module returns a tzinfo object with the local timezone
49information under Unix and Win-32. It requires pytz, and returns pytz
50tzinfo objects.
51
52This module attempts to fix a glaring hole in pytz, that there is no
53way to get the local timezone information, unless you know the
54zoneinfo name, and under several Linux distros that’s hard or
55impossible 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
70rm -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
83rm -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.109899 seconds and 4 git commands to generate.