3479a9
# enable python3 on fedora
3479a9
%if 0%{?fedora}
3479a9
%bcond_without python3
3479a9
%else
3479a9
%bcond_with python3
3479a9
%endif
3479a9
51098b
%global srcname tzlocal
1f7276
%global sum A Python module that tries to figure out what your local timezone is
51098b
51098b
Name:           python-tzlocal
df347a
Version:        1.5.1
62638a
Release:        4%{?dist}
1f7276
Summary:        %{sum}
51098b
df347a
License:        MIT
51098b
URL:            https://github.com/regebro/tzlocal
df347a
# pypi/pythonhosted tarballs don't respect symlinks which are used in the test
df347a
Source0:        https://github.com/regebro/tzlocal/archive/%{version}/%{name}-%{version}.tar.gz
51098b
51098b
BuildArch:      noarch
51098b
1f7276
BuildRequires:  python2-devel
df347a
BuildRequires:  python2-mock
1f7276
BuildRequires:  python2-pytz
1f7276
BuildRequires:  python2-setuptools
1f7276
3479a9
%if %{with python3}
51098b
BuildRequires:  python3-devel
df347a
BuildRequires:  python3-mock
51098b
BuildRequires:  python3-pytz
51098b
BuildRequires:  python3-setuptools
51098b
%endif
51098b
51098b
51098b
%description
51098b
This Python module returns a tzinfo object with the local timezone information. 
51098b
It requires pytz, and returns pytz tzinfo objects.  This module attempts to fix 
51098b
a glaring hole in pytz, that there is no way to get the local timezone 
51098b
information, unless you know the zoneinfo name.
51098b
51098b
1f7276
%package -n python2-%{srcname}
1f7276
Summary:        %{sum}
df347a
License:        MIT
1f7276
Requires:       python2-pytz
1f7276
%{?python_provide:%python_provide python2-%{srcname}}
1f7276
1f7276
%description -n python2-%{srcname}
1f7276
This Python module returns a tzinfo object with the local timezone information. 
1f7276
It requires pytz, and returns pytz tzinfo objects.  This module attempts to fix 
1f7276
a glaring hole in pytz, that there is no way to get the local timezone 
1f7276
information, unless you know the zoneinfo name.
1f7276
1f7276
3479a9
%if %{with python3}
51098b
%package -n python3-%{srcname}
1f7276
Summary:        %{sum}
df347a
License:        MIT
1f7276
Requires:       python3-pytz
1f7276
%{?python_provide:%python_provide python3-%{srcname}}
51098b
51098b
%description -n python3-%{srcname}
51098b
This Python module returns a tzinfo object with the local timezone information. 
51098b
It requires pytz, and returns pytz tzinfo objects.  This module attempts to fix 
51098b
a glaring hole in pytz, that there is no way to get the local timezone 
51098b
information, unless you know the zoneinfo name.
51098b
%endif
51098b
51098b
51098b
%prep
1f7276
%autosetup -n %{srcname}-%{version}
51098b
51098b
rm -rf *.egg-info
51098b
51098b
51098b
%build
1f7276
%py2_build
3479a9
%if %{with python3}
1f7276
%py3_build
51098b
%endif
51098b
51098b
51098b
%install
1f7276
%py2_install
1f7276
# Don't install unit tests and test_data
1f7276
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/test_data
1f7276
rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py*
51098b
1f7276
%if %{with python3}
1f7276
%py3_install
51098b
# Don't install unit tests and test_data
51098b
rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/test_data
51098b
rm %{buildroot}%{python3_sitelib}/%{srcname}/tests.py
51098b
rm %{buildroot}%{python3_sitelib}/%{srcname}/__pycache__/tests.cpython*
51098b
%endif
51098b
51098b
51098b
%check
51098b
%{__python2} setup.py test
51098b
3479a9
%if %{with python3}
51098b
%{__python3} setup.py test
51098b
%endif
51098b
51098b
1f7276
%files -n python2-%{srcname}
df347a
%doc README.rst CHANGES.txt
b62c1c
%license LICENSE.txt
51098b
%{python2_sitelib}/%{srcname}
51098b
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info
51098b
1f7276
3479a9
%if %{with python3}
51098b
%files -n python3-%{srcname}
df347a
%doc README.rst CHANGES.txt
b62c1c
%license LICENSE.txt
51098b
%{python3_sitelib}/%{srcname}
51098b
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
51098b
%endif
51098b
51098b
51098b
%changelog
62638a
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-4
62638a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
62638a
054bf1
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.5.1-3
054bf1
- Rebuilt for Python 3.7
054bf1
9f31f0
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-2
9f31f0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
9f31f0
df347a
* Tue Jan 09 2018 Piotr Popieluch <piotr1212@gmail.com> - 1.5.1-1
df347a
- Update to 1.5.1
df347a
9b8653
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-4
9b8653
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9b8653
aebedc
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-3
aebedc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
aebedc
9f425b
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.3-2
9f425b
- Rebuild for Python 3.6
9f425b
cea6c9
* Wed Nov 09 2016 piotr1212@gmail.com - 1.3-1
cea6c9
- Update to upstream 1.3
cea6c9
- Update specfile to latest python packaging guidelines
cea6c9
a4bdc7
* Wed Nov 09 2016 piotr1212@gmail.com - 1.2-6
a4bdc7
- Move python3-pytz requires to python3 subpackage (RHBZ#1393397)
a4bdc7
301f14
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5
301f14
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
301f14
876060
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-4
876060
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
876060
4b222a
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-3
4b222a
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
4b222a
5472d9
* Fri Nov 06 2015 Piotr Popieluch <piotr1212@gmail.com> - 1.2-2
5472d9
- Rebuilt for python 3.5
5472d9
b62c1c
* Fri Jul 03 2015 Piotr Popieluch <piotr1212@gmail.com> - 1.2-1
b62c1c
- Update to 1.2
b62c1c
756a55
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-5
756a55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
756a55
3479a9
* Sat Nov 22 2014 Piotr Popieluch <piotr1212@gmail.com> - 1.1.2-4
3479a9
- added epel support
3479a9
011a5a
* Tue Oct 28 2014 Piotr Popieluch <piotr1212@gmail.com> - 1.1.2-3
011a5a
- fixed python3-tzlocal %%summary to match python-tzlocal
011a5a
51098b
* Sat Oct 25 2014 Piotr Popieluch <piotr1212@gmail.com> - 1.1.2-2
51098b
- deleted group tag
51098b
- added license to python3 module
51098b
- rewritten summary
51098b
- wrapped description
51098b
- added rm -rf *.egg-info to %%prep
51098b
- added comments to the rm commands in %%install section
51098b
51098b
* Fri Oct 24 2014 Piotr Popieluch <piotr1212@gmail.com> - 1.1.2-1
51098b
- Initial package