Blame SOURCES/autoconf-2.69-backport-runstatedir-option.patch

1a828e
From a197431414088a417b407b9b20583b2e8f7363bd Mon Sep 17 00:00:00 2001
1a828e
From: Eric Blake <eblake@redhat.com>
1a828e
Date: Thu, 12 Sep 2013 15:11:29 -0600
1a828e
Subject: [PATCH] AC_INIT: add --runstatedir option to configure
1a828e
1a828e
http://lwn.net/Articles/436012/ documents that many distros
1a828e
are now preferring to use /run rather than /var/run for
1a828e
storage of pid files and other per-process temporary files
1a828e
that must not be cleaned out during arbitrary TMPDIR sweeps.
1a828e
As such, the GNU Coding Standards were recently changed to
1a828e
recommend a new configure option to make it easy to choose
1a828e
this directory at configure time.  This patch adds support
1a828e
for the option to all configure scripts built by autoconf.
1a828e
1a828e
* general.m4 (_AC_INIT_PARSE_ARGS): Add new directory option.
1a828e
(_AC_INIT_HELP): Document it.
1a828e
* doc/autoconf.texi (Installation Directory Variables): Document
1a828e
new option.
1a828e
(Site Defaults): Mention typical use within a distro.
1a828e
* NEWS: Mention the addition.
1a828e
1a828e
Signed-off-by: Eric Blake <eblake@redhat.com>
1a828e
---
1a828e
 NEWS                    |    5 +++++
1a828e
 doc/autoconf.texi       |   14 +++++++++++++-
1a828e
 lib/autoconf/general.m4 |   13 ++++++++++++-
1a828e
 3 files changed, 30 insertions(+), 2 deletions(-)
1a828e
1a828e
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
1a828e
index 26e7b17..4932067 100644
1a828e
--- a/doc/autoconf.texi
1a828e
+++ b/doc/autoconf.texi
1a828e
@@ -2826,7 +2826,18 @@ usually has a subdirectory per locale.
1a828e
 
1a828e
 @defvar localstatedir
1a828e
 @ovindex localstatedir
1a828e
-The directory for installing modifiable single-machine data.
1a828e
+The directory for installing modifiable single-machine data.  Content in
1a828e
+this directory typically survives a reboot.
1a828e
+@end defvar
1a828e
+
1a828e
+@defvar runstatedir
1a828e
+@ovindex runstatedir
1a828e
+The directory for installing temporary modifiable single-machine data.
1a828e
+Content in this directory survives as long as the process is running
1a828e
+(such as pid files), as contrasted with @file{/tmp} that may be
1a828e
+periodically cleaned.  Conversely, this directory is typically cleaned
1a828e
+on a reboot.  By default, this is a subdirectory of
1a828e
+@code{localstatedir}.
1a828e
 @end defvar
1a828e
 
1a828e
 @defvar mandir
1a828e
@@ -22606,6 +22617,7 @@ test "$prefix" = NONE && prefix=/usr/share/local/gnu
1a828e
 test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu
1a828e
 test "$sharedstatedir" = '$@{prefix@}/com' && sharedstatedir=/var
1a828e
 test "$localstatedir" = '$@{prefix@}/var' && localstatedir=/var
1a828e
+test "$runstatedir" = '$@{localstatedir@}/run' && runstatedir=/run
1a828e
 
1a828e
 # Give Autoconf 2.x generated configure scripts a shared default
1a828e
 # cache file for feature test results, architecture-specific.
1a828e
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
1a828e
index 70b0168..1ce9922 100644
1a828e
--- a/lib/autoconf/general.m4
1a828e
+++ b/lib/autoconf/general.m4
1a828e
@@ -586,6 +586,7 @@ AC_SUBST([datadir],        ['${datarootdir}'])dnl
1a828e
 AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
1a828e
 AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
1a828e
 AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
1a828e
+AC_SUBST([runstatedir],    ['${localstatedir}/run'])dnl
1a828e
 AC_SUBST([includedir],     ['${prefix}/include'])dnl
1a828e
 AC_SUBST([oldincludedir],  ['/usr/include'])dnl
1a828e
 AC_SUBST([docdir],         [m4_ifset([AC_PACKAGE_TARNAME],
1a828e
@@ -812,6 +813,15 @@ do
1a828e
   | -silent | --silent | --silen | --sile | --sil)
1a828e
     silent=yes ;;
1a828e
 
1a828e
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
1a828e
+  | --runstate | --runstat | --runsta | --runst | --runs \
1a828e
+  | --run | --ru | --r)
1a828e
+    ac_prev=runstatedir ;;
1a828e
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1a828e
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1a828e
+  | --run=* | --ru=* | --r=*)
1a828e
+    runstatedir=$ac_optarg ;;
1a828e
+
1a828e
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1a828e
     ac_prev=sbindir ;;
1a828e
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1a828e
@@ -921,7 +931,7 @@ fi
1a828e
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1a828e
 		datadir sysconfdir sharedstatedir localstatedir includedir \
1a828e
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1a828e
-		libdir localedir mandir
1a828e
+		libdir localedir mandir runstatedir
1a828e
 do
1a828e
   eval ac_val=\$$ac_var
1a828e
   # Remove trailing slashes.
1a828e
@@ -1058,6 +1068,7 @@ Fine tuning of the installation directories:
1a828e
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1a828e
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1a828e
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1a828e
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
1a828e
   --libdir=DIR            object code libraries [EPREFIX/lib]
1a828e
   --includedir=DIR        C header files [PREFIX/include]
1a828e
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1a828e
-- 
1a828e
1.7.2.5