With an explicit --prefix, "make install" would install into /sbin regardless:
$ ./configure --prefix=/p/p/coro ... $ make install make[1]: Entering directory `/h/meyering/w/co/gfs2-utils/gfs2/mkfs' /p/bin/install -c -d /sbin make[1]: Nothing to be done for `install-data-am'. /p/bin/install -c -m 755 mkfs.gfs2 /sbin /p/bin/install: cannot create regular file `/sbin/mkfs.gfs2': Permission denied make[1]: *** [install-exec-local] Error 1 make[1]: Leaving directory `/h/meyering/w/co/gfs2-utils/gfs2/mkfs' make: *** [install-am] Error 2 Along the way I noticed the Makefile.am files were using noinst_PROGRAMS and adding their own install rules. It's easier/cleaner/etc. to use sbin_PROGRAMS. Here's the patch: >From d794b4e7948741f5d6767970a2fde2c5fce15947 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Mon, 29 Jun 2009 11:23:09 +0200 Subject: [PATCH gfs2-utils] Use automake's sbin_PROGRAMS, rather than writing our own rules. This also fixes a "make install" failure to honor --prefix. * gfs2/mount/Makefile.am (sbin_PROGRAMS): Use sbin_PROGRAMS, not noinst_PROGRAMS. (install-exec-local, uninstall-local): Remove rules. Automake automates this when you define sbin_PROGRAMS. * gfs2/fsck/Makefile.am (sbin_PROGRAMS): Likewise. (install-exec-local, uninstall-local): Remove rules. * gfs2/mkfs/Makefile.am (sbin_PROGRAMS): Likewise. (install-exec-local, uninstall-local): Remove rules. (install-exec-hook, uninstall-hook): Remove unnecessary sub-shells. --- gfs2/fsck/Makefile.am | 10 +--------- gfs2/mkfs/Makefile.am | 16 ++++------------ gfs2/mount/Makefile.am | 10 +--------- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/gfs2/fsck/Makefile.am b/gfs2/fsck/Makefile.am index 15a5b1d..1667df3 100644 --- a/gfs2/fsck/Makefile.am +++ b/gfs2/fsck/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_PROGRAMS = fsck.gfs2 +sbin_PROGRAMS = fsck.gfs2 noinst_HEADERS = eattr.h fs_bits.h fsck.h fs_recovery.h hash.h \ inode_hash.h link.h lost_n_found.h metawalk.h util.h @@ -15,11 +15,3 @@ fsck_gfs2_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ -I$(top_srcdir)/gfs2/libgfs2 fsck_gfs2_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la - -install-exec-local: - $(INSTALL) -d $(DESTDIR)/sbin - $(INSTALL) -m 755 fsck.gfs2 $(DESTDIR)/sbin - -uninstall-local: - cd $(DESTDIR)/sbin && \ - rm -f fsck.gfs2 diff --git a/gfs2/mkfs/Makefile.am b/gfs2/mkfs/Makefile.am index 9f156ba..ba4f851 100644 --- a/gfs2/mkfs/Makefile.am +++ b/gfs2/mkfs/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_PROGRAMS = mkfs.gfs2 +sbin_PROGRAMS = mkfs.gfs2 noinst_HEADERS = gfs2_mkfs.h @@ -15,20 +15,12 @@ mkfs_gfs2_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la relative_sbin = $(shell perl -MFile::Spec -le 'print File::Spec->abs2rel("/sbin", "$(sbindir)")') -install-exec-local: - $(INSTALL) -d $(DESTDIR)/sbin - $(INSTALL) -m 755 mkfs.gfs2 $(DESTDIR)/sbin - -uninstall-local: - cd $(DESTDIR)/sbin && \ - rm -f mkfs.gfs2 - install-exec-hook: $(INSTALL) -d $(DESTDIR)/$(sbindir) - (cd $(DESTDIR)/$(sbindir) && \ + cd $(DESTDIR)/$(sbindir) && \ rm -f gfs2_grow gfs2_jadd && \ $(LN_S) $(relative_sbin)/mkfs.gfs2 gfs2_grow && \ - $(LN_S) $(relative_sbin)/mkfs.gfs2 gfs2_jadd) + $(LN_S) $(relative_sbin)/mkfs.gfs2 gfs2_jadd uninstall-hook: - (cd $(DESTDIR)/$(sbindir) && rm -f gfs2_jadd gfs2_grow) + cd $(DESTDIR)/$(sbindir) && rm -f gfs2_jadd gfs2_grow diff --git a/gfs2/mount/Makefile.am b/gfs2/mount/Makefile.am index fd927b6..a82970e 100644 --- a/gfs2/mount/Makefile.am +++ b/gfs2/mount/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_PROGRAMS = mount.gfs2 +sbin_PROGRAMS = mount.gfs2 noinst_HEADERS = gfs_ondisk.h util.h @@ -12,11 +12,3 @@ mount_gfs2_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ -I$(top_srcdir)/group/libgfscontrol mount_gfs2_LDADD = $(top_builddir)/group/libgfscontrol/libgfscontrol.la - -install-exec-local: - $(INSTALL) -d $(DESTDIR)/sbin - $(INSTALL) -m 755 mount.gfs2 $(DESTDIR)/sbin - -uninstall-local: - cd $(DESTDIR)/sbin && \ - rm -f mount.gfs2 -- 1.6.3.3.420.gd4b46
