51098ba
%global with_python3 1
51098ba
%global srcname tzlocal
51098ba
51098ba
Name:           python-tzlocal
51098ba
Version:        1.1.2
011a5a6
Release:        3%{?dist}
51098ba
Summary:        A Python module that tries to figure out what your local timezone is
51098ba
51098ba
License:        CC0
51098ba
URL:            https://github.com/regebro/tzlocal
51098ba
Source0:        https://pypi.python.org/packages/source/t/%{srcname}/%{srcname}-%{version}.zip
51098ba
51098ba
BuildArch:      noarch
51098ba
51098ba
Requires:       pytz
51098ba
BuildRequires:  python-devel
51098ba
BuildRequires:  python-setuptools
51098ba
BuildRequires:  pytz
51098ba
%if 0%{?with_python3}
51098ba
Requires:       python3-pytz
51098ba
BuildRequires:  python3-devel
51098ba
BuildRequires:  python3-pytz
51098ba
BuildRequires:  python3-setuptools
51098ba
%endif
51098ba
51098ba
51098ba
%description
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.
51098ba
51098ba
51098ba
%if 0%{?with_python3}
51098ba
%package -n python3-%{srcname}
51098ba
Summary:        A Python module that tries to figure out what your local timezone is
51098ba
51098ba
License:        CC0
51098ba
51098ba
%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.
51098ba
51098ba
%endif
51098ba
51098ba
51098ba
%prep
51098ba
%setup -q -n %{srcname}-%{version}
51098ba
51098ba
rm -rf *.egg-info
51098ba
51098ba
%if 0%{?with_python3}
51098ba
rm -rf %{py3dir}
51098ba
cp -a . %{py3dir}
51098ba
%endif
51098ba
51098ba
51098ba
%build
51098ba
%{__python2} setup.py build
51098ba
51098ba
%if 0%{?with_python3}
51098ba
pushd %{py3dir}
51098ba
%{__python3} setup.py build
51098ba
popd
51098ba
%endif
51098ba
51098ba
51098ba
%install
51098ba
%if 0%{?with_python3}
51098ba
pushd %{py3dir}
51098ba
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
51098ba
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*
51098ba
popd
51098ba
%endif
51098ba
51098ba
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
51098ba
51098ba
# Don't install unit tests and test_data
51098ba
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/test_data
51098ba
rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py*
51098ba
51098ba
51098ba
%check
51098ba
%{__python2} setup.py test
51098ba
51098ba
%if 0%{?with_python3}
51098ba
%{__python3} setup.py test
51098ba
%endif
51098ba
51098ba
51098ba
%files
51098ba
%doc PKG-INFO README.rst LICENSE.txt CHANGES.txt
51098ba
%{python2_sitelib}/%{srcname}
51098ba
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info
51098ba
51098ba
%if 0%{?with_python3}
51098ba
%files -n python3-%{srcname}
51098ba
%doc PKG-INFO README.rst LICENSE.txt CHANGES.txt
51098ba
%{python3_sitelib}/%{srcname}
51098ba
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
51098ba
%endif
51098ba
51098ba
51098ba
%changelog
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