[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH gfs2-utils] Use automake's sbin_PROGRAMS, rather than writing our own rules.



FYI, here's the merged patch:

>From ae3d671ef9de9887283d89b59bd6b7c4788fb7b9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
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 (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
--
1.6.3.3.467.g98a79


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]