diff options
author | jlam <jlam> | 2001-09-28 20:34:53 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-09-28 20:34:53 +0000 |
commit | cfc6d80b3c8fdaf21d758d7103403a10e3d75744 (patch) | |
tree | a97ff876a03f98b97eb257ebdd89ff451f2f6f5f /x11 | |
parent | cc5c0d07f06482dd150b7b85501018d73e5b9872 (diff) | |
download | pkgsrc-cfc6d80b3c8fdaf21d758d7103403a10e3d75744.tar.gz |
Copy over changes to DEINSTALL/INSTALL scripts from the x11/openmotif
package. This allows this package to deinstall/install correctly from
binary packages without xpkgwedge installed.
Diffstat (limited to 'x11')
-rw-r--r-- | x11/lesstif/pkg/DEINSTALL | 31 | ||||
-rw-r--r-- | x11/lesstif/pkg/INSTALL | 40 |
2 files changed, 51 insertions, 20 deletions
diff --git a/x11/lesstif/pkg/DEINSTALL b/x11/lesstif/pkg/DEINSTALL index f4081e646a9..d31391870a1 100644 --- a/x11/lesstif/pkg/DEINSTALL +++ b/x11/lesstif/pkg/DEINSTALL @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: DEINSTALL,v 1.4 2001/08/08 07:37:51 jlam Exp $ +# $NetBSD: DEINSTALL,v 1.5 2001/09/28 20:34:53 jlam Exp $ PKGNAME=$1 STAGE=$2 @@ -8,33 +8,46 @@ STAGE=$2 LOCALBASE="@LOCALBASE@" CP="@CP@" +CMP="@CMP@" +ECHO="@ECHO@" GREP="@GREP@" RM="@RM@" RMDIR="@RMDIR@" TRUE="@TRUE@" +LOCALBASE=@LOCALBASE@ +X11BASE=@X11BASE@ +X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def +HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def + case ${STAGE} in DEINSTALL) ;; POST-DEINSTALL) - X11_HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def - - echo -n "Updating ${X11_HOSTDEF}..." - ${CP} -f ${X11_HOSTDEF} ${X11_HOSTDEF}.bak - ( ${GREP} -v LessTif ${X11_HOSTDEF}.bak || ${TRUE} ) \ - > ${X11_HOSTDEF} - echo "done." + ${ECHO} -n "Updating ${HOSTDEF}..." + ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak + ( ${GREP} -v LessTif ${HOSTDEF}.bak || ${TRUE} ) > ${HOSTDEF} + ${RM} -f ${HOSTDEF}.bak + if [ ${PKG_PREFIX} != ${X11BASE} ] && \ + [ -f ${X11_HOSTDEF} ] && \ + ${CMP} -s ${X11_HOSTDEF} ${HOSTDEF} + then + ${RM} -f ${HOSTDEF} + fi + ${ECHO} "done." if [ ${PKG_PREFIX} != ${LOCALBASE} ] then ${RM} -f ${LOCALBASE}/share/aclocal/ac_find_motif.m4 ${RMDIR} -p ${PKG_PREFIX}/share/aclocal 2>/dev/null || ${TRUE} fi + + ${RMDIR} -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || ${TRUE} ;; *) - echo "Unexpected argument: ${STAGE}" + ${ECHO} "Unexpected argument: ${STAGE}" exit 1 ;; esac diff --git a/x11/lesstif/pkg/INSTALL b/x11/lesstif/pkg/INSTALL index 58b7ff3e3d8..475bc5ded09 100644 --- a/x11/lesstif/pkg/INSTALL +++ b/x11/lesstif/pkg/INSTALL @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: INSTALL,v 1.4 2001/08/08 07:37:51 jlam Exp $ +# $NetBSD: INSTALL,v 1.5 2001/09/28 20:34:53 jlam Exp $ PKGNAME=$1 STAGE=$2 @@ -8,32 +8,50 @@ STAGE=$2 LOCALBASE="@LOCALBASE@" CP="@CP@" +ECHO="@ECHO@" GREP="@GREP@" LN="@LN@" +MV="@MV@" +RM="@RM@" + +LOCALBASE=@LOCALBASE@ +X11BASE=@X11BASE@ +X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def +HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def case ${STAGE} in PRE-INSTALL) ;; POST-INSTALL) - X11_HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def - - echo -n "Updating ${X11_HOSTDEF}..." - ${CP} -f ${X11_HOSTDEF} ${X11_HOSTDEF}.bak - ( ${GREP} -v LessTif ${X11_HOSTDEF}.bak; \ - echo '#include <LessTif.def>' ) \ - > ${X11_HOSTDEF} - echo "done." + if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ] + then + ${ECHO} -n "Updating ${HOSTDEF}..." + ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak + else + ${ECHO} -n "Creating ${HOSTDEF}..." + if [ -f ${X11_HOSTDEF} ] + then + ${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak + else + ${CP} -f /dev/null ${HOSTDEF}.bak + fi + fi + ( ${GREP} -v LessTif ${HOSTDEF}.bak; \ + ${ECHO} '#include <LessTif.def>'; \ + ) > ${HOSTDEF} + ${RM} -f ${HOSTDEF}.bak + ${ECHO} "done." if [ ${PKG_PREFIX} != ${LOCALBASE} ] then - ${LN} -fs ${PKG_PREFIX}/share/aclocal/ac_find_motif.m4 \ + ${LN} -fs ${PKG_PREFIX}/share/aclocal/ac_find_motif.m4 \ ${LOCALBASE}/share/aclocal/ac_find_motif.m4 fi ;; *) - echo "Unexpected argument: ${STAGE}" + ${ECHO} "Unexpected argument: ${STAGE}" exit 1 ;; esac |