[packages/python-testtools] - added python3 package and doc,python2,python3 bconds
qboosh
qboosh at pld-linux.org
Wed Dec 25 08:00:36 CET 2013
commit 337b28ee7fcb06dc379a9852bbb876bd7a1c9902
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Dec 25 08:00:45 2013 +0100
- added python3 package and doc,python2,python3 bconds
python-testtools.spec | 93 ++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 81 insertions(+), 12 deletions(-)
---
diff --git a/python-testtools.spec b/python-testtools.spec
index 315e903..5877dd6 100644
--- a/python-testtools.spec
+++ b/python-testtools.spec
@@ -1,6 +1,9 @@
#
# Conditional build:
-%bcond_without tests # do not perform "make test"
+%bcond_without doc # HTML (sphinx-based) documentation
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+%bcond_without tests # do not perform tests
Summary: Extensions to the Python unit testing framework
Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
@@ -12,14 +15,24 @@ Group: Development/Tools
Source0: https://pypi.python.org/packages/source/t/testtools/testtools-%{version}.tar.gz
# Source0-md5: 51d37e7376a70cee40cf17b44889fc88
URL: https://launchpad.net/testtools
-BuildRequires: python-Sphinx
+%if %{with python2}
BuildRequires: python-devel >= 1:2.6
%if %{with tests}
+BuildRequires: python-devel-tools
BuildRequires: python-extras
BuildRequires: python-mimeparse
%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+%if %{with tests}
+BuildRequires: python3-devel-tools
+BuildRequires: python3-extras
+BuildRequires: python3-mimeparse
+%endif
+%endif
BuildRequires: rpmbuild(macros) >= 1.219
-BuildRequires: sphinx-pdg
+%{?with_doc:BuildRequires: sphinx-pdg}
Requires: python-extras
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -32,6 +45,20 @@ testing framework.
testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
biblioteki standardowej Pythona.
+%package -n python3-testtools
+Summary: Extensions to the Python unit testing framework
+Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
+Group: Development/Tools
+Requires: python3-extras
+
+%description -n python3-testtools
+testtools is a set of extensions to the Python standard library's unit
+testing framework.
+
+%description -n python3-testtools -l pl.UTF-8
+testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
+biblioteki standardowej Pythona.
+
%package doc
Summary: Documentation for %{name}
Summary(pl.UTF-8): Dokumentacja do pakietu %{name}
@@ -48,27 +75,50 @@ Dokumentacja HTML do pakietu %{name}.
%setup -q -n testtools-%{version}
%build
-%{__python} setup.py build
-%{__make} -C doc html
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ %{?with_tests:test}
+%endif
-%if %{with tests}
-%{__python} setup.py test
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ %{?with_tests:test}
+%endif
+
+%if %{with doc}
+%{__make} -C doc html
%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- -O2 \
- --skip-build \
- --root $RPM_BUILD_ROOT
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
%py_postclean
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
+
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
%doc LICENSE NEWS README.rst
@@ -79,7 +129,26 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py_sitescriptdir}/testtools/testresult
%{py_sitescriptdir}/testtools/testresult/*.py[co]
%{py_sitescriptdir}/testtools-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-testtools
+%defattr(644,root,root,755)
+%doc LICENSE NEWS README.rst
+%dir %{py3_sitescriptdir}/testtools
+%{py3_sitescriptdir}/testtools/*.py
+%{py3_sitescriptdir}/testtools/__pycache__
+%dir %{py3_sitescriptdir}/testtools/matchers
+%{py3_sitescriptdir}/testtools/matchers/*.py
+%{py3_sitescriptdir}/testtools/matchers/__pycache__
+%dir %{py3_sitescriptdir}/testtools/testresult
+%{py3_sitescriptdir}/testtools/testresult/*.py
+%{py3_sitescriptdir}/testtools/testresult/__pycache__
+%{py3_sitescriptdir}/testtools-%{version}-py*.egg-info
+%endif
+%if %{with doc}
%files doc
%defattr(644,root,root,755)
%doc doc/_build/html/*
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-testtools.git/commitdiff/337b28ee7fcb06dc379a9852bbb876bd7a1c9902
More information about the pld-cvs-commit
mailing list