f9f924
From 608a4c07f4e3a0410f4cf9d5463ac5156bdc2745 Mon Sep 17 00:00:00 2001
f9f924
From: Martin Kutlak <mkutlak@redhat.com>
f9f924
Date: Thu, 3 Jan 2019 13:08:22 +0100
f9f924
Subject: [PATCH] Add autogen.sh
f9f924
f9f924
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
f9f924
---
f9f924
 autogen.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
f9f924
 1 file changed, 70 insertions(+)
f9f924
 create mode 100755 autogen.sh
f9f924
f9f924
diff --git a/autogen.sh b/autogen.sh
f9f924
new file mode 100755
f9f924
index 000000000..80a431b1f
f9f924
--- /dev/null
f9f924
+++ b/autogen.sh
f9f924
@@ -0,0 +1,70 @@
f9f924
+#!/bin/sh
f9f924
+
f9f924
+print_help()
f9f924
+{
f9f924
+cat << EOH
f9f924
+Prepares the source tree for configuration
f9f924
+
f9f924
+Usage:
f9f924
+  autogen.sh [sydeps [--install]]
f9f924
+
f9f924
+Options:
f9f924
+
f9f924
+  sysdeps          prints out all dependencies
f9f924
+    --install      install all dependencies ('sudo yum install \$DEPS')
f9f924
+
f9f924
+EOH
f9f924
+}
f9f924
+
f9f924
+build_depslist()
f9f924
+{
f9f924
+    DEPS_LIST=`grep "^\(Build\)\?Requires:" *.spec.in | grep -v "%{name}" | tr -s " " | tr "," "\n" | cut -f2 -d " " | grep -v "^abrt" | sort -u | while read br; do if [ "%" = ${br:0:1} ]; then grep "%define $(echo $br | sed -e 's/%{\(.*\)}/\1/')" *.spec.in | tr -s " " | cut -f4 -d" "; else echo $br ;fi ; done | tr "\n" " "`
f9f924
+}
f9f924
+
f9f924
+case "$1" in
f9f924
+    "--help"|"-h")
f9f924
+            print_help
f9f924
+            exit 0
f9f924
+        ;;
f9f924
+    "sysdeps")
f9f924
+            build_depslist
f9f924
+
f9f924
+            if [ "$2" == "--install" ]; then
f9f924
+                set -x verbose
f9f924
+                sudo yum install $DEPS_LIST
f9f924
+                set +x verbose
f9f924
+            else
f9f924
+                echo $DEPS_LIST
f9f924
+            fi
f9f924
+            exit 0
f9f924
+        ;;
f9f924
+    *)
f9f924
+            echo "Running gen-version"
f9f924
+            ./gen-version
f9f924
+
f9f924
+            mkdir -p m4
f9f924
+            echo "Creating m4/aclocal.m4 ..."
f9f924
+            test -r m4/aclocal.m4 || touch m4/aclocal.m4
f9f924
+
f9f924
+            echo "Running autopoint"
f9f924
+            autopoint --force || exit 1
f9f924
+
f9f924
+            echo "Running intltoolize..."
f9f924
+            intltoolize --force --copy --automake || exit 1
f9f924
+
f9f924
+            echo "Running aclocal..."
f9f924
+            aclocal || exit 1
f9f924
+
f9f924
+            echo "Running libtoolize..."
f9f924
+            libtoolize || exit 1
f9f924
+
f9f924
+            echo "Running autoheader..."
f9f924
+            autoheader || return 1
f9f924
+
f9f924
+            echo "Running autoconf..."
f9f924
+            autoconf --force || exit 1
f9f924
+
f9f924
+            echo "Running automake..."
f9f924
+            automake --add-missing --force --copy || exit 1
f9f924
+        ;;
f9f924
+esac
f9f924
-- 
f9f924
2.17.2
f9f924