[libvirt] [jenkins-ci PATCH 1/5] jobs: Call rpmbuild explicitly for Python projects

Andrea Bolognani abologna at redhat.com
Fri Aug 10 13:37:41 UTC 2018


Instead of using the custom 'rpm' target of setup.py,
generate a dist archive using the 'sdist' target and then
call rpmbuild ourselves: this way we can define _topdir
and stop artifacts from ending up in ~/rpmbuild.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 jobs/python-distutils.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/jobs/python-distutils.yaml b/jobs/python-distutils.yaml
index 0b20b17..5601d26 100644
--- a/jobs/python-distutils.yaml
+++ b/jobs/python-distutils.yaml
@@ -122,7 +122,9 @@
           {global_env}
           {local_env}
           sed -i -e 's/BuildRequires: libvirt.*devel.*//' *.spec.in
-          $PYTHON ./setup.py rpm
+          rm -f dist/*.tar.{{ archive_format }}
+          $PYTHON ./setup.py sdist
+          rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta dist/*.tar.{{ archive_format }}
     publishers:
       - email:
           recipients: '{obj:spam}'
-- 
2.17.1




More information about the libvir-list mailing list