[packages/python-pytest] up to 2.3.4, add python3 package

glen glen at pld-linux.org
Sun Mar 17 01:22:25 CET 2013


commit e49832385cc4b5b7bc5f91c0856479fce84e1795
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Mar 17 01:26:24 2013 +0200

    up to 2.3.4, add python3 package

 python-pytest.spec | 75 ++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 65 insertions(+), 10 deletions(-)
---
diff --git a/python-pytest.spec b/python-pytest.spec
index 217ac73..06169f7 100644
--- a/python-pytest.spec
+++ b/python-pytest.spec
@@ -1,25 +1,35 @@
 #
 # Conditional build:
 %bcond_without	doc	# HTML documentation build
-#
+%bcond_without	python3 # CPython 3.x module
+
+%define		pylib_version	1.4.12
+%define 	module	pytest
 Summary:	Simple and popular testing tool for Python
 Summary(pl.UTF-8):	Proste i popularne narzędzie testujące dla Pythona
-Name:		python-pytest
-Version:	2.2.4
+Name:		python-%{module}
+Version:	2.3.4
 Release:	1
 License:	MIT
 Group:		Development/Languages/Python
 Source0:	http://pypi.python.org/packages/source/p/pytest/pytest-%{version}.zip
-# Source0-md5:	73ed098e39978890b83cbea1f1ab2a74
+# Source0-md5:	db319fef9c310dc46798b285d3da3aa1
 URL:		http://pytest.org/
 BuildRequires:	python-devel >= 2.4
+BuildRequires:	python-py >= %{pylib_version}
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	sed >= 4.0
 %if %{with doc}
-BuildRequires:	python-py >= 1.4.8
 BuildRequires:	sphinx-pdg >= 1.0
 %endif
-Requires:	python-py >= 1.4.8
+%if %{with python3}
+BuildRequires:	python3-devel
+BuildRequires:	python3-modules
+BuildRequires:	python3-py >= %{pylib_version}
+BuildRequires:	python3-setuptools
+%endif
+Requires:	python-py >= %{pylib_version}
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -29,19 +39,53 @@ py.test is a simple and popular testing tool for Python.
 %description -l pl.UTF-8
 py.test to proste i popularne narzędzie testujące dla Pythona.
 
+%package -n python3-pytest
+Summary:	Simple powerful testing with Python
+Group:		Development/Languages
+Requires:	python3-py >= %{pylib_version}
+Requires:	python3-setuptools
+
+%description -n python3-pytest
+py.test provides simple, yet powerful testing for Python.
+
 %prep
-%setup -q -n pytest-%{version}
+%setup -q -n %{module}-%{version}
+
+%if %{with python3}
+rm -rf build-3
+set -- *
+install -d build-3
+cp -a "$@" build-3
+find build-3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif
 
 %build
 %{__python} setup.py build
 
+%if %{with python3}
+%{__python3} setup.py \
+	build -b build-3
+%endif
+
 %if %{with doc}
-PYTHONPATH=$(pwd) \
-%{__make} -C doc html
+install -d _htmldocs/html
+for l in doc/*; do
+	PYTHONPATH=$(pwd) \
+	%{__make} -C $l html
+	# remove hidden file
+	rm $l/_build/html/.buildinfo
+	mv $l/_build/html _htmldocs/html/${l##doc/}
+done
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
+%{__python3} -- setup.py \
+	build -b build-3 \
+	install \
+	--root=$RPM_BUILD_ROOT \
+	--optimize=2
+
 %{__python} setup.py install \
 	--optimize=2 \
 	--root=$RPM_BUILD_ROOT
@@ -53,9 +97,20 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGELOG LICENSE README.txt %{?with_doc:doc/_build/html}
+%doc CHANGELOG LICENSE README.txt %{?with_doc:_htmldocs/html}
 %attr(755,root,root) %{_bindir}/py.test
 %attr(755,root,root) %{_bindir}/py.test-%{py_ver}
 %{py_sitescriptdir}/pytest.py[co]
 %{py_sitescriptdir}/_pytest
 %{py_sitescriptdir}/pytest-%{version}-py*.egg-info
+
+%if %{with python3}
+%files -n python3-pytest
+%defattr(644,root,root,755)
+%doc CHANGELOG LICENSE README.txt %{?with_doc:_htmldocs/html}
+%attr(755,root,root) %{_bindir}/py.test-%{py3_ver}
+%{py3_sitescriptdir}/%{module}.py
+%{py3_sitescriptdir}/_pytest
+%{py3_sitescriptdir}/__pycache__/%{module}.*.py[co]
+%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pytest.git/commitdiff/e49832385cc4b5b7bc5f91c0856479fce84e1795



More information about the pld-cvs-commit mailing list