public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs2-utils: master - Use automake's sbin_PROGRAMS, rather than writing our own rules.
@ 2009-06-29 18:26 Jim Meyering
  0 siblings, 0 replies; only message in thread
From: Jim Meyering @ 2009-06-29 18:26 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=ae3d671ef9de9887283d89b59bd6b7c4788fb7b9
Commit:        ae3d671ef9de9887283d89b59bd6b7c4788fb7b9
Parent:        29f9d15242c5c2a48f8be46ebf5859da1b958aa6
Author:        Jim Meyering <meyering@redhat.com>
AuthorDate:    Mon Jun 29 11:23:09 2009 +0200
Committer:     Jim Meyering <meyering@redhat.com>
CommitterDate: Mon Jun 29 17:29:32 2009 +0200

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 (sbindir): Override default, since
we want to install into /sbin when exec_prefix is /usr and
when sbindir hasn't been changed from the default.
(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  |   15 ++++++---------
 gfs2/mkfs/Makefile.am  |   21 +++++++++------------
 gfs2/mount/Makefile.am |   15 ++++++---------
 3 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/gfs2/fsck/Makefile.am b/gfs2/fsck/Makefile.am
index 15a5b1d..ac89524 100644
--- a/gfs2/fsck/Makefile.am
+++ b/gfs2/fsck/Makefile.am
@@ -1,6 +1,11 @@
 MAINTAINERCLEANFILES	= Makefile.in
 
-noinst_PROGRAMS		= fsck.gfs2
+# install into /sbin, not /usr/sbin
+sbindir := $(shell test '$(exec_prefix):$(sbindir)' = /usr:/usr/sbin \
+	     && echo /sbin \
+	     || echo '$(exec_prefix)/sbin')
+
+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 +20,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..75466fa 100644
--- a/gfs2/mkfs/Makefile.am
+++ b/gfs2/mkfs/Makefile.am
@@ -1,6 +1,11 @@
 MAINTAINERCLEANFILES	= Makefile.in
 
-noinst_PROGRAMS		= mkfs.gfs2
+# install into /sbin, not /usr/sbin
+sbindir := $(shell test '$(exec_prefix):$(sbindir)' = /usr:/usr/sbin \
+	     && echo /sbin \
+	     || echo '$(exec_prefix)/sbin')
+
+sbin_PROGRAMS		= mkfs.gfs2
 
 noinst_HEADERS		= gfs2_mkfs.h
 
@@ -15,20 +20,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..0303b24 100644
--- a/gfs2/mount/Makefile.am
+++ b/gfs2/mount/Makefile.am
@@ -1,6 +1,11 @@
 MAINTAINERCLEANFILES	= Makefile.in
 
-noinst_PROGRAMS		= mount.gfs2
+# install into /sbin, not /usr/sbin
+sbindir := $(shell test '$(exec_prefix):$(sbindir)' = /usr:/usr/sbin \
+	     && echo /sbin \
+	     || echo '$(exec_prefix)/sbin')
+
+sbin_PROGRAMS		= mount.gfs2
 
 noinst_HEADERS		= gfs_ondisk.h util.h
 
@@ -12,11 +17,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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-29 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-29 18:26 gfs2-utils: master - Use automake's sbin_PROGRAMS, rather than writing our own rules Jim Meyering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).