doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

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

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