summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac14
-rw-r--r--extras/LinuxRPM/Makefile.am17
-rwxr-xr-xextras/LinuxRPM/make_glusterrpms9
3 files changed, 35 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index ca657347ea4..69c3934c4a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -244,6 +244,20 @@ case $host_os in
;;
esac
+AC_ARG_WITH([previous-options],
+ [AS_HELP_STRING([--with-previous-options],
+ [read config.status for configure options])
+ ],
+ [ if test -r ./config.status && \
+ args=$(grep 'ac_cs_config=' config.status | \
+ sed -e 's/.*"\(.*\)".*/\1/'| sed -e "s/'//g") ; then
+ echo "###"
+ echo "### Rerunning as '$0 $args'"
+ echo "###"
+ exec $0 $args
+ fi
+ ])
+
AC_ARG_WITH(pkgconfigdir,
[ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
[pkgconfigdir=$withval],
diff --git a/extras/LinuxRPM/Makefile.am b/extras/LinuxRPM/Makefile.am
index b82c65f02c4..64b6f2a90eb 100644
--- a/extras/LinuxRPM/Makefile.am
+++ b/extras/LinuxRPM/Makefile.am
@@ -6,15 +6,22 @@ GFS_TAR = ../../glusterfs-$(VERSION).tar.gz
all:
@echo "To build RPMS run 'make glusterrpms'"
-.PHONY: glusterrpms prep srcrpm testsrpm clean
+.PHONY: glusterrpms glusterrpms_without_autogen
+.PHONY: autogen prep srcrpm testsrpm clean
-glusterrpms: prep srcrpm rpms
+glusterrpms: autogen glusterrpms_without_autogen
+
+glusterrpms_without_autogen: prep srcrpm rpms
-rm -rf rpmbuild
+autogen:
+ cd /../.. \
+ && rm -rf autom4te.cache \
+ && ./autogen.sh \
+ && ./configure --with-previous-options
+
prep:
- if [ ! -e $(GFS_TAR) ]; then \
- $(MAKE) -C ../.. dist; \
- fi
+ $(MAKE) -C ../.. dist;
-mkdir -p rpmbuild/BUILD
-mkdir -p rpmbuild/SPECS
-mkdir -p rpmbuild/RPMS
diff --git a/extras/LinuxRPM/make_glusterrpms b/extras/LinuxRPM/make_glusterrpms
new file mode 100755
index 00000000000..3156af97870
--- /dev/null
+++ b/extras/LinuxRPM/make_glusterrpms
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+(
+ cd $(realpath $(dirname $0))/../.. || exit 1
+ rm -rf autom4te.cache
+ ./autogen.sh || exit 1
+ ./configure --with-previous-options || exit 1
+)
+make -C $(realpath $(dirname $0)) glusterrpms_without_autogen