changeset 419:d209b4846f2b

The pid files goes to /var/run/masqmail.pid now. Added --with-piddir. Now we can change the pid dir to /run on system that did this transition.
author markus schnalke <meillo@marmaro.de>
date Tue, 29 May 2012 21:35:17 +0200 (2012-05-29)
parents 4cbaf6d6793f
children 09da6e72cd30
files INSTALL Makefile.am Makefile.in aclocal.m4 config.h.in configure configure.ac man/Makefile.in src/Makefile.in src/base64/Makefile.in src/masqmail.c src/masqmail.h src/md5/Makefile.in
diffstat 13 files changed, 66 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL	Tue May 29 21:33:49 2012 +0200
+++ b/INSTALL	Tue May 29 21:35:17 2012 +0200
@@ -88,14 +88,13 @@
 Check that 'make install' worked correctly. The following command:
 
 	ls -ld /usr/local/sbin/masqmail /etc/masqmail /var/log/masqmail/ \
-	       /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/*
+	       /var/spool/masqmail/ /var/spool/masqmail/*
 
 should give output similar to
 
 	-rwsr-xr-x 1 root root    399356 May 10 12:34 /usr/local/sbin/masqmail
 	drwxr-xr-x 2 root root      4096 May 10 12:34 /etc/masqmail
 	drwxr-xr-x 2 mail mail      4096 May 10 12:34 /var/log/masqmail
-	drwxr-xr-x 2 mail mail      4096 May 10 12:34 /var/run/masqmail
 	drwxr-xr-x 5 mail mail      4096 May 10 12:34 /var/spool/masqmail
 	drwxr-xr-x 2 mail mail      4096 May 10 12:34 /var/spool/masqmail/input
 	drwxr-xr-x 2 mail mail      4096 May 10 12:34 /var/spool/masqmail/lock
--- a/Makefile.am	Tue May 29 21:33:49 2012 +0200
+++ b/Makefile.am	Tue May 29 21:35:17 2012 +0200
@@ -2,9 +2,9 @@
 
 SUBDIRS = src man
 
-install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir doc_dir rmail
+install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir pid_dir doc_dir rmail
 
-uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-run_dir rm-spool_dir rm-log_dir
+uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-pid_dir rm-spool_dir rm-log_dir
 
 
 conf_dir:
@@ -37,11 +37,11 @@
 	rmdir $(DESTDIR)@docdir@
 
 
-run_dir:
-	install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail
+pid_dir:
+	install -d $(DESTDIR)@with_piddir@
 
-rm-run_dir:
-	rm -rf $(DESTDIR)/var/run/masqmail
+rm-pid_dir:
+	rm -rf $(DESTDIR)@with_piddir@
 
 
 log_dir:
@@ -73,5 +73,5 @@
 	rm -f $(DESTDIR)@prefix@/sbin/rmail
 
 
-uid_bit: $(DESTDIR)@prefix@/sbin/masqmail
+uid_bit:
 	chmod u+s $(DESTDIR)@prefix@/sbin/masqmail
--- a/Makefile.in	Tue May 29 21:33:49 2012 +0200
+++ b/Makefile.in	Tue May 29 21:35:17 2012 +0200
@@ -200,6 +200,7 @@
 with_confdir = @with_confdir@
 with_group = @with_group@
 with_logdir = @with_logdir@
+with_piddir = @with_piddir@
 with_spooldir = @with_spooldir@
 with_user = @with_user@
 EXTRA_DIST = examples docs man tpl devel
@@ -689,9 +690,9 @@
 	uninstall uninstall-am uninstall-local
 
 
-install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir doc_dir rmail
+install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir pid_dir doc_dir rmail
 
-uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-run_dir rm-spool_dir rm-log_dir
+uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-pid_dir rm-spool_dir rm-log_dir
 
 conf_dir:
 	install -d $(DESTDIR)@with_confdir@
@@ -720,11 +721,11 @@
 	)
 	rmdir $(DESTDIR)@docdir@
 
-run_dir:
-	install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail
+pid_dir:
+	install -d $(DESTDIR)@with_piddir@
 
-rm-run_dir:
-	rm -rf $(DESTDIR)/var/run/masqmail
+rm-pid_dir:
+	rm -rf $(DESTDIR)@with_piddir@
 
 log_dir:
 	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@
@@ -753,7 +754,7 @@
 rm-rmail:
 	rm -f $(DESTDIR)@prefix@/sbin/rmail
 
-uid_bit: $(DESTDIR)@prefix@/sbin/masqmail
+uid_bit:
 	chmod u+s $(DESTDIR)@prefix@/sbin/masqmail
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
--- a/aclocal.m4	Tue May 29 21:33:49 2012 +0200
+++ b/aclocal.m4	Tue May 29 21:35:17 2012 +0200
@@ -47,7 +47,8 @@
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -93,7 +94,8 @@
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -141,9 +143,9 @@
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
--- a/config.h.in	Tue May 29 21:33:49 2012 +0200
+++ b/config.h.in	Tue May 29 21:35:17 2012 +0200
@@ -128,6 +128,9 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The pid file location */
+#undef PID_DIR
+
 /* Define as the return type of signal handlers (`int' or `void'). */
 #undef RETSIGTYPE
 
--- a/configure	Tue May 29 21:33:49 2012 +0200
+++ b/configure	Tue May 29 21:35:17 2012 +0200
@@ -606,6 +606,7 @@
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+with_piddir
 with_confdir
 with_spooldir
 with_logdir
@@ -715,6 +716,7 @@
 with_logdir
 with_spooldir
 with_confdir
+with_piddir
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1361,6 +1363,7 @@
   --with-logdir=DIR       set log directory /var/log/masqmail
   --with-spooldir=DIR     set spool directory /var/spool/masqmail
   --with-confdir=DIR      directory for configuration /etc/masqmail
+  --with-piddir=DIR       directory for pid files /var/run
 
 Some influential environment variables:
   CC          C compiler command
@@ -4244,6 +4247,7 @@
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -4372,6 +4376,7 @@
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -4388,6 +4393,7 @@
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -4407,9 +4413,9 @@
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1`
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1`
         else
-	        GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1`
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$GLIB_PKG_ERRORS" >&5
@@ -5288,6 +5294,22 @@
 
 
 
+
+# Check whether --with-piddir was given.
+if test "${with_piddir+set}" = set; then :
+  withval=$with_piddir;
+else
+  with_piddir='/var/run'
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define PID_DIR "${with_piddir}"
+_ACEOF
+
+
+
 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
 
 
--- a/configure.ac	Tue May 29 21:33:49 2012 +0200
+++ b/configure.ac	Tue May 29 21:35:17 2012 +0200
@@ -188,6 +188,15 @@
 AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location])
 AC_SUBST(with_confdir)
 
+dnl dir for pid files
+AC_ARG_WITH(piddir,
+	[  --with-piddir=DIR       directory for pid files [/var/run]],
+	,
+	with_piddir='/var/run'
+	)
+AC_DEFINE_UNQUOTED(PID_DIR, "${with_piddir}", [The pid file location])
+AC_SUBST(with_piddir)
+
 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
 
 dnl well, /me/ thought that autoconf should make things _easy_ ... -- oku
--- a/man/Makefile.in	Tue May 29 21:33:49 2012 +0200
+++ b/man/Makefile.in	Tue May 29 21:35:17 2012 +0200
@@ -172,6 +172,7 @@
 with_confdir = @with_confdir@
 with_group = @with_group@
 with_logdir = @with_logdir@
+with_piddir = @with_piddir@
 with_spooldir = @with_spooldir@
 with_user = @with_user@
 man_MANS = masqmail.8 mservdetect.1 masqmail.conf.5 masqmail.route.5 masqmail.aliases.5 rmail.8
--- a/src/Makefile.in	Tue May 29 21:33:49 2012 +0200
+++ b/src/Makefile.in	Tue May 29 21:35:17 2012 +0200
@@ -231,6 +231,7 @@
 with_confdir = @with_confdir@
 with_group = @with_group@
 with_logdir = @with_logdir@
+with_piddir = @with_piddir@
 with_spooldir = @with_spooldir@
 with_user = @with_user@
 SUBDIRS = base64 md5
--- a/src/base64/Makefile.in	Tue May 29 21:33:49 2012 +0200
+++ b/src/base64/Makefile.in	Tue May 29 21:35:17 2012 +0200
@@ -173,6 +173,7 @@
 with_confdir = @with_confdir@
 with_group = @with_group@
 with_logdir = @with_logdir@
+with_piddir = @with_piddir@
 with_spooldir = @with_spooldir@
 with_user = @with_user@
 AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE
--- a/src/masqmail.c	Tue May 29 21:33:49 2012 +0200
+++ b/src/masqmail.c	Tue May 29 21:35:17 2012 +0200
@@ -146,7 +146,7 @@
 	}
 
 	signal(SIGTERM, sigterm_handler);
-	write_pidfile(PIDFILEDIR "/masqmail.pid");
+	write_pidfile(PID_DIR "/masqmail.pid");
 
 	conf.do_verbose = FALSE;
 
--- a/src/masqmail.h	Tue May 29 21:33:49 2012 +0200
+++ b/src/masqmail.h	Tue May 29 21:35:17 2012 +0200
@@ -529,7 +529,9 @@
 
 #define CONF_FILE CONF_DIR"/masqmail.conf"
 
-#define PIDFILEDIR "/var/run/masqmail/"
+#ifndef PID_DIR
+#define PID_DIR "/var/run"
+#endif
 
 #ifndef va_copy
 #ifdef __va_copy
--- a/src/md5/Makefile.in	Tue May 29 21:33:49 2012 +0200
+++ b/src/md5/Makefile.in	Tue May 29 21:35:17 2012 +0200
@@ -169,6 +169,7 @@
 with_confdir = @with_confdir@
 with_group = @with_group@
 with_logdir = @with_logdir@
+with_piddir = @with_piddir@
 with_spooldir = @with_spooldir@
 with_user = @with_user@
 AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE