Browse Source

Ticket 48447 - with-initddir should accept no

Bug Description:  When porting to other platforms we should not install RH style
init scripts.

Fix Description:  Allow setting "no" to initddir which will prevent creation of
any init scripts.

https://fedorahosted.org/389/ticket/48447

Author: wibrown

Review by: nhosoi (Thanks!)
William Brown 9 years ago
parent
commit
2b38becf4b
4 changed files with 27 additions and 10 deletions
  1. 5 1
      Makefile.am
  2. 3 3
      Makefile.in
  3. 16 3
      configure
  4. 3 3
      configure.ac

+ 5 - 1
Makefile.am

@@ -695,16 +695,20 @@ systemdsystemunit_DATA = wrappers/$(PACKAGE_NAME)@.service \
 	wrappers/$(systemdgroupname) \
 	wrappers/$(PACKAGE_NAME)-snmp.service
 else
+if INITDDIR
 init_SCRIPTS = wrappers/$(PACKAGE_NAME) \
 	wrappers/$(PACKAGE_NAME)-snmp
 endif
+endif
 
 if SYSTEMD
 initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) \
 	wrappers/$(PACKAGE_NAME).systemd
-else
+else 
+if INITDDIR
 initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME)
 endif
+endif
 
 inf_DATA = ldap/admin/src/slapd.inf \
 	ldap/admin/src/scripts/dscreate.map \

+ 3 - 3
Makefile.in

@@ -2112,10 +2112,10 @@ task_SCRIPTS = ldap/admin/src/scripts/template-bak2db \
 @SYSTEMD_TRUE@	wrappers/$(systemdgroupname) \
 @SYSTEMD_TRUE@	wrappers/$(PACKAGE_NAME)-snmp.service
 
-@SYSTEMD_FALSE@init_SCRIPTS = wrappers/$(PACKAGE_NAME) \
-@SYSTEMD_FALSE@	wrappers/$(PACKAGE_NAME)-snmp
+@INITDDIR_TRUE@@SYSTEMD_FALSE@init_SCRIPTS = wrappers/$(PACKAGE_NAME) \
+@INITDDIR_TRUE@@SYSTEMD_FALSE@	wrappers/$(PACKAGE_NAME)-snmp
 
-@SYSTEMD_FALSE@initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME)
+@INITDDIR_TRUE@@SYSTEMD_FALSE@initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME)
 @SYSTEMD_TRUE@initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) \
 @SYSTEMD_TRUE@	wrappers/$(PACKAGE_NAME).systemd
 

+ 16 - 3
configure

@@ -724,6 +724,8 @@ LIBNSL
 LIBSOCKET
 LIBCRYPT
 THREADLIB
+INITDDIR_FALSE
+INITDDIR_TRUE
 WINNT_FALSE
 WINNT_TRUE
 instconfigdir
@@ -18358,9 +18360,6 @@ $as_echo_n "checking for --with-initddir... " >&6; }
 # Check whether --with-initddir was given.
 if test "${with_initddir+set}" = set; then :
   withval=$with_initddir;
-  if test "$withval" = yes -o "$withval" = no  ; then
-     as_fn_error $? "Please specify a full path with --with-initddir" "$LINENO" 5
-  fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
 $as_echo "$withval" >&6; }
 
@@ -18371,6 +18370,15 @@ $as_echo "no" >&6; }
 
 fi
 
+
+ if test -n "$with_initddir" -a "$with_initddir" != "no"; then
+  INITDDIR_TRUE=
+  INITDDIR_FALSE='#'
+else
+  INITDDIR_TRUE='#'
+  INITDDIR_FALSE=
+fi
+
 # on most platforms, we will just use perl from PATH
 # On some platforms, we cannot.  Why not just use any old
 # perl?  Because of perldap.  We use a perldap that is
@@ -18649,6 +18657,7 @@ esac
 if test -n "$with_initddir" ; then
    initdir="$with_initddir"
 fi
+
 # sysv init scripts not used when systemd is used
 
 
@@ -21696,6 +21705,10 @@ if test -z "${WINNT_TRUE}" && test -z "${WINNT_FALSE}"; then
   as_fn_error $? "conditional \"WINNT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${INITDDIR_TRUE}" && test -z "${INITDDIR_FALSE}"; then
+  as_fn_error $? "conditional \"INITDDIR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HPUX_TRUE}" && test -z "${HPUX_FALSE}"; then
   as_fn_error $? "conditional \"HPUX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5

+ 3 - 3
configure.ac

@@ -463,14 +463,13 @@ AC_ARG_WITH(initddir,
         AS_HELP_STRING([--with-initddir=/path],
                        [Absolute path (not relative like some of the other options) that should contain the SysV init scripts (default '$(sysconfdir)/rc.d')]),
 [
-  if test "$withval" = yes -o "$withval" = no  ; then
-     AC_ERROR([Please specify a full path with --with-initddir])
-  fi
   AC_MSG_RESULT($withval)
 ],
 [
   AC_MSG_RESULT(no)
 ])
+
+AM_CONDITIONAL([INITDDIR], [test -n "$with_initddir" -a "$with_initddir" != "no"])
 # on most platforms, we will just use perl from PATH
 # On some platforms, we cannot.  Why not just use any old
 # perl?  Because of perldap.  We use a perldap that is
@@ -618,6 +617,7 @@ esac
 if test -n "$with_initddir" ; then
    initdir="$with_initddir"
 fi
+
 # sysv init scripts not used when systemd is used
 AC_SUBST(initdir)
 AC_SUBST(perlexec)