diff options
author | jlam <jlam> | 2002-02-26 21:49:05 +0000 |
---|---|---|
committer | jlam <jlam> | 2002-02-26 21:49:05 +0000 |
commit | fcf0059e7a2a43a7a9a265402de57463290c9433 (patch) | |
tree | 6dd4453140eeb6818efc712c1954d785e28a5231 /pkgtools/xpkgwedge | |
parent | 3a8f84742555f8a67ff2c131d96f54730f924000 (diff) | |
download | pkgsrc-fcf0059e7a2a43a7a9a265402de57463290c9433.tar.gz |
Symlink/remove bdftopcf, fstobdf, and mkfontdir in the INSTALL/DEINSTALL
scripts so that they are properly added and removed if xpkgwedge is
installed as a binary package. Also, add some protection against the case
where ${X11BASE} == ${PREFIX} by checking this isn't true before removing
these font-manipulation programs.
Diffstat (limited to 'pkgtools/xpkgwedge')
-rwxr-xr-x | pkgtools/xpkgwedge/DEINSTALL | 19 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/INSTALL | 25 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/Makefile | 15 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/PLIST | 5 |
4 files changed, 45 insertions, 19 deletions
diff --git a/pkgtools/xpkgwedge/DEINSTALL b/pkgtools/xpkgwedge/DEINSTALL index 329f87e388a..99c73ae44bc 100755 --- a/pkgtools/xpkgwedge/DEINSTALL +++ b/pkgtools/xpkgwedge/DEINSTALL @@ -1,17 +1,19 @@ #!/bin/sh # -# $NetBSD: DEINSTALL,v 1.1 2001/10/31 21:19:16 zuntum Exp $ +# $NetBSD: DEINSTALL,v 1.2 2002/02/26 21:49:05 jlam Exp $ PKGNAME=$1 STAGE=$2 CMP="@CMP@" CP="@CP@" +ECHO="@ECHO@" GREP="@GREP@" RM="@RM@" RMDIR="@RMDIR@" TRUE="@TRUE@" +FONT_PROGS="@FONT_PROGS@" X11BASE=@X11BASE@ X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def @@ -21,7 +23,16 @@ DEINSTALL) ;; POST-DEINSTALL) - echo -n "Updating ${HOSTDEF}..." + for prog in ${FONT_PROGS} + do + if [ -f ${PKG_PREFIX}/bin/${prog} -a \ + ${PKG_PREFIX} != ${X11BASE} ] + then + ${RM} -f ${PKG_PREFIX}/bin/${prog} + fi + done + + ${ECHO} -n "Updating ${HOSTDEF}..." ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak ( ${GREP} -v xpkgwedge ${HOSTDEF}.bak || ${TRUE} ) > ${HOSTDEF} ${RM} -f ${HOSTDEF}.bak @@ -31,12 +42,12 @@ POST-DEINSTALL) then ${RM} -f ${HOSTDEF} fi - echo "done." + ${ECHO} "done." ${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/pkgtools/xpkgwedge/INSTALL b/pkgtools/xpkgwedge/INSTALL index 18f67e7c226..aa2fad3c8bb 100644 --- a/pkgtools/xpkgwedge/INSTALL +++ b/pkgtools/xpkgwedge/INSTALL @@ -1,14 +1,17 @@ #!/bin/sh # -# $NetBSD: INSTALL,v 1.1 2001/10/31 21:19:17 zuntum Exp $ +# $NetBSD: INSTALL,v 1.2 2002/02/26 21:49:06 jlam Exp $ PKGNAME=$1 STAGE=$2 CP="@CP@" +ECHO="@ECHO@" GREP="@GREP@" +LN="@LN@" RM="@RM@" +FONT_PROGS="@FONT_PROGS@" X11BASE=@X11BASE@ X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def @@ -18,12 +21,22 @@ PRE-INSTALL) ;; POST-INSTALL) + for prog in ${FONT_PROGS} + do + if [ -f ${X11BASE}/bin/${prog} -a \ + ${PKG_PREFIX} != ${X11BASE} ] + then + ${LN} -fs ${X11BASE}/bin/${prog} \ + ${PKG_PREFIX}/bin/${prog} + fi + done + if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ] then - echo -n "Updating ${HOSTDEF}..." + ${ECHO} -n "Updating ${HOSTDEF}..." ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak else - echo -n "Creating ${HOSTDEF}..." + ${ECHO} -n "Creating ${HOSTDEF}..." if [ -f ${X11_HOSTDEF} ] then ${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak @@ -31,15 +44,15 @@ POST-INSTALL) ${CP} -f /dev/null ${HOSTDEF}.bak fi fi - ( echo '#include <xpkgwedge.def>'; \ + ( ${ECHO} '#include <xpkgwedge.def>'; \ ${GREP} -v xpkgwedge ${HOSTDEF}.bak; \ ) > ${HOSTDEF} ${RM} -f ${HOSTDEF}.bak - echo "done." + ${ECHO} "done." ;; *) - echo "Unexpected argument: ${STAGE}" + ${ECHO} "Unexpected argument: ${STAGE}" exit 1 ;; esac diff --git a/pkgtools/xpkgwedge/Makefile b/pkgtools/xpkgwedge/Makefile index 8c06bc8e06f..1ebea390cd2 100644 --- a/pkgtools/xpkgwedge/Makefile +++ b/pkgtools/xpkgwedge/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.30 2001/10/14 16:42:58 tron Exp $ +# $NetBSD: Makefile,v 1.31 2002/02/26 21:49:06 jlam Exp $ DISTNAME= xpkgwedge-1.7 CATEGORIES= pkgtools devel x11 @@ -17,11 +17,19 @@ NO_CHECKSUM= # defined DEINSTALL_FILE= ${WRKDIR}/DEINSTALL INSTALL_FILE= ${WRKDIR}/INSTALL -FILES_SUBST= X11BASE=${X11BASE} +# FONT_PROGS are symlinked from ${X11BASE}/bin to ${PREFIX}/bin to allow +# ${PREFIX}/bin/${prog} to always work. +# +FONT_PROGS= bdftopcf fstobdf mkfontdir + +FILES_SUBST= FONT_PROGS=${FONT_PROGS:Q} +FILES_SUBST+= X11BASE=${X11BASE} FILES_SUBST+= PREFIX=${PREFIX} FILES_SUBST+= CMP=${CMP:Q} FILES_SUBST+= CP=${CP:Q} +FILES_SUBST+= ECHO=${ECHO:Q} FILES_SUBST+= GREP=${GREP:Q} +FILES_SUBST+= LN=${LN:Q} FILES_SUBST+= RM=${RM:Q} FILES_SUBST+= RMDIR=${RMDIR:Q} FILES_SUBST+= TRUE=${TRUE:Q} @@ -46,9 +54,6 @@ do-install: ${INSTALL_DATA_DIR} ${PREFIX}/lib/X11/config ${INSTALL_DATA} ${FILESDIR}/xpkgwedge.def ${PREFIX}/lib/X11/config ${INSTALL_SCRIPT} ${WRKSRC}/pkgxmkmf ${PREFIX}/bin/pkgxmkmf - for FILE in bdftopcf fstobdf mkfontdir; do \ - ${LN} -fs ${X11BASE}/bin/$$FILE ${PREFIX}/bin; \ - done post-install: PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL diff --git a/pkgtools/xpkgwedge/PLIST b/pkgtools/xpkgwedge/PLIST index 69427e24f54..54480277ffe 100644 --- a/pkgtools/xpkgwedge/PLIST +++ b/pkgtools/xpkgwedge/PLIST @@ -1,6 +1,3 @@ -@comment $NetBSD: PLIST,v 1.1 2001/10/31 21:19:18 zuntum Exp $ -bin/bdftopcf -bin/fstobdf -bin/mkfontdir +@comment $NetBSD: PLIST,v 1.2 2002/02/26 21:49:06 jlam Exp $ bin/pkgxmkmf lib/X11/config/xpkgwedge.def |