Blame SOURCES/bz1225634-4-scripts_install_the_withdraw_udev_rules_script.patch

db8e98
commit f26de3589548a9fde9797e9f515b5b27de5a961d
db8e98
Author: Andrew Price <anprice@redhat.com>
db8e98
Date:   Wed Aug 19 12:13:39 2015 +0100
db8e98
db8e98
    scripts: install the withdraw udev rules script
db8e98
    
db8e98
    Add a --with-udevdir configure option and default to $prefix/lib/udev.
db8e98
    Note that we can't use $libdir for this as that will often be /usr/lib64
db8e98
    and the udevdir is arch-independent.
db8e98
    
db8e98
    Also add the autoconf bits needed to install 82-gfs2-withdraw.rules into
db8e98
    $udevdir/rules.d
db8e98
    
db8e98
    Resolves: rhbz#1225634
db8e98
    Signed-off-by: Andrew Price <anprice@redhat.com>
db8e98
db8e98
diff --git a/README.build b/README.build
db8e98
index acfde1b..d0a21c3 100644
db8e98
--- a/README.build
db8e98
+++ b/README.build
db8e98
@@ -31,10 +31,9 @@ To install gfs2-utils, run:
db8e98
 
db8e98
 The following scripts (located in gfs2/scripts) are used to complete
db8e98
 the userland portion of the gfs2 withdraw feature using uevents. They
db8e98
-are not installed by 'make install' and need to be installed manually
db8e98
-or during rpm installation to the corresponding locations.
db8e98
+will be installed by 'make install' to these directories by default:
db8e98
 
db8e98
-	82-gfs2-withdraw.rules in /etc/udev/rules.d/
db8e98
+	82-gfs2-withdraw.rules in /usr/lib/udev/rules.d/
db8e98
 	gfs2_withdraw_helper   in /usr/sbin/
db8e98
 
db8e98
 See also doc/README.contributing for details on submitting patches and
db8e98
diff --git a/configure.ac b/configure.ac
db8e98
index de96e5a..35cafe6 100644
db8e98
--- a/configure.ac
db8e98
+++ b/configure.ac
db8e98
@@ -110,6 +110,12 @@ if test -z "$ncurses_CFLAGS"  && test -z "$ncurses_LIBS"; then
db8e98
 	ncurses_LIBS=-lncurses
db8e98
 fi
db8e98
 
db8e98
+AC_ARG_WITH([udevdir],
db8e98
+            AS_HELP_STRING([--with-udevdir=DIR],
db8e98
+                           [udev directory containing rules.d [default=${prefix}/lib/udev]]),
db8e98
+            [], [with_udevdir=\${prefix}/lib/udev])
db8e98
+AC_SUBST([udevdir], [$with_udevdir])
db8e98
+
db8e98
 # Checks for header files.
db8e98
 AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
db8e98
 AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
db8e98
@@ -209,7 +215,9 @@ echo "  Configure summary"
db8e98
 echo " ==================="
db8e98
 echo " prefix            : $prefix"
db8e98
 echo " exec_prefix       : $exec_prefix"
db8e98
+echo " libdir            : $libdir"
db8e98
 echo " sbindir           : $sbindir"
db8e98
+echo " udevdir           : $udevdir"
db8e98
 echo " ------------------"
db8e98
 echo " debug build       : $enable_debug"
db8e98
 echo " C unit tests      : $have_check"
db8e98
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
db8e98
index 056aaa5..d4bda04 100644
db8e98
--- a/gfs2/scripts/Makefile.am
db8e98
+++ b/gfs2/scripts/Makefile.am
db8e98
@@ -5,6 +5,6 @@ dist_sbin_SCRIPTS = \
db8e98
 	gfs2_trace \
db8e98
 	gfs2_withdraw_helper
db8e98
 
db8e98
-noinst_SCRIPTS = \
db8e98
+udevrulesdir=@udevdir@/rules.d
db8e98
+dist_udevrules_DATA = \
db8e98
 	82-gfs2-withdraw.rules
db8e98
-