Last active
June 17, 2020 14:58
-
-
Save borisisok/e5b173072646bd3fd75138c784e9a463 to your computer and use it in GitHub Desktop.
Rebuild varnish-6.2.0 Centos7 rpm packages with the help of mock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum -y install mock | |
adduser mockbuild | |
usermod -a -G mock mockbuild | |
su - mockbuild | |
mock -r epel-7-x86_64 --init | |
wget https://packagecloud.io/varnishcache/varnish62/el/7/SRPMS/varnish-6.2.0-1.el7.src.rpm | |
# rebuild without modification | |
mock -r epel-7-x86_64 --target=x86_64 \ | |
--define "srcname varnish-6.2.0" \ | |
--define "versiontag 6.2.0" \ | |
--define "releasetag 1" \ | |
--rebuild varnish-6.2.0-1.el7.src.rpm | |
# rebuild with some modification in spec or source | |
rpm -ivh varnish-6.2.0-1.el7.src.rpm | |
cd ~/rpmbuild/ | |
vi SPECS/varnish.spec | |
mock -r epel-7-x86_64 --target=x86_64 \ | |
--define "srcname varnish-6.2.0" \ | |
--define "versiontag 6.2.0" \ | |
--define "releasetag 1" \ | |
--spec=SPECS/varnish.spec \ | |
--sources=SOURCES/ \ | |
--buildsrpm | |
cp /var/lib/mock/epel-7-x86_64/result/varnish-6.2.0-1.el7.src.rpm /tmp/ | |
mock -r epel-7-x86_64 --target=x86_64 \ | |
--define "srcname varnish-6.2.0" \ | |
--define "versiontag 6.2.0" \ | |
--define "releasetag 1" \ | |
--rebuild /tmp/varnish-6.2.0-1.el7.src.rpm | |
rpm -qip /var/lib/mock/epel-7-x86_64/result/varnish-6.2.0-1.el7.x86_64.rpm | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The varnish package is a nice example for a mock build since it fails on a plain Centos7 due to a python version clash.