[packages/python-pytz] Python 3.x version

wiget wiget at pld-linux.org
Wed Jul 18 19:30:06 CEST 2012


commit 0089fbb202aecf498c1c359ba118180d2803ca45
Author: Artur Frysiak <artur at frysiak.net>
Date:   Wed Jul 18 19:29:44 2012 +0200

    Python 3.x version

 python-pytz.spec | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 59 insertions(+), 6 deletions(-)
---
diff --git a/python-pytz.spec b/python-pytz.spec
index a57876b..2c06a8f 100644
--- a/python-pytz.spec
+++ b/python-pytz.spec
@@ -1,3 +1,8 @@
+#
+# Conditional build:
+%bcond_without	python2	# Python 2.x modules
+%bcond_without	python3	# Python 3.x modules
+#
 # NOTE
 # - as we use system tzdata package, keeping this pkg up to the latest is
 #   pointless if only data has changed
@@ -6,17 +11,24 @@ Summary:	pytz - Olson timezone database in Python
 Summary(pl.UTF-8):	pytz - baza stref czasowych Olsona w Pythonie
 Name:		python-%{module}
 Version:	2012c
-Release:	1
+Release:	2
 License:	MIT
 Group:		Libraries/Python
 Source0:	http://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
 # Source0-md5:	660e0cee7f6c419ca2665db460f65131
 Patch0:		zoneinfo.patch
 URL:		http://sourceforge.net/projects/pytz/
+%if %{with python2}
 BuildRequires:	python-devel >= 1:2.3
 BuildRequires:	python >= 1:2.3
+%endif
+%if %{with python3}
+BuildRequires:	python3-devel
+%endif
 BuildRequires:	rpmbuild(macros) >= 1.469
+%if %{with python2}
 Requires:	python >= 1:2.3
+%endif
 Requires:	tzdata >= %{version}
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -32,6 +44,22 @@ czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
 niezależnych od platformy obliczeń uwzględniających strefy czasowe
 przy użyciu Pythona w wersji co najmniej 2.3.
 
+%package -n python3-%{module}
+Summary:	pytz - Olson timezone database in Python 3.x
+Summary(pl.UTF-8):	pytz - baza stref czasowych Olsona w Pythonie 3.x
+Group:		Libraries/Python
+Requires:	tzdata >= %{version}
+
+%description -n python3-%{module}
+pytz brings the Olson tz database into Python. This library allows
+accurate and cross platform timezone calculations using Python 3.x
+
+%description -n python3-%{module} -l pl.UTF-8
+pytz dodaje do Pythona moduł umożliwiający odpytywanie bazy stref
+czasowych Olsona. Moduł ten umożliwia przeprowadzanie dokładnych,
+niezależnych od platformy obliczeń uwzględniających strefy czasowe
+przy użyciu Pythona 3.x
+
 %prep
 %setup -q -n %{module}-%{version}
 
@@ -44,25 +72,50 @@ cat pytz/__init__.py.old | \
 %patch0 -p1
 
 %build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build --build-base py2
 %py_lint
+%endif
+%if %{with python3}
+%{__python3} setup.py build --build-base py3
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
-	--skip-build \
-	--optimize=2 \
+%if %{with python2}
+%{__python} setup.py \
+	build --build-base py2 \
+	install \
 	--root=$RPM_BUILD_ROOT \
+	--optimize=2
 
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytz/zoneinfo
-
 %py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+	build --build-base py3 \
+	install \
+	--root=$RPM_BUILD_ROOT \
+	--optimize=2
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc CHANGES.txt LICENSE.txt README.txt
 %{py_sitescriptdir}/pytz
 %{py_sitescriptdir}/pytz-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGES.txt LICENSE.txt README.txt
+%{py3_sitescriptdir}/pytz
+%{py3_sitescriptdir}/pytz-%{version}-py*.egg-info
+%endif


More information about the pld-cvs-commit mailing list