argus-3.0.0.rc.5 DESTDIR support

Gabriel L. Somlo somlo at cmu.edu
Mon Jun 12 17:17:51 EDT 2006


I was also trying to install into a fake-root DESTDIR directory (for
things such as packing up a binary tarball and install it later on
another machine, or Fedora rpms, etc.). The enclosed patch adds
support for that:

	DESTDIR=/some/fake/root/directory make install

and the whole prefix (/usr/local/...) would get built under
/some/fake/root/directory/...

Thanks for adding this one, as well.

Gabriel


diff -NarU5 argus-3.0.0.rc.5.orig/argus/Makefile.in argus-3.0.0.rc.5/argus/Makefile.in
--- argus-3.0.0.rc.5.orig/argus/Makefile.in	2006-06-08 14:20:12.000000000 -0400
+++ argus-3.0.0.rc.5/argus/Makefile.in	2006-06-12 16:59:35.000000000 -0400
@@ -15,12 +15,10 @@
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
 
 # Top level hierarchy
 prefix = @prefix@
 exec_prefix = @exec_prefix@
-# Pathname of install directory
-DESTDIR = @prefix@
 # Pathname of directory to install the system binaries
 SBINDIR = @sbindir@
 # Pathname of directory to install the system binaries
 BINDIR = @bindir@
 # Pathname of directory to install the include files
@@ -96,16 +94,14 @@
 
 @INSTALL_BIN@/argus: $(OBJ) ../lib/argus_common.a
 	$(CC) $(CFLAGS) -o $@ $(OBJ) $(LIB)
 
 install: force
-	[ -d $(DESTDIR) ] || \
-		(mkdir -p $(DESTDIR); chmod 755 $(DESTDIR))
-	[ -d $(SBINDIR) ] || \
-		(mkdir -p $(SBINDIR); chmod 755 $(SBINDIR))
+	[ -d $(DESTDIR)$(SBINDIR) ] || \
+		(mkdir -p $(DESTDIR)$(SBINDIR); chmod 755 $(DESTDIR)$(SBINDIR))
 
-	$(INSTALL) $(srcdir)/../bin/argus $(SBINDIR)/argus
+	$(INSTALL) $(srcdir)/../bin/argus $(DESTDIR)$(SBINDIR)/argus
 
 uninstall: force
 	rm -f $(SBINDIR)/argus
 
 clean:
diff -NarU5 argus-3.0.0.rc.5.orig/common/Makefile.in argus-3.0.0.rc.5/common/Makefile.in
--- argus-3.0.0.rc.5.orig/common/Makefile.in	2006-06-08 14:20:12.000000000 -0400
+++ argus-3.0.0.rc.5/common/Makefile.in	2006-06-12 16:57:30.000000000 -0400
@@ -105,15 +105,15 @@
 version.c: $(srcdir)/../VERSION
 	@rm -f $@
 	sed -e 's/.*/char version[] = "&";/' $(srcdir)/../VERSION > $@
 
 install: force
-	[ -d $(LIBDEST) ] || \
-		(mkdir -p $(LIBDEST); chmod 755 $(LIBDEST))
+	[ -d $(DESTDIR)$(LIBDEST) ] || \
+		(mkdir -p $(DESTDIR)$(LIBDEST); chmod 755 $(DESTDIR)$(LIBDEST))
 
-	$(INSTALL) $(srcdir)/../lib/argus_common.a $(LIBDEST)/argus_common.a
-	$(RANLIB) $(LIBDEST)/argus_common.a
+	$(INSTALL) $(srcdir)/../lib/argus_common.a $(DESTDIR)$(LIBDEST)/argus_common.a
+	$(RANLIB) $(DESTDIR)$(LIBDEST)/argus_common.a
 
 uninstall: clean
 clean:
 	rm -f $(CLEANFILES)
 
diff -NarU5 argus-3.0.0.rc.5.orig/Makefile.in argus-3.0.0.rc.5/Makefile.in
--- argus-3.0.0.rc.5.orig/Makefile.in	2006-06-08 14:20:12.000000000 -0400
+++ argus-3.0.0.rc.5/Makefile.in	2006-06-12 17:07:41.000000000 -0400
@@ -61,50 +61,50 @@
 .PHONY: all
 
 
 install:  force
 	${MAKE} installdirs
-	[ -d @prefix@ ] || \
-		(mkdir -p @prefix@; chmod 755 @prefix@)
+	[ -d $(DESTDIR)@prefix@ ] || \
+		(mkdir -p $(DESTDIR)@prefix@; chmod 755 $(DESTDIR)@prefix@)
 
-	[ -d @sbindir@ ] || \
-		(mkdir -p @sbindir@; chmod 755 @sbindir@)
+	[ -d $(DESTDIR)@sbindir@ ] || \
+		(mkdir -p $(DESTDIR)@sbindir@; chmod 755 $(DESTDIR)@sbindir@)
 
-	[ -d $(exec_prefix)/argus ] || \
-		(mkdir -p $(exec_prefix)/argus; chmod 755 $(exec_prefix)/argus)
+	[ -d $(DESTDIR)$(exec_prefix)/argus ] || \
+		(mkdir -p $(DESTDIR)$(exec_prefix)/argus; chmod 755 $(DESTDIR)$(exec_prefix)/argus)
 
-	[ -d $(exec_prefix)/argus/archive ] || \
-		(mkdir -p $(exec_prefix)/argus/archive; chmod 755 $(exec_prefix)/argus/archive)
+	[ -d $(DESTDIR)$(exec_prefix)/argus/archive ] || \
+		(mkdir -p $(DESTDIR)$(exec_prefix)/argus/archive; chmod 755 $(DESTDIR)$(exec_prefix)/argus/archive)
 
-	[ -d $(docdir) ] || \
-		(mkdir -p $(docdir); chmod 755 $(docdir))
+	[ -d $(DESTDIR)$(docdir) ] || \
+		(mkdir -p $(DESTDIR)$(docdir); chmod 755 $(DESTDIR)$(docdir))
 
 	@-for d in $(DIRS); \
 	do \
 		(cd $$d; echo "### Make install in" `pwd`;    \
 			$(MAKE) $(MFLAGS) install;    \
 			echo "### Done with" `pwd`);            \
 	done
 
-	$(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(docdir)
-	$(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(docdir)
+	$(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(DESTDIR)$(docdir)
+	$(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(DESTDIR)$(docdir)
 
-	$(INSTALL) -m 0644 $(srcdir)/README $(prefix)/argus
-	$(INSTALL) -m 0644 $(srcdir)/README $(docdir)
-	$(INSTALL) -m 0644 $(srcdir)/COPYING $(prefix)/argus
-	$(INSTALL) -m 0644 $(srcdir)/COPYING $(docdir)
-
-	$(INSTALL) -m 0755 $(srcdir)/bin/argusbug @bindir@/argusbug
-
-	[ -d @mandir@ ] || \
-		(mkdir -p @mandir@; chmod 755 @mandir@)
-	[ -d @mandir@/man5 ] || \
-		(mkdir -p @mandir@/man5; chmod 755 @mandir@/man5)
-	[ -d @mandir@/man8 ] || \
-		(mkdir -p @mandir@/man8; chmod 755 @mandir@/man8)
-	$(INSTALL) -m 0644 $(srcdir)/man/man5/argus.conf.5 @mandir@/man5/argus.conf.5
-	$(INSTALL) -m 0644 $(srcdir)/man/man8/argus.8 @mandir@/man8/argus.8
+	$(INSTALL) -m 0644 $(srcdir)/README $(DESTDIR)$(prefix)/argus
+	$(INSTALL) -m 0644 $(srcdir)/README $(DESTDIR)$(docdir)
+	$(INSTALL) -m 0644 $(srcdir)/COPYING $(DESTDIR)$(prefix)/argus
+	$(INSTALL) -m 0644 $(srcdir)/COPYING $(DESTDIR)$(docdir)
+
+	$(INSTALL) -D -m 0755 $(srcdir)/bin/argusbug $(DESTDIR)@bindir@/argusbug
+
+	[ -d $(DESTDIR)@mandir@ ] || \
+		(mkdir -p $(DESTDIR)@mandir@; chmod 755 $(DESTDIR)@mandir@)
+	[ -d $(DESTDIR)@mandir@/man5 ] || \
+		(mkdir -p $(DESTDIR)@mandir@/man5; chmod 755 $(DESTDIR)@mandir@/man5)
+	[ -d $(DESTDIR)@mandir@/man8 ] || \
+		(mkdir -p $(DESTDIR)@mandir@/man8; chmod 755 $(DESTDIR)@mandir@/man8)
+	$(INSTALL) -m 0644 $(srcdir)/man/man5/argus.conf.5 $(DESTDIR)@mandir@/man5/argus.conf.5
+	$(INSTALL) -m 0644 $(srcdir)/man/man8/argus.8 $(DESTDIR)@mandir@/man8/argus.8
 
 uninstall:
 	rm -f @mandir@/man5/argus.5
 	rm -f @mandir@/man5/argus.conf.5
 	rm -f @mandir@/man8/argus.8



More information about the argus mailing list