[fedfs-utils] [PATCH] autotools: install mount.fedfs in /sbin

Jeff Layton jlayton at redhat.com
Tue Aug 30 09:41:14 PDT 2011


/bin/mount expects to find mount helpers in /sbin, so set up the code to
install it there. We can't, however redefine the code to install it in
/sbin unconditionally as that will break "make distcheck".

This patch instead borrows the scheme used by util-linux-ng. If the
prefix is '/usr' or NONE, then we set root_sbindir to '/sbin'. If it's
anything else, then it is set to the same value as the sbindir.

That allows "make distcheck" to pass and still allows mount.fedfs to
be installed in the right place for distro packaging tools.

Signed-off-by: Jeff Layton <jlayton at redhat.com>
---
 configure.ac          |    9 +++++++++
 src/mount/Makefile.am |    3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index d46694c..c4e2823 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,15 @@ AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
 AC_FUNC_MALLOC
 AC_CHECK_FUNCS([atexit memset nl_langinfo pathconf setlocale socket strcasecmp strchr strdup strerror strndup strrchr strtoul])
 
+# Check whether exec_prefix=/usr:
+root_sbindir="${sbindir}"
+case $exec_prefix:$prefix in
+NONE:NONE | NONE:/usr | /usr:*)
+	root_sbindir="/sbin"
+esac
+
+AC_SUBST([root_sbindir])
+
 AC_CONFIG_FILES([Makefile
                  doc/Makefile
                  doc/ldap/Makefile
diff --git a/src/mount/Makefile.am b/src/mount/Makefile.am
index 4d0a83a..8a324f9 100644
--- a/src/mount/Makefile.am
+++ b/src/mount/Makefile.am
@@ -24,7 +24,8 @@
 ##
 
 noinst_HEADERS		= nls.h
-sbin_PROGRAMS		= mount.fedfs fedfs-map-nfs4
+root_sbin_PROGRAMS	= mount.fedfs
+sbin_PROGRAMS		= fedfs-map-nfs4
 fedfs_map_nfs4_SOURCES	= fedfs-map-nfs4.c
 fedfs_map_nfs4_LDADD	= -lresolv \
 			  $(top_builddir)/src/libsi/libsi.a
-- 
1.7.6




More information about the fedfs-utils-devel mailing list