contrib/fedora: Add mockbuild.sh

This script comes handy to build from git tree without having to
install build dependencies on the system, the actual build happens
inside mock environment.

https://github.com/NetworkManager/NetworkManager/pull/34
This commit is contained in:
Murilo Opsfelder Araujo 2017-10-27 10:52:19 -02:00 committed by Thomas Haller
parent 1ee6dea02f
commit fa61e78d80
2 changed files with 24 additions and 0 deletions

View file

@ -21,3 +21,7 @@ sudo sh ./contrib/fedora/REQUIRED_PACKAGES
#
sudo dnf install ./contrib/fedora/rpm/latest/RPMS/x86_64/*rpm
# To generate a clean build from git using mock, run:
./contrib/fedora/rpm/mockbuild.sh

20
contrib/fedora/rpm/mockbuild.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
#
# mockbuild.sh
#
# Generate SRPM from git tree and rebuild it using mock.
SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
FEDORAVER=$(sed -E 's/.*([0-9]{2}).*/\1/g' /etc/fedora-release)
ARCH=$(uname -m)
SRPM=${SCRIPTDIR}/latest/SRPMS/NetworkManager*.src.rpm
alias mock="mock -r fedora-${FEDORAVER}-${ARCH}"
# Generate SRPM
${SCRIPTDIR}/build_clean.sh --srpm --git
# Rebuild SRPM
mock --rebuild ${SRPM}
exit