From b322642a03e0b662aab57849ad599cce213e1b29 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 2 Apr 2014 19:10:54 +0200 Subject: [PATCH] contrib/rpm: add script build_clean.sh to create clean RPM files --- contrib/fedora/rpm/build.sh | 2 +- contrib/fedora/rpm/build_clean.sh | 36 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 contrib/fedora/rpm/build_clean.sh diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 60a8676976..048ffac5ad 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -54,7 +54,7 @@ setup_nmtui() { } ORIGDIR="$(readlink -f "$PWD")" -SCRIPTDIR="$(readlink -f "$(dirname "$0")")" +SCRIPTDIR="$(dirname "$(readlink -f "$0")")" LOG "Change to directory \"$SCRIPTDIR\"" cd "$SCRIPTDIR" || die "could not change into $SCRIPTDIR" GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")" diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh new file mode 100755 index 0000000000..36d7ad1b09 --- /dev/null +++ b/contrib/fedora/rpm/build_clean.sh @@ -0,0 +1,36 @@ +#!/bin/bash + + +die() { + echo "$*" >&2 + exit 1 +} + +# copy output also to logfile +LOG() { + echo "$*" +} + + +ORIGDIR="$(readlink -f "$PWD")" +SCRIPTDIR="$(dirname "$(readlink -f "$0")")" +GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")" + + +[[ -x "$SCRIPTDIR"/build.sh ]] || die "could not find \"$SCRIPTDIR/build.sh\"" + +cd "$GITDIR" || die "could not change to $GITDIR" + +# check for a clean working directory. +# We ignore the /contrib directory, because this is where the automation +# scripts and the build results will be. +if [[ "x$(git clean -ndx -e /contrib )" != x ]]; then + die "The working copy is not clean. Refuse to run. Try git clean -e /contrib -dx -n" +fi + +./autogen.sh --enable-gtk-doc || die "Error autogen.sh" +make -j 10 || die "Error make" + +make distcheck || die "Error make distcheck" + +"$SCRIPTDIR"/build.sh