NetworkManager/contrib/fedora/rpm/mockbuild.sh
Murilo Opsfelder Araujo fa61e78d80 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
2017-10-30 11:04:20 +01:00

20 lines
421 B
Bash
Executable file

#!/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