]> git.pld-linux.org Git - packages/python-pytest.git/commitdiff
up to 2.3.4, add python3 package auto/th/python-pytest-2.3.4-1
authorElan Ruusamäe <glen@delfi.ee>
Sat, 16 Mar 2013 23:26:24 +0000 (01:26 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 16 Mar 2013 23:30:08 +0000 (01:30 +0200)
python-pytest.spec

index 217ac73b74992c647cbbf0791f68049b0a347db0..06169f74d5beee2b427024e0def948c5af026a28 100644 (file)
@@ -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
This page took 0.10554 seconds and 4 git commands to generate.