]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
spec: Autogenerate bcond options based on config
authorJan Friesse <jfriesse@redhat.com>
Wed, 22 Aug 2018 11:11:00 +0000 (13:11 +0200)
committerJan Friesse <jfriesse@redhat.com>
Wed, 22 Aug 2018 11:17:14 +0000 (13:17 +0200)
Inspired by kronosnet spec file generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Makefile.am
configure.ac
corosync-qdevice.spec.in

index a926e3f6362a97a4f318942b2342b1f6f9e2dff1..f4e595672500a4d3e0ecfcbf567ecdd11509961c 100644 (file)
@@ -109,7 +109,17 @@ $(SPEC): $(SPEC).in
                -e "s#@NUMCOMM@#$$numcomm#g" \
                -e "s#@DIRTY@#$$dirty#g" \
                -e "s#@date@#$$date#g" \
-       $< > $@-t; \
+       $< > $@-t
+if BUILD_RUNAUTOGEN
+       sed -i -e "s#@bcond_runautogen@#bcond_without#g" $@-t
+else
+       sed -i -e "s#@bcond_runautogen@#bcond_with#g" $@-t
+endif
+if INSTALL_SYSTEMD
+       sed -i -e "s#@bcond_systemd@#bcond_without#g" $@-t
+else
+       sed -i -e "s#@bcond_systemd@#bcond_with#g" $@-t
+endif
        chmod a-w $@-t
        mv $@-t $@
 
index 0b1ff0dee33a0b8640308bbaa47610c8179f47c3..16d20b72e6bee0d1b81bd9dfd82c2be95dbd32ca 100644 (file)
@@ -139,7 +139,7 @@ AC_ARG_ENABLE([secure-build],
        [enable_secure_build="yes"])
 
 AC_ARG_ENABLE([systemd],
-             [  --enable-systemd                : Install systemd service files],,
+             [  --enable-systemd                : Build with libsystemd and install systemd service files],,
        [ enable_systemd="no" ])
 AM_CONDITIONAL(INSTALL_SYSTEMD, test x$enable_systemd = xyes)
 
@@ -161,13 +161,17 @@ AC_ARG_WITH([systemddir],
        [ SYSTEMDDIR="/lib/systemd/system" ])
 
 AC_ARG_ENABLE([qdevices],
-       [  --disable-qdevices               : Quorum devices support ],,
+       [  --disable-qdevices              : Quorum devices support ],,
        [ enable_qdevices="yes" ])
 AM_CONDITIONAL(BUILD_QDEVICES, test x$enable_qdevices = xyes)
 AC_ARG_ENABLE([qnetd],
-       [  --disable-qnetd                  : Quorum Net Daemon support ],,
+       [  --disable-qnetd                 : Quorum Net Daemon support ],,
        [ enable_qnetd="yes" ])
 AM_CONDITIONAL(BUILD_QNETD, test x$enable_qnetd = xyes)
+AC_ARG_ENABLE([runautogen],
+       [  --enable-runautogen             : run autogen.sh (RPM specfile)],,
+       [ enable_runautogen="no" ])
+AM_CONDITIONAL([BUILD_RUNAUTOGEN], [test x$enable_runautogen = xyes])
 
 # *FLAGS handling goes here
 
index 9c5ecaa28281d17c4cef0b13d2c3cc3e4ded5ee4..82cc2b5a4a5bc092aa7ee7e5ffc6a177a1453960 100644 (file)
@@ -5,8 +5,8 @@
 # Conditionals
 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
 # to disable or enable specific features
-%bcond_with runautogen
-%bcond_with systemd
+%@bcond_runautogen@ runautogen
+%@bcond_systemd@ systemd
 
 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}