rpm packaging: use macro for python binary
authorLi Jinjing <jinjingx.li@intel.com>
Wed, 20 Aug 2014 06:25:02 +0000 (14:25 +0800)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 21 Aug 2014 06:00:28 +0000 (09:00 +0300)
For fedora distro, when building git-buildpackage rpm packages in the buildroot,
/bin/python is called to do python setup.py actions during rpmbuild,which leads
to /bin/python is taken as requirement of git-buildpackage-rpm-0.6.15-0.noarch.rpm
automatically, resulting in:

Install gbs with dnf command in fedora distro will raise error:
nothing provides /bin/python needed by git-buildpackage-rpm-0.6.12-59.1.noarch

Fixes: DEVT-197

Change-Id: I30169a506d7f92aed759124c40beb2803c196218
Signed-off-by: Li Jinjing <jinjingx.li@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
packaging/git-buildpackage.spec

index 12af022..b808f11 100644 (file)
@@ -135,7 +135,7 @@ Debian and the RPM tool set.
 
 
 %build
-WITHOUT_NOSETESTS=1 python ./setup.py build
+WITHOUT_NOSETESTS=1 %{__python} ./setup.py build
 
 %if %{with docs}
 # Prepare apidocs
@@ -152,13 +152,13 @@ HAVE_SGML2X=0 make -C docs/
 GIT_CEILING_DIRECTORIES=%{_builddir} \
     GIT_AUTHOR_EMAIL=rpmbuild@example.com GIT_AUTHOR_NAME=rpmbuild \
     GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL \
-    python setup.py nosetests
+    %{__python} setup.py nosetests
 %endif
 
 
 %install
 rm -rf %{buildroot}
-WITHOUT_NOSETESTS=1 python ./setup.py install --root=%{buildroot} --prefix=/usr
+WITHOUT_NOSETESTS=1 %{__python} ./setup.py install --root=%{buildroot} --prefix=/usr
 rm -rf %{buildroot}%{python_sitelib}/*info
 
 %if %{with docs}