contrib/rpm: add script build_clean.sh to create clean RPM files

This commit is contained in:
Thomas Haller 2014-04-02 19:10:54 +02:00
parent 886366d0fd
commit b322642a03
2 changed files with 37 additions and 1 deletions

View file

@ -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")"

View file

@ -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