From db47e69e340b2b8e1edd46739416fc8361d26384 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Jan 2004 00:57:48 +0000 Subject: conditional install of init scripts git-svn-id: file:///home/lennart/svn/public/ivam2/trunk@54 dbf6933d-3bce-0310-9bcc-ed052ba35b35 --- conf/Makefile.am | 20 ++++++++++++++------ configure.ac | 35 ++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/conf/Makefile.am b/conf/Makefile.am index a8c551f..01a7c98 100644 --- a/conf/Makefile.am +++ b/conf/Makefile.am @@ -19,18 +19,26 @@ pkgsysconfdir=$(sysconfdir)/@PACKAGE@ sysinitdir=@SYSINITDIR@ -pkgsysconf_DATA = msntab ivam2.conf - +pkgsysconf_DATA = msntab noinst_DATA = ivam2.init -EXTRA_DIST = ivam2.init.in $(pkgsysconf_DATA) + +EXTRA_DIST = msntab ivam2.conf ivam2.init.in CLEANFILES = ivam2.init -ivam2.init: ivam2.init.in Makefile - sed -e 's,@pkgsysconfdir\@,$(sysconfdir)/@PACKAGE@,g' -e 's,@sbindir\@,$(sbindir),g' -e 's,@pythondir\@,$(pythondir),g' $< > $@ - chmod 755 $@ +if !NOINITSCRIPT + +pkgsysconf_DATA += ivam2.conf install-data-local: ivam2.init $(INSTALL) -b -D -m755 ivam2.init ${DESTDIR}${sysinitdir}/ivam2 uninstall-local: rm -f ${DESTDIR}${sysconfdir}/init.d/ivam2 + +endif + +ivam2.init: ivam2.init.in Makefile + sed -e 's,@pkgsysconfdir\@,$(sysconfdir)/@PACKAGE@,g' -e 's,@sbindir\@,$(sbindir),g' -e 's,@pythondir\@,$(pythondir),g' $< > $@ + chmod 755 $@ + + diff --git a/configure.ac b/configure.ac index a310c3c..5f98ff8 100644 --- a/configure.ac +++ b/configure.ac @@ -76,24 +76,29 @@ AC_SUBST(LIBOOP_LIBS) # Init script location AC_ARG_WITH(initdir, AS_HELP_STRING(--with-initdir=DIR,Install init script in DIR (system dependent default))) -test "x$with_initdir" = xyes -o "x$with_initdir" = xno && with_initdir= - -if test "x$with_initdir" = x ; then - if test -d /etc/init.d ; then - SYSINITDIR=/etc/init.d - else - if test -d /etc/rc.d/init.d ; then - SYSINITDIR=/etc/rc.d/init.d - else - AC_MSG_ERROR([missing --with-initdir=DIR]) - fi - fi +if test "x$with_initdir" = xno ; then + SYSINITDIR=no + AC_MSG_NOTICE([*** No init script will be installed ***]) else - SYSINITDIR="$with_initdir" -fi + test "x$with_initdir" = xyes && with_initdir= -AC_MSG_NOTICE([*** Init sript will be installed in $SYSINITDIR ***]) + if test "x$with_initdir" = x ; then + if test -d /etc/init.d ; then + SYSINITDIR=/etc/init.d + else + if test -d /etc/rc.d/init.d ; then + SYSINITDIR=/etc/rc.d/init.d + else + AC_MSG_ERROR([missing --with-initdir=DIR]) + fi + fi + else + SYSINITDIR="$with_initdir" + fi + AC_MSG_NOTICE([*** Init script will be installed in $SYSINITDIR ***]) +fi AC_SUBST(SYSINITDIR) +AM_CONDITIONAL(NOINITSCRIPT, test x$SYSINITDIR = xno) # Where to place the spool directory AC_ARG_WITH(spooldir, AS_HELP_STRING(--with-spooldir=DIR,The $PACKAGE spool directory (/var/spool/$PACKAGE))) -- cgit