Subject: pkg/28607: mail/exmh does not honor certain variables
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <georg.schwarz@freenet.de>
List: pkgsrc-bugs
Date: 12/11/2004 16:00:01
>Number:         28607
>Category:       pkg
>Synopsis:       mail/exmh does not honor certain variables
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 11 16:00:00 +0000 2004
>Originator:     Georg Schwarz
>Release:        current pkgsrc
>Organization:
>Environment:
>Description:
mail/exmh does not honor certain environment variables, which leads to problems on systems with less compatible native sed, install, etc.
Also it assumes that tclsh is in the shell path.
>How-To-Repeat:

>Fix:
The following patches fix the problem (though the situation might be somewhat different on systems with native tclsh):

--- Makefile.orig       2004-12-11 15:10:11.000000000 +0100
+++ Makefile    2004-12-11 16:51:53.000000000 +0100
@@ -20,7 +20,7 @@
 USE_X11=       yes
 
 WISH=          wish
-TCLSH=         tclsh
+TCLSH=         ${LOCALBASE}/bin/tclsh
 
 # Additionally, exmh will use the following packages if present:
 # lang/expect
@@ -31,12 +31,18 @@
 # audio/rplay
 
 do-build:
-       @cd ${WRKSRC} && ${SETENV} PREFIX=${PREFIX} TCLSH=${TCLSH} \
-               WISH=${PREFIX}/bin/${WISH} WRKSRC=${WRKSRC} \
-               FILESDIR=${FILESDIR} ${SH} ${FILESDIR}/build
+       @cd ${WRKSRC} && ${SETENV} PREFIX="${PREFIX}" TCLSH="${TCLSH}" \
+               WISH="${PREFIX}/bin/${WISH}" WRKSRC="${WRKSRC}" \
+               FILESDIR="${FILESDIR}" RM="${RM}" SED="${SED}" \
+               ECHO="${ECHO}" ${SH} ${FILESDIR}/build
 
 do-install:
-       @cd ${WRKSRC} && ${SETENV} PREFIX=${PREFIX} \
-               WRKSRC=${WRKSRC} ${SH} ${FILESDIR}/install
+       @cd ${WRKSRC} && ${SETENV} PREFIX="${PREFIX}" \
+               WRKSRC="${WRKSRC}" MKDIR="${MKDIR}" \
+               INSTALL_DATA="${INSTALL_DATA}" \
+               INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
+               INSTALL_MAN="${INSTALL_MAN}" \
+               INSTALL_LIB="${INSTALL_LIB}" \
+               SED="${SED}" ECHO="${ECHO}" ${SH} ${FILESDIR}/install
 
 .include "../../mk/bsd.pkg.mk"

--- files/build.orig    2004-12-11 15:59:42.000000000 +0100
+++ files/build 2004-12-11 16:02:08.000000000 +0100
@@ -4,8 +4,8 @@
 # FreeBSD Id: build,v 1.5 1997/08/21 08:09:56 peter Exp
 #
 
-VERSION="`sed -ne 's/^set vers \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
-DATE="`sed -ne 's/^set date \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
+VERSION="`${SED} -ne 's/^set vers \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
+DATE="`${SED} -ne 's/^set date \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
 
 SEDFILE=sed.$$
 
@@ -60,13 +60,13 @@
   PLAY=${PREFIX}/bin/rplay             #executable
 fi
 
-echo "s@^#!wish@#!${WISH}@" >${SEDFILE}
+${ECHO} "s@^#!wish@#!${WISH}@" >${SEDFILE}
 if [ "${EXPECT}" != "{}" ]; then
-  echo "s@^#!expect@#!${EXPECT}@" >>${SEDFILE}
+  ${ECHO} "s@^#!expect@#!${EXPECT}@" >>${SEDFILE}
 fi
-echo "/^#CONFIGURATION/a\\" >>${SEDFILE}
+${ECHO} "/^#CONFIGURATION/a\\" >>${SEDFILE}
 
-sed <${FILESDIR}/config \
+${SED} <${FILESDIR}/config \
        -e "s+!!PREFIX!!+${PREFIX}+g" \
        -e "s+!!WISH!!+${WISH}+g" \
        -e "s+!!EXPECT!!+${EXPECT}+g" \
@@ -81,15 +81,15 @@
        -e "s+!!PLAY!!+${PLAY}+g" \
        -e "s+!!VERSION!!+${VERSION}+g" \
        -e "s+!!DATE!!+${DATE}+g" \
- | sed -e 's/$/\\/' >> ${SEDFILE}
+ | ${SED} -e 's/$/\\/' >> ${SEDFILE}
 
 for i in exmh-async exmh-bg exmh ftp.expect
 do
-       echo "sed -f ${SEDFILE} < $i.MASTER > $i"
-       sed -f ${SEDFILE} < $i.MASTER > $i
+       ${ECHO} "${SED} -f ${SEDFILE} < $i.MASTER > $i"
+       ${SED} -f ${SEDFILE} < $i.MASTER > $i
 done
 
-rm -f ${SEDFILE}
+${RM} -f ${SEDFILE}
 
-echo "cd lib ;  echo 'auto_mkindex . *.tcl ; exit' | ${TCLSH}"
-cd lib ;  echo 'auto_mkindex . *.tcl ; exit' | ${TCLSH}
+${ECHO} "cd lib ;  ${ECHO} 'auto_mkindex . *.tcl ; exit' | ${TCLSH}"
+cd lib ;  ${ECHO} 'auto_mkindex . *.tcl ; exit' | ${TCLSH}

--- files/install.orig  2004-12-11 15:42:48.000000000 +0100
+++ files/install       2004-12-11 16:49:43.000000000 +0100
@@ -4,36 +4,36 @@
 # FreeBSD Id: install,v 1.2 1996/12/31 21:27:03 peter Exp
 #
 
-VERSION="`sed -ne 's/^set vers \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
+VERSION="`${SED} -ne 's/^set vers \(.*\)/\1/p' ${WRKSRC}/exmh.install`"
 
 # Rename while installing..
 for i in exmh
 do
-       echo "install -c -o bin -g bin -m 444 $i.l ${PREFIX}/man/man1/$i.1"
-       install -c -o bin -g bin -m 444 $i.l ${PREFIX}/man/man1/$i.1
+       ${ECHO} "${INSTALL_MAN} $i.l ${PREFIX}/man/man1/$i.1"
+       ${INSTALL_MAN} $i.l ${PREFIX}/man/man1/$i.1
 done
 
 BINS="exmh-async exmh-bg exmh ftp.expect"
 
-echo "install -c -o bin -g bin -m 755 ${BINS} ${PREFIX}/bin"
-install -c -o bin -g bin -m 755 ${BINS} ${PREFIX}/bin
+${ECHO} "${INSTALL_SCRRIPT} ${BINS} ${PREFIX}/bin"
+${INSTALL_SCRIPT} ${BINS} ${PREFIX}/bin
 
 if [ ! -d ${PREFIX}/lib/exmh-${VERSION} ]
 then
-       echo "mkdir ${PREFIX}/lib/exmh-${VERSION}"
-       mkdir ${PREFIX}/lib/exmh-${VERSION}
+       ${ECHO} "${MKDIR} ${PREFIX}/lib/exmh-${VERSION}"
+       ${MKDIR} ${PREFIX}/lib/exmh-${VERSION}
 fi
 
 LIBFILES='lib/PgpDecryptExpect lib/*.tcl lib/*.bitmap lib/*.ppm lib/help.* lib/tclIndex lib/app-defaults lib/app-defaults-* lib/*.mask lib/*.exp lib/mime.types lib/*.au lib/*.gif'
 
-echo "install -c -o bin -g bin -m 444 ${LIBFILES} ${PREFIX}/lib/exmh-${VERSION}"
-install -c -o bin -g bin -m 444 ${LIBFILES} ${PREFIX}/lib/exmh-${VERSION}
+${ECHO} "${INSTALL_LIB} ${LIBFILES} ${PREFIX}/lib/exmh-${VERSION}"
+${INSTALL_LIB} ${LIBFILES} ${PREFIX}/lib/exmh-${VERSION}
 
 if [ ! -d ${PREFIX}/lib/exmh-${VERSION}/html ]
 then
-       echo "mkdir ${PREFIX}/lib/exmh-${VERSION}/html"
-       mkdir ${PREFIX}/lib/exmh-${VERSION}/html
+       ${ECHO} "${MKDIR} ${PREFIX}/lib/exmh-${VERSION}/html"
+       ${MKDIR} ${PREFIX}/lib/exmh-${VERSION}/html
 fi
 
-echo "install -c -o bin -g bin -m 444 lib/html/* ${PREFIX}/lib/exmh-${VERSION}/html"
-install -c -o bin -g bin -m 444 lib/html/* ${PREFIX}/lib/exmh-${VERSION}/html
+${ECHO} "${INSTALL_DATA} lib/html/* ${PREFIX}/lib/exmh-${VERSION}/html"
+${INSTALL_DATA} lib/html/* ${PREFIX}/lib/exmh-${VERSION}/html