From 51098ba0a6500964775df9b76adfdd75d305201b Mon Sep 17 00:00:00 2001 From: Piotr Popieluch Date: Oct 27 2014 19:29:47 +0000 Subject: Initial import (#1156619). --- diff --git a/.gitignore b/.gitignore index e69de29..815e284 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/tzlocal-1.1.2.zip diff --git a/python-tzlocal.spec b/python-tzlocal.spec new file mode 100644 index 0000000..de4ad64 --- /dev/null +++ b/python-tzlocal.spec @@ -0,0 +1,120 @@ +%global with_python3 1 +%global srcname tzlocal + +Name: python-tzlocal +Version: 1.1.2 +Release: 2%{?dist} +Summary: A Python module that tries to figure out what your local timezone is + +License: CC0 +URL: https://github.com/regebro/tzlocal +Source0: https://pypi.python.org/packages/source/t/%{srcname}/%{srcname}-%{version}.zip + +BuildArch: noarch + +Requires: pytz +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: pytz +%if 0%{?with_python3} +Requires: python3-pytz +BuildRequires: python3-devel +BuildRequires: python3-pytz +BuildRequires: python3-setuptools +%endif + + +%description +This Python module returns a tzinfo object with the local timezone information. +It requires pytz, and returns pytz tzinfo objects. This module attempts to fix +a glaring hole in pytz, that there is no way to get the local timezone +information, unless you know the zoneinfo name. + + +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: A Python module that tries to figure out what your local timezone is + +License: CC0 + +%description -n python3-%{srcname} +This Python module returns a tzinfo object with the local timezone information. +It requires pytz, and returns pytz tzinfo objects. This module attempts to fix +a glaring hole in pytz, that there is no way to get the local timezone +information, unless you know the zoneinfo name. + +%endif + + +%prep +%setup -q -n %{srcname}-%{version} + +rm -rf *.egg-info + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + + +%install +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} + +# Don't install unit tests and test_data +rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/test_data +rm %{buildroot}%{python3_sitelib}/%{srcname}/tests.py +rm %{buildroot}%{python3_sitelib}/%{srcname}/__pycache__/tests.cpython* +popd +%endif + +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} + +# Don't install unit tests and test_data +rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/test_data +rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py* + + +%check +%{__python2} setup.py test + +%if 0%{?with_python3} +%{__python3} setup.py test +%endif + + +%files +%doc PKG-INFO README.rst LICENSE.txt CHANGES.txt +%{python2_sitelib}/%{srcname} +%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%doc PKG-INFO README.rst LICENSE.txt CHANGES.txt +%{python3_sitelib}/%{srcname} +%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info +%endif + + +%changelog +* Sat Oct 25 2014 Piotr Popieluch - 1.1.2-2 +- deleted group tag +- added license to python3 module +- rewritten summary +- wrapped description +- added rm -rf *.egg-info to %%prep +- added comments to the rm commands in %%install section + +* Fri Oct 24 2014 Piotr Popieluch - 1.1.2-1 +- Initial package diff --git a/sources b/sources index e69de29..0a3bd7a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +0ed82c55c4ab1463ffc74a792fda7e2b tzlocal-1.1.2.zip