[python-django-debug-toolbar] adjust spec to new python2/3 builds, drop %py3dir

Matthias Runge mrunge at fedoraproject.org
Fri Mar 13 10:21:42 UTC 2015


commit 279b1733eecc890c1029a370ad46e327d9c2192f
Author: Matthias Runge <mrunge at redhat.com>
Date:   Fri Mar 13 11:20:49 2015 +0100

    adjust spec to new python2/3 builds, drop %py3dir

 python-django-debug-toolbar.spec | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/python-django-debug-toolbar.spec b/python-django-debug-toolbar.spec
index 3c8d41d..0f63e2e 100644
--- a/python-django-debug-toolbar.spec
+++ b/python-django-debug-toolbar.spec
@@ -62,7 +62,13 @@ Currently, the following panels have been written and are working:
 %endif
 
 %prep
-%setup -q -n django-debug-toolbar-%{version}
+%setup -qc
+mv django-debug-toolbar-%{version} python2
+pushd python2
+
+# copy LICENSE etc. to top level dir
+cp -a LICENSE ..
+cp -a README.rst PKG-INFO ..
 
 # remove bundled egg-info
 rm -rf django_debug_toolbar.egg-info
@@ -70,32 +76,38 @@ rm -rf django_debug_toolbar.egg-info
 # "Fix" zero length file error
 echo "# empty file" > debug_toolbar/models.py
 
+popd
+
 %if 0%{?with_python3}
-rm -rf %{py3dir}
-cp -a . %{py3dir}
+cp -a python2 python3
 %endif # with_python3
 
 %build
+pushd python2
 %{__python2} setup.py build
+popd
 
 %if 0%{?with_python3}
-pushd %{py3dir}
+pushd python3
 %{__python3} setup.py build
 popd
 %endif # with_python3
 
 %install
 %if 0%{?with_python3}
-pushd %{py3dir}
+pushd python3
 %{__python3} setup.py install --skip-build --root %{buildroot}
 popd
 %endif # with_python3
 
-%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+pushd python2
+%{__python2} setup.py install --skip-build --root %{buildroot}
+popd
 
 %check
+pushd python2
 %{__python2} setup.py test
-
+popd
 
 %files
 %doc README.rst PKG-INFO


More information about the scm-commits mailing list