libreport/SOURCES/9000-Add-autogen.sh.patch

117 lines
3.1 KiB
Diff

From 9636b85c5570911c753bc8074ce5bd73f490d4da Mon Sep 17 00:00:00 2001
From: Michal Fabik <mfabik@redhat.com>
Date: Wed, 19 Jun 2019 13:42:07 +0200
Subject: [PATCH] Add autogen.sh
---
autogen.sh | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100755 autogen.sh
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..fd48b5f0
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+print_help()
+{
+cat << EOH
+Prepares the source tree for configuration
+
+Usage:
+ autogen.sh [sysdeps [--install]]
+
+Options:
+
+ sysdeps prints out all dependencies
+ --install install all dependencies ('sudo yum install \$DEPS')
+
+EOH
+}
+
+parse_build_requires_from_spec_file()
+{
+ PACKAGE=$1
+ TEMPFILE=$(mktemp -u --suffix=.spec)
+ sed 's/@@LIBREPORT_VERSION@@/1/' < $PACKAGE.spec.in | sed 's/@.*@//' > $TEMPFILE
+ rpmspec -P $TEMPFILE | grep "^\(Build\)\?Requires:" | \
+ tr -s " " | tr "," "\n" | cut -f2- -d " " | \
+ grep -v "\(^\|python[23]-\)"$PACKAGE | sort -u | sed -E 's/^(.*) (.*)$/"\1 \2"/' | tr \" \'
+ rm $TEMPFILE
+}
+
+list_build_dependencies()
+{
+ local BUILD_SYSTEM_DEPS_LIST="gettext-devel"
+ echo $BUILD_SYSTEM_DEPS_LIST $(parse_build_requires_from_spec_file libreport)
+}
+
+case "$1" in
+ "--help"|"-h")
+ print_help
+ exit 0
+ ;;
+ "sysdeps")
+ DEPS_LIST=$(list_build_dependencies)
+
+ if [ "$2" == "--install" ]; then
+ set -x verbose
+ eval sudo dnf install --setopt=strict=0 $DEPS_LIST
+ set +x verbose
+ else
+ echo $DEPS_LIST
+ fi
+ exit 0
+ ;;
+ *)
+ echo "Running gen-version"
+ ./gen-version
+
+ mkdir -p m4
+ echo "Creating m4/aclocal.m4 ..."
+ test -r m4/aclocal.m4 || touch m4/aclocal.m4
+
+ echo "Running autopoint"
+ autopoint --force || exit 1
+
+ echo "Running intltoolize..."
+ intltoolize --force --copy --automake || exit 1
+
+ echo "Running aclocal..."
+ aclocal || exit 1
+
+ echo "Running libtoolize..."
+ libtoolize || exit 1
+
+ echo "Running autoheader..."
+ autoheader || return 1
+
+ echo "Running autoconf..."
+ autoconf --force || exit 1
+
+ echo "Running automake..."
+ automake --add-missing --force --copy || exit 1
+
+ echo "Running configure ..."
+ if [ 0 -eq $# ]; then
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --sharedstatedir=/var/lib \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-debug
+ echo "Configured for local debugging ..."
+ else
+ ./configure "$@"
+ fi
+ ;;
+esac
--
2.21.0