]> git.pld-linux.org Git - packages/python-testtools.git/commitdiff
- added python3 package and doc,python2,python3 bconds auto/th/python-testtools-0.9.34-1 auto/ti/python-testtools-0.9.34-1
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 25 Dec 2013 07:00:45 +0000 (08:00 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 25 Dec 2013 07:00:45 +0000 (08:00 +0100)
python-testtools.spec

index 315e9039eb9164a5497e4e2c5920c075f0c4fc89..5877dd67b58b78f0a3ac6bfc1a61d9dfe35d9276 100644 (file)
@@ -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
This page took 0.129907 seconds and 4 git commands to generate.