[python-tzlocal] added epel support
piotrp
piotrp at fedoraproject.org
Mon Nov 24 20:40:10 UTC 2014
commit 3479a9c54426a1e67b8edbe52d506a1742ee255e
Author: Piotr Popieluch <piotr1212 at gmail.com>
Date: Mon Nov 24 21:39:47 2014 +0100
added epel support
python-tzlocal.spec | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
---
diff --git a/python-tzlocal.spec b/python-tzlocal.spec
index b8646a9..b281d58 100644
--- a/python-tzlocal.spec
+++ b/python-tzlocal.spec
@@ -1,11 +1,25 @@
-%global with_python3 1
+# needed for epel6
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+# enable python3 on fedora
+%if 0%{?fedora}
+%bcond_without python3
+%else
+%bcond_with python3
+%endif
+
%global srcname tzlocal
Name: python-tzlocal
Version: 1.1.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: A Python module that tries to figure out what your local timezone is
+Group: Development/Libraries
License: CC0
URL: https://github.com/regebro/tzlocal
Source0: https://pypi.python.org/packages/source/t/%{srcname}/%{srcname}-%{version}.zip
@@ -16,7 +30,7 @@ Requires: pytz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: pytz
-%if 0%{?with_python3}
+%if %{with python3}
Requires: python3-pytz
BuildRequires: python3-devel
BuildRequires: python3-pytz
@@ -31,7 +45,7 @@ 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}
+%if %{with python3}
%package -n python3-%{srcname}
Summary: A Python module that tries to figure out what your local timezone is
@@ -51,7 +65,7 @@ information, unless you know the zoneinfo name.
rm -rf *.egg-info
-%if 0%{?with_python3}
+%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
@@ -60,7 +74,7 @@ cp -a . %{py3dir}
%build
%{__python2} setup.py build
-%if 0%{?with_python3}
+%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
@@ -68,7 +82,7 @@ popd
%install
-%if 0%{?with_python3}
+%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
@@ -89,7 +103,7 @@ rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py*
%check
%{__python2} setup.py test
-%if 0%{?with_python3}
+%if %{with python3}
%{__python3} setup.py test
%endif
@@ -99,7 +113,7 @@ rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py*
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info
-%if 0%{?with_python3}
+%if %{with python3}
%files -n python3-%{srcname}
%doc PKG-INFO README.rst LICENSE.txt CHANGES.txt
%{python3_sitelib}/%{srcname}
@@ -108,6 +122,9 @@ rm %{buildroot}%{python2_sitelib}/%{srcname}/tests.py*
%changelog
+* Sat Nov 22 2014 Piotr Popieluch <piotr1212 at gmail.com> - 1.1.2-4
+- added epel support
+
* Tue Oct 28 2014 Piotr Popieluch <piotr1212 at gmail.com> - 1.1.2-3
- fixed python3-tzlocal %%summary to match python-tzlocal
More information about the scm-commits
mailing list