[GF-Users] rpm: Restart your build and reuse the build products

Pry Mar pryorm09 at gmail.com
Wed May 13 19:51:17 MST 2020


Hello GhettoForge,

[About]
Restart your build and reuse the build products.

The %prep_reuse macro will cause the %prep and %build spec scripts to
skip through and exit before anything is done.
Then rpmbuild will continue with your %install spec script.

Our method allows you to avoid restarting your build from absolute zero when
a silly error happens in %install, %files, or %post.

[Files]
add_reuse.sh
rpmmacros-append

[Method]
Copy the above files to /builddir/build/SPECS via untar of the attached

// import %prep_reuse
cat rpmmacros-append >> ~/.rpmmacros

// edit this script with your tarversion and pkgname
./add_reuse.sh pkg.spec > pkg.spec.reuse

// run and reuse, notice the _with_reuse macro
rpmbuild -bb --with reuse --nocheck pkg.spec.reuse

[Example Run]
[mockbuild at mock SPECS]$ rpmbuild -bb --with reuse --nocheck
libvirt-python.spec.reuse
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Y0tZhn
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ cd libvirt-python-5.1.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.2zy9yq
+ umask 022
+ cd /builddir/build/BUILD
+ cd libvirt-python-5.1.0
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.oAWfRt
+ umask 022
+ cd /builddir/build/BUILD
(etc)

[Author]
PryMar56
##xen-packaging on Freenode IRC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpm-build-reuse.tar.xz
Type: application/x-xz
Size: 1056 bytes
Desc: not available
Url : http://lists.ghettoforge.org/pipermail/users/attachments/20200513/d77f7854/attachment.bin 


More information about the users mailing list