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