File readline-4.3-destdir.patch of Package compat-readline4

--- shlib/Makefile.in.~1~	2002-12-18 01:25:01.000000000 +0100
+++ shlib/Makefile.in	2002-12-18 01:31:36.000000000 +0100
@@ -165,13 +165,13 @@ installdirs: $(topdir)/support/mkdirs
 	-$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir)
 
 install: installdirs $(SHLIB_STATUS)
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd "$(DESTDIR)" -d $(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd "$(DESTDIR)" -d $(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
 	@echo install: you may need to run ldconfig
 
 uninstall:
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -U $(SHARED_HISTORY)
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -U $(SHARED_READLINE)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd "$(DESTDIR)" -d $(libdir) -U $(SHARED_HISTORY)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd "$(DESTDIR)" -d $(libdir) -U $(SHARED_READLINE)
 	@echo uninstall: you may need to run ldconfig
 
 clean mostlyclean:	force
--- support/shlib-install.~1~	2002-12-18 01:25:01.000000000 +0100
+++ support/shlib-install	2002-12-18 01:30:16.000000000 +0100
@@ -13,6 +13,7 @@
 #
 INSTALLDIR=/usr/local/lib
 LDCONFIG=ldconfig
+DESTDIR=
 
 PROGNAME=`basename $0`
 USAGE="$PROGNAME [-D] -O host_os -d installation-dir -i install-prog [-U] library"
@@ -23,6 +24,7 @@ while [ $# -gt 0 ]; do
 	case "$1" in
 	-O)	shift; host_os="$1"; shift ;;
 	-d)	shift; INSTALLDIR="$1"; shift ;;
+	-dd)	shift; DESTDIR=$1; shift ;;
 	-i)	shift; INSTALLPROG="$1" ; shift ;;
 	-l)	shift; LINKAGEDIR="$1" ; shift ;;
 	-D)	echo=echo ; shift ;;
@@ -49,18 +51,18 @@ LN="ln -s"
 # pre-install
 
 if [ -z "$uninstall" ]; then
-	${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
-	if [ -f "$INSTALLDIR/$LIBNAME" ]; then
-		${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+	${echo} $RM ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+	if [ -f "${DESTDIR}$INSTALLDIR/$LIBNAME" ]; then
+		${echo} $MV ${DESTDIR}$INSTALLDIR/$LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
 	fi
 fi
 
 # install/uninstall
 
 if [ -z "$uninstall" ] ; then
-	${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
+	${echo} eval ${INSTALLPROG} $LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}
 else
-	${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
+	${echo} ${RM} ${DESTDIR}${INSTALLDIR}/${LIBNAME}
 fi
 
 # post-install/uninstall
@@ -69,7 +71,7 @@ fi
 case "$host_os" in
 hpux*|darwin*|macosx*)
 	if [ -z "$uninstall" ]; then
-		chmod 555 ${INSTALLDIR}/${LIBNAME}
+		chmod 555 ${DESTDIR}${INSTALLDIR}/${LIBNAME}
 	fi ;;
 *)	;;
 esac
@@ -90,8 +92,8 @@ case "$LIBNAME" in
 	LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]\.[0-9]:\1:'`	# libname.dylib
 esac
 
-INSTALL_LINK1='cd $INSTALLDIR ; ln -s $LIBNAME $LINK1'
-INSTALL_LINK2='cd $INSTALLDIR ; ln -s $LIBNAME $LINK2'
+INSTALL_LINK1='cd ${DESTDIR}$INSTALLDIR ; ln -s $LIBNAME $LINK1'
+INSTALL_LINK2='cd ${DESTDIR}$INSTALLDIR ; ln -s $LIBNAME $LINK2'
 
 #
 # Create symlinks to the installed library.  This section is incomplete.
@@ -99,23 +101,23 @@ INSTALL_LINK2='cd $INSTALLDIR ; ln -s $L
 case "$host_os" in
 *linux*|bsdi4*|*gnu*|darwin*|macosx*)
 	# libname.so.M -> libname.so.M.N
-	${echo} ${RM} ${INSTALLDIR}/$LINK2
+	${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
 	if [ -z "$uninstall" ]; then
-		${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK2
+		${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/$LINK2
 	fi
 
 	# libname.so -> libname.so.M.N
-	${echo} ${RM} ${LINKAGEDIR}/$LINK1
+	${echo} ${RM} ${DESTDIR}${LINKAGEDIR}/$LINK1
 	if [ -z "$uninstall" ]; then
-		${echo} ln -s ${INSTALLDIR}/$LIBNAME ${LINKAGEDIR}/$LINK1
+		${echo} ln -s ${INSTALLDIR}/$LIBNAME ${DESTDIR}${LINKAGEDIR}/$LINK1
 	fi
 	;;
 
 solaris2*|aix4.[2-9]*|osf*|irix[56]*|sysv[45]*|dgux*)
 	# libname.so -> libname.so.M
-	${echo} ${RM} ${INSTALLDIR}/$LINK1
+	${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
 	if [ -z "$uninstall" ]; then
-		${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
+		${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/$LINK1
 	fi
 	;;
 
@@ -124,31 +126,31 @@ solaris2*|aix4.[2-9]*|osf*|irix[56]*|sys
 freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
 	if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
 		# libname.so -> libname.so.M
-		${echo} ${RM} ${INSTALLDIR}/$LINK1
+		${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
 		if [ -z "$uninstall" ]; then
-			${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
+			${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/$LINK1
 		fi
 	else
 		# libname.so.M -> libname.so.M.N
-		${echo} ${RM} ${INSTALLDIR}/$LINK2
+		${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
 		if [ -z "$uninstall" ]; then
-			${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK2
+			${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/$LINK2
 		fi
 
 		# libname.so -> libname.so.M.N
-		${echo} ${RM} ${INSTALLDIR}/$LINK1
+		${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
 		if [ -z "$uninstall" ]; then
-			${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
+			${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/$LINK1
 		fi
 	fi
 	;;
 
 hpux1*)
 	# libname.sl -> libname.M
-	${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
+	${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1.sl
 	if [ -z "$uninstall" ]; then
-#		${echo} ln -s $LIBNAME ${INSTALLDIR}/${LINK1}.sl
-		${echo} ln -s $LIBNAME ${INSTALLDIR}/${LINK1}
+#		${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/${LINK1}.sl
+		${echo} ln -s $LIBNAME ${DESTDIR}${INSTALLDIR}/${LINK1}
 	fi
 	;;