r1671 - trunk/gzip

robert at linuxfromscratch.org robert at linuxfromscratch.org
Sun Sep 10 19:33:50 PDT 2006


Author: robert
Date: 2006-09-10 20:33:49 -0600 (Sun, 10 Sep 2006)
New Revision: 1671

Added:
   trunk/gzip/gzip-1.3.5-scriptsdir-1.patch
Log:
Added gzip-1.3.5-scriptsdir-1.patch

Added: trunk/gzip/gzip-1.3.5-scriptsdir-1.patch
===================================================================
--- trunk/gzip/gzip-1.3.5-scriptsdir-1.patch	                        (rev 0)
+++ trunk/gzip/gzip-1.3.5-scriptsdir-1.patch	2006-09-11 02:33:49 UTC (rev 1671)
@@ -0,0 +1,153 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2006-09-10
+Initial Package Version: 1.3.5
+Upstream Status: Submitted
+Origin: None
+Description: This patch adds --with-scripts-dir=DIR to ./configure. In
+LFS we would do './configure --prefix=/usr --bindir=/bin'. SCRIPTSDIR
+defaults to ${exec_prefix}/bin (aka $prefix/bin), which would get
+expanded to /usr/bin. This patch also makes Makefile use 'ln -s' when
+installing alias scripts. To use this patch do:
+
+patch -Np1 -i ../this.patch
+aclocal -I m4
+autoconf
+automake
+./configure --prefix=/usr --bindir=/bin
+make
+make install
+
+There's no need to sed BINDIR on gzeze.in, or move or symlink programs.
+
+This patch depends on newer versions of autoconf, 2.57 or later, which
+supports AS_HELP_STRING.
+
+diff -Naur gzip-1.3.5.orig/ChangeLog gzip-1.3.5/ChangeLog
+--- gzip-1.3.5.orig/ChangeLog	2002-09-30 09:20:09.000000000 +0000
++++ gzip-1.3.5/ChangeLog	2006-09-11 01:35:54.000000000 +0000
+@@ -1,3 +1,16 @@
++2006-09-10 Robert Connolly <robert at linuxfromscratch.org>
++	* configure.in: Added --with-scripts-dir=DIR so scripts and binaries
++	can be installed to different locations.
++	* Makefile.in:
++	Install bin_SCRIPTS to SCRIPTSDIR.
++	* configure.in:
++	Added SHELL_PATH_PREFIX, based on whether '$SCRIPTSDIR = $bindir' or
++	not.
++	* Makefile.am:
++	Use SHELL_PATH_PREFIX in PATH for scripts.
++	* Makefile.am:
++	Use $(LN_S) when installing alias commands.
++
+ 2002-09-30  Paul Eggert  <eggert at twinsun.com>
+ 
+ 	* NEWS, README, revision.h, configure.in (AM_INIT_AUTOMAKE):
+diff -Naur gzip-1.3.5.orig/Makefile.am gzip-1.3.5/Makefile.am
+--- gzip-1.3.5.orig/Makefile.am	2002-09-29 18:18:50.000000000 +0000
++++ gzip-1.3.5/Makefile.am	2006-09-11 01:35:54.000000000 +0000
+@@ -71,18 +71,16 @@
+ 	sed \
+ 		-e '$(SEDCMD)' \
+ 		-e 's|/bin/sh|$(SHELL)|g' \
+-		-e 's|BINDIR|$(bindir)|g' \
++		-e 's|BINDIR|$(SHELL_PATH_PREFIX)|' \
+ 		$(srcdir)/$@.in >$@
+ 	chmod a+x $@
+ 
+ install-exec-hook: remove-installed-links
+ install-exec-hook remove-installed-links:
+-	@for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \
++	@for prog_ext in $(bin_PROGRAMS); do \
+ 	  prog=`echo "$$prog_ext"|sed 's/$(EXEEXT)$$//'`; \
+ 	  case $$prog in \
+ 	  gzip) aliases='gunzip zcat';; \
+-	  zdiff) aliases='zcmp';; \
+-	  zgrep) aliases='zegrep zfgrep';; \
+ 	  *) continue;; \
+ 	  esac; \
+ 	  transform='$(transform)'; \
+@@ -95,14 +93,51 @@
+ 	     rm -f "$$dest" && \
+ 	     case $@ in \
+ 	     install-exec-hook) \
+-	       for ln in ln "$(LN_S)"; do \
+-		 $$ln "$$source" "$$dest" && break; \
++	       for ln in ln ; do \
++		 $(LN_S) "$$source" "$$dest" && break; \
++	       done;; \
++	     esac \
++	    ) || exit; \
++	  done; \
++	done
++
++	@for prog_ext in $(bin_SCRIPTS); do \
++	  prog=`echo "$$prog_ext"|sed 's/$(EXEEXT)$$//'`; \
++	  case $$prog in \
++	  zdiff) aliases='zcmp';; \
++	  zgrep) aliases='zegrep zfgrep';; \
++	  *) continue;; \
++	  esac; \
++	  transform='$(transform)'; \
++	  test "X$$prog" = "X$$prog_ext" || \
++	    transform="$$transform"';s/$$/$(EXEEXT)/'; \
++	  source=$(DESTDIR)$(SCRIPTSDIR)/`echo "$$prog"|sed "$$transform"`; \
++	  for alias in $$aliases; do \
++	    dest=$(DESTDIR)$(SCRIPTSDIR)/`echo "$$alias"|sed "$$transform"`; \
++	    (set -x; \
++	     rm -f "$$dest" && \
++	     case $@ in \
++	     install-exec-hook) \
++	       for ln in ln ; do \
++		 $(LN_S) "$$source" "$$dest" && break; \
+ 	       done;; \
+ 	     esac \
+ 	    ) || exit; \
+ 	  done; \
+ 	done
+ 
++install-binSCRIPTS: $(bin_SCRIPTS)
++	@$(NORMAL_INSTALL)
++	test -z "$(SCRIPTSDIR)" || $(mkdir_p) "$(DESTDIR)$(SCRIPTSDIR)"
++	@list='$(bin_SCRIPTS)'; for p in $$list; do \
++	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++	  if test -f $$d$$p; then \
++	    f=`echo "$$p"|sed 's|^.*/||;$(transform)'`; \
++	    echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(SCRIPTSDIR)/$$f'"; \
++	    $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(SCRIPTSDIR)/$$f"; \
++	  else :; fi; \
++	done
++
+ uninstall-local: remove-installed-links
+ 
+ MAINTAINERCLEANFILES = gzip.doc
+diff -Naur gzip-1.3.5.orig/configure.in gzip-1.3.5/configure.in
+--- gzip-1.3.5.orig/configure.in	2002-09-30 09:28:09.000000000 +0000
++++ gzip-1.3.5/configure.in	2006-09-11 01:36:29.000000000 +0000
+@@ -18,7 +18,7 @@
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ # 02111-1307, USA.
+ 
+-AC_PREREQ(2.54)
++AC_PREREQ(2.57)
+ AC_INIT(gzip, 1.3.5, bug-gzip at gnu.org)
+ AC_CONFIG_SRCDIR(gzip.c)
+ AM_INIT_AUTOMAKE
+@@ -33,6 +33,18 @@
+ AC_MINIX
+ AC_SYS_LARGEFILE
+ 
++AC_SUBST(SCRIPTSDIR)
++AC_ARG_WITH([scripts-dir],
++  [AS_HELP_STRING([--with-scripts-dir=DIR],
++	[shell scripts @<:@default=EPREFIX@:>@])],
++  [SCRIPTSDIR="$withval"],
++  [SCRIPTSDIR='${exec_prefix}/bin'])
++
++AC_SUBST(SHELL_PATH_PREFIX)
++AS_IF([test "x${bindir}" != x"${SCRIPTSDIR}"],
++  [SHELL_PATH_PREFIX="${bindir}:${SCRIPTSDIR}"],
++  [SHELL_PATH_PREFIX="${bindir}"])
++
+ # cc -E produces incorrect asm files on SVR4, we must use /lib/cpp.
+ test -z "$ASCPP" && test -f /lib/cpp && ASCPP=/lib/cpp
+ test -z "$ASCPP" && ASCPP="$CPP"




More information about the patches mailing list