public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jim Meyering <meyering@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: gfs2-utils: master - Use automake's sbin_PROGRAMS, rather than writing our own rules.
Date: Mon, 29 Jun 2009 18:26:00 -0000	[thread overview]
Message-ID: <20090629182336.4AA491201FE@lists.fedorahosted.org> (raw)

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


                 reply	other threads:[~2009-06-29 18:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090629182336.4AA491201FE@lists.fedorahosted.org \
    --to=meyering@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).