Allow users to enable initd scripts support in iprutils for distros that
support it.  One can run ../configure --with-initscripts to building the
init files.

This modifies the default behavior to not generate initd scripts by
default.  From now on, to generate them user must use --with-initscripts.

The default for --with-initscripts is to install scripts to
%{prefix}/etc/init.d.  That can be overriden using
--with-initscripts=<path>.

Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
---
 configure.ac       | 19 +++++++++++++++++++
 init.d/Makefile.am | 10 ++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6f392ef..6e25fe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,25 @@ AC_ARG_WITH([systemd],
 AM_CONDITIONAL([SYSTEMD], [test "x${systemd}" = xtrue])
 AC_SUBST(systemdunitdir, ${systemdunitdir})
 
+# --with-initd
+initddir="${prefix}/etc/init.d/"
+AC_ARG_WITH([initscripts],
+           [--with-initscripts Enable initd files.],
+[case $withval in
+     yes)
+        initd=true;
+       ;;
+     no)
+       initd=false;
+       ;;
+     *)
+       initd=true;
+       initddir="$withval"
+       ;;
+ esac], [initd=false])
+AM_CONDITIONAL([INITD], [test "x${initd}" = xtrue])
+AC_SUBST(initddir, ${initddir})
+
 ## Check for python if building with sosreport.
 if test "x${SOSREPORT_TRUE}" = "x"; then
    AM_PATH_PYTHON([2.6])
diff --git a/init.d/Makefile.am b/init.d/Makefile.am
index 9120a3d..4348d2f 100644
--- a/init.d/Makefile.am
+++ b/init.d/Makefile.am
@@ -10,12 +10,14 @@
 %: %.in
        sed -e 's,[@]sbindir[@],$(sbindir),g' < $< > $@
 
-nodist_pkgdata_DATA = iprdump iprinit iprupdate
-dist_pkgdata_DATA = iprdump.in iprinit.in iprupdate.in
+if INITD
+nodist_initd_SCRIPTS = iprdump iprinit iprupdate
+endif
 
 clean-local:
-       rm iprdump iprinit iprupdate iprha
+       -rm iprdump iprinit iprupdate iprha
 
 sysconfdir=@sysconfdir@/ha.d/resource.d
 nodist_sysconf_DATA = iprha
-dist_sysconf_DATA = iprha.in
+
+EXTRA_DIST = iprdump.in iprinit.in iprupdate.in iprha.in
-- 
2.1.0


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to