[packages/python-tornado] semi-automatic change: use py_build/py_install macros
jajcus
jajcus at pld-linux.org
Sat Nov 28 18:03:57 CET 2015
commit e50bef490952fb41bd4ec0b2b6651e6e0350440f
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Sat Nov 28 18:02:19 2015 +0100
semi-automatic change: use py_build/py_install macros
python-tornado.spec | 37 +++++++++++++++----------------------
1 file changed, 15 insertions(+), 22 deletions(-)
---
diff --git a/python-tornado.spec b/python-tornado.spec
index 93ce701..8aba69f 100644
--- a/python-tornado.spec
+++ b/python-tornado.spec
@@ -53,30 +53,27 @@ require a long-lived connection to each user.
# fix #!/usr/bin/env python -> #!/usr/bin/python:
#%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
-%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 --build-base build-2
-%{?with_tests:%{__python} setup.py test}
+%py_build
+
+%if %{with tests}
+cd build-2/lib
+%{__python} -m tornado.test.runtests
+cd ../..
+%endif
%if %{with python3}
-%{__python3} setup.py build --build-base build-3
-%{?with_tests:%{__python3} setup.py test}
+%py3_build %{?with_tests:test}
+%if %{with tests}
+cd build-3/lib
+%{__python3} -m tornado.test.runtests
+cd ../..
+%endif
%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py \
- build --build-base build-2 \
- install \
- --root=$RPM_BUILD_ROOT \
- --optimize=2
+%py_install
%{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/ca-certificates.crt
ln -sf /etc/certs/ca-certificates.crt $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/ca-certificates.crt
@@ -86,11 +83,7 @@ ln -sf /etc/certs/ca-certificates.crt $RPM_BUILD_ROOT%{py_sitescriptdir}/%{modul
%py_postclean
%if %{with python3}
-%{__python3} setup.py \
- build --build-base build-3 \
- install \
- --root=$RPM_BUILD_ROOT \
- --optimize=2
+%py3_install
%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/ca-certificates.crt
ln -sf /etc/certs/ca-certificates.crt $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/ca-certificates.crt
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-tornado.git/commitdiff/e50bef490952fb41bd4ec0b2b6651e6e0350440f
More information about the pld-cvs-commit
mailing list