Преглед на файлове

spec: Autogenerate bcond options based on config

Inspired by kronosnet spec file generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse преди 7 години
родител
ревизия
eae6806f52
променени са 3 файла, в които са добавени 20 реда и са изтрити 6 реда
  1. 11 1
      Makefile.am
  2. 7 3
      configure.ac
  3. 2 2
      corosync-qdevice.spec.in

+ 11 - 1
Makefile.am

@@ -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 $@
 

+ 7 - 3
configure.ac

@@ -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
 

+ 2 - 2
corosync-qdevice.spec.in

@@ -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}}