]> arthur.barton.de Git - netatalk.git/commitdiff
Fix --enable-overwrite:
authorsrittau <srittau>
Sat, 6 Oct 2001 15:57:26 +0000 (15:57 +0000)
committersrittau <srittau>
Sat, 6 Oct 2001 15:57:26 +0000 (15:57 +0000)
 * Moved the main functionality from configure.in to config/Makefile.am.
   I think it belongs in the latter file.
 * No need to duplicate the list of files to install in configure.in.
   This was misleading and confusing and could lead to bugs. (I wondered
   today, why changes to config/Makefile.am didn't work.)
 * --disable-overwrite does now work as one would expect (i.e. it forces
   configuration not to be overwritten).
 * netatalk.pamd will not get installed in $(pkgconfdir)/netatalk.
 * We do now have a proper "check whether configuration files should be
   overwritten... [yes/no]" message.

config/Makefile.am
configure.in

index 5ad4f5bbc60c9ccd54cb2df4eab0278fedb7b8de..93982de56d1d51e61e0fda3d897b183c964bbe0e 100644 (file)
@@ -7,12 +7,12 @@ TMPLFILES = $(foreach file,$(GENFILES),$(file).tmpl)
 CONFFILES = AppleVolumes.default AppleVolumes.system \
        atalkd.conf netatalk.conf papd.conf
 PAMFILES = netatalk.pamd
+OVERWRITE_CONFIG = @OVERWRITE_CONFIG@
 
 EXTRA_DIST = $(CONFFILES) $(TMPLFILES) $(PAMFILES)
 
-CLEANFILES += $(GENFILES)
+CLEANFILES = $(GENFILES)
 
-pkgconf_DATA = @OVERWRITE@
 pkgconfdir = @PKGCONFDIR@
 
 #
@@ -25,20 +25,35 @@ pkgconfdir = @PKGCONFDIR@
            -e s@:ETCDIR:@${pkgconfdir}@ \
            <$< >$@
 
+#
+# install configuration files
+#
+
+install-config-files: $(CONFFILES) $(GENFILES)
+       $(mkinstalldirs) $(DESTDIR)$(pkgconfdir)
+       for f in $(CONFFILES) $(GENFILES); do \
+               if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -e $(DESTDIR)$(pkgconfdir)/$$f; then \
+                       echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir)"; \
+                       $(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir); \
+               else \
+                       echo "not overwriting $$f"; \
+               fi; \
+       done
+
 #
 # pluggable authentication modules support
 #
 
 if USE_PAM
 
-pamdir   = $(sysconfdir)/pam.d
+pamdir = $(sysconfdir)/pam.d
 
-install-data-local:
+install-data-local: install-config-files
        $(mkinstalldirs) $(DESTDIR)$(pamdir)
        $(INSTALL_DATA) netatalk.pamd $(DESTDIR)$(pamdir)/netatalk
 
 else
 
-install-data-local:
+install-data-local: install-config-files
 
 endif 
index e6ac09578d28443b41d7908ad914851f5a3efae1..ed723faf054575d29a2021aa1da419fdf6f1964b 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.107 2001-10-03 22:02:16 jmarcus Exp $
+dnl $Id: configure.in,v 1.108 2001-10-06 15:57:26 srittau Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -727,26 +727,14 @@ AC_ARG_ENABLE(krb4-uam,
 )
 dnl --------------------- overwrite the config files . . . or not.
 
-files="AppleVolumes.default AppleVolumes.system atalkd.conf netatalk.conf netatalk.pamd papd.conf afpd.conf"
-
+AC_MSG_CHECKING([whether configuration files should be overwritten])
 AC_ARG_ENABLE(overwrite,
        [  --enable-overwrite      Overwrite configuration files
                                   default=PKGCONFDIR],
-       [ 
-       OVERWRITE="$files"
-       AC_MSG_RESULT([Overwrite configuration files])
-       ],
-       
-       [       
-       for f in $files ; do
-               if test -f "${PKGCONFDIR}/$f" ; 
-               then :;
-               else OVERWRITE="${OVERWRITE} $f";
-               fi
-       done
-       AC_MSG_RESULT([Don't overwrite existing configuration files])
-       ]       
+       [OVERWRITE_CONFIG="${enable_overwrite}"],
+       [OVERWRITE_CONFIG="no"]
 )
+AC_MSG_RESULT([$OVERWRITE_CONFIG])
 
 dnl --------------------- last minute substitutions
 
@@ -756,7 +744,7 @@ AC_SUBST(PAPD_LIBS)
 AC_SUBST(CFLAGS)
 AC_SUBST(LDSHAREDFLAGS)
 AC_SUBST(PKGCONFDIR)
-AC_SUBST(OVERWRITE)
+AC_SUBST(OVERWRITE_CONFIG)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)