summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurilo Opsfelder Araujo <mopsfelder@gmail.com>2017-10-27 10:52:19 -0200
committerThomas Haller <thaller@redhat.com>2017-11-02 15:32:56 +0100
commit5f2855fad96552dabd712c50c9a0014f3a12b2d2 (patch)
tree782eaee33743faf2a04a935d78207bb959b0a5ea
parent3cd716e2296da9ac39afef5308f08a3ab5b770a1 (diff)
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 (cherry picked from commit fa61e78d80af2d1b482a8dde59f3f6cc727672a8)
-rw-r--r--contrib/fedora/rpm/README4
-rwxr-xr-xcontrib/fedora/rpm/mockbuild.sh20
2 files changed, 24 insertions, 0 deletions
diff --git a/contrib/fedora/rpm/README b/contrib/fedora/rpm/README
index 4e17397be..5e710c28c 100644
--- a/contrib/fedora/rpm/README
+++ b/contrib/fedora/rpm/README
@@ -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
diff --git a/contrib/fedora/rpm/mockbuild.sh b/contrib/fedora/rpm/mockbuild.sh
new file mode 100755
index 000000000..785aa2545
--- /dev/null
+++ b/contrib/fedora/rpm/mockbuild.sh
@@ -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