Blame SOURCES/1000-Add-autogen.sh.patch

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