From 65ec1c02c9d2e3c4d612e9a62c0755985d24dd4b Mon Sep 17 00:00:00 2001 From: Antoine Brodin Date: Sat, 15 Feb 2014 13:14:43 +0000 Subject: [PATCH] - Stage support - Move obsolete pkg-req to pkg-install/pkg-deinstall --- japanese/kappa20/Makefile | 22 +++++----------- japanese/kappa20/files/Makefile.in | 4 +-- japanese/kappa20/pkg-deinstall | 27 ++++++++++++++++++++ japanese/kappa20/pkg-install | 26 +++++++++++++++++++ japanese/kappa20/pkg-plist | 5 +--- japanese/kappa20/pkg-req | 41 ------------------------------ 6 files changed, 63 insertions(+), 62 deletions(-) create mode 100644 japanese/kappa20/pkg-deinstall create mode 100644 japanese/kappa20/pkg-install delete mode 100644 japanese/kappa20/pkg-req diff --git a/japanese/kappa20/Makefile b/japanese/kappa20/Makefile index 11e825275814..c646b99d65f4 100644 --- a/japanese/kappa20/Makefile +++ b/japanese/kappa20/Makefile @@ -3,7 +3,7 @@ PORTNAME= k20fonts PORTVERSION= 0.396 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= japanese x11-fonts MASTER_SITES= ${MASTER_SITE_NETBSD:S/$/:kappa20/:S/%SUBDIR%/LOCAL_PORTS/} \ http://downloads.sourceforge.jp/x-tt/8412/:ayu20 @@ -24,15 +24,13 @@ BUILD_DEPENDS= mkitalic:${PORTSDIR}/x11-fonts/mkbold-mkitalic \ RUN_DEPENDS= mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \ mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale -NO_STAGE= yes -.include - FONTSDIR= lib/X11/fonts/local -MAKE_ENV= INSTALL_DATA="${INSTALL_DATA}" MAKE_ARGS= FONTSDIR="${FONTSDIR}" PLIST_SUB= FONTSDIR=${FONTSDIR} DOCSDIR= ${PREFIX}/share/doc/ja/${PORTNAME} +OPTIONS_DEFINE= DOCS + post-extract: (cd ${WRKSRC} ; ${TAR} xpzf ${DISTDIR}/${AYUDISTNAME}${AYU_SUFFIX}) (cd ${WRKSRC} ; ${MV} Makefile Makefile.dist) @@ -43,14 +41,8 @@ pre-build: (cd ${WRKSRC} ; ${SH} makebdf.sh) pre-install: - @${MKDIR} ${DOCSDIR} - @${INSTALL_DATA} ${WRKSRC}/fonts.alias ${DOCSDIR} - @${CAT} ${WRKSRC}/fonts.alias >> ${PREFIX}/${FONTSDIR}/fonts.alias -.if !defined(NOPORTDOCS) - @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/README.euc-jp -.endif + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/fonts.alias ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}/README.euc-jp -post-install: - @(cd ${PREFIX}/${FONTSDIR} ; mkfontdir) - -.include +.include diff --git a/japanese/kappa20/files/Makefile.in b/japanese/kappa20/files/Makefile.in index df4b0df211be..8aa3ce29214d 100644 --- a/japanese/kappa20/files/Makefile.in +++ b/japanese/kappa20/files/Makefile.in @@ -55,8 +55,8 @@ fonts.alias: Makefile.dist ${CAT} fonts.alias.ayu >> $@ install: - mkdir -p ${PREFIX}/${FONTSDIR} - ${BSD_INSTALL_DATA} ${PCF_ALL} ${PREFIX}/${FONTSDIR} + mkdir -p ${DESTDIR}${PREFIX}/${FONTSDIR} + ${BSD_INSTALL_DATA} ${PCF_ALL} ${DESTDIR}${PREFIX}/${FONTSDIR} clean:: rm ${MADE_BOLD} ${MADE_ITALIC} ${PCF_ALL} diff --git a/japanese/kappa20/pkg-deinstall b/japanese/kappa20/pkg-deinstall new file mode 100644 index 000000000000..f43798383f48 --- /dev/null +++ b/japanese/kappa20/pkg-deinstall @@ -0,0 +1,27 @@ +#!/bin/sh + +if [ "$2" != "DEINSTALL" ]; then + exit 0 +fi + +FONTDIR=${PKG_PREFIX}/lib/X11/fonts/local +FAFILE=${PKG_PREFIX}/share/doc/ja/k20fonts/fonts.alias + +grepv() { + awk -v SRC=$1 'BEGIN{while (getline < SRC) {ENTRY[$0]=1}} (ENTRY[$0] != 1) {print}' $2 +} + +echo "Updating ${FONTDIR}/fonts.alias" +cd ${FONTDIR} +touch fonts.alias +cp fonts.alias fonts.alias.orig +grepv ${FAFILE} fonts.alias.orig > fonts.alias +if [ ! -s fonts.alias ]; then rm -f fonts.alias; fi +rm -f fonts.alias.orig + +echo "**********************************************************" +echo "You should restart X server or do 'xset fp rehash' command" +echo "to enable this update." +echo "**********************************************************" + +exit 0 diff --git a/japanese/kappa20/pkg-install b/japanese/kappa20/pkg-install new file mode 100644 index 000000000000..422367fe5a86 --- /dev/null +++ b/japanese/kappa20/pkg-install @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ "$2" != "POST-INSTALL" ]; then + exit 0 +fi + +FONTDIR=${PKG_PREFIX}/lib/X11/fonts/local +FAFILE=${PKG_PREFIX}/share/doc/ja/k20fonts/fonts.alias + +grepv() { + awk -v SRC=$1 'BEGIN{while (getline < SRC) {ENTRY[$0]=1}} (ENTRY[$0] != 1) {print}' $2 +} + +echo "Updating ${FONTDIR}/fonts.alias" +cd ${FONTDIR} +touch fonts.alias +cp fonts.alias fonts.alias.orig +(grepv ${FAFILE} fonts.alias.orig ; cat ${FAFILE}) > fonts.alias +rm -f fonts.alias.orig + +echo "**********************************************************" +echo "You should restart X server or do 'xset fp rehash' command" +echo "to enable this update." +echo "**********************************************************" + +exit 0 diff --git a/japanese/kappa20/pkg-plist b/japanese/kappa20/pkg-plist index 96c3a75c4647..5338c1c2ee05 100644 --- a/japanese/kappa20/pkg-plist +++ b/japanese/kappa20/pkg-plist @@ -1,4 +1,3 @@ -%%FONTSDIR%%/fonts.alias %%FONTSDIR%%/10x20L10b.pcf.gz %%FONTSDIR%%/10x20L10bi.pcf.gz %%FONTSDIR%%/10x20L10m.pcf.gz @@ -65,9 +64,7 @@ %%FONTSDIR%%/vk20mi.pcf.gz %%PORTDOCS%%%%DOCSDIR%%/README.euc-jp %%PORTDOCS%%%%DOCSDIR%%/fonts.alias -@dirrm %%DOCSDIR%% +%%PORTDOCS%%@dirrm %%DOCSDIR%% @exec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir -@exec cat %D/%%DOCSDIR%%/fonts.alias >> %D/%%FONTSDIR%%/fonts.alias @unexec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir @unexec if [ `wc -c %D/%%FONTSDIR%%/fonts.dir | awk '{print $1}'` = 2 ]; then rm -f %D/%%FONTSDIR%%/fonts.dir; fi -@unexec if [ ! -s %D/%%FONTSDIR%%/fonts.alias ]; then rm -f %D/%%FONTSDIR%%/fonts.alias; fi diff --git a/japanese/kappa20/pkg-req b/japanese/kappa20/pkg-req deleted file mode 100644 index 20532a9048c8..000000000000 --- a/japanese/kappa20/pkg-req +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -if [ "x$1" = "x" ]; then - exit 1; -fi -if [ "x$2" != "xINSTALL" -a "x$2" != "xDEINSTALL" ]; then - exit 1; -fi - -export FONTDIR; FONTDIR=${PKG_PREFIX}/lib/X11/fonts/local - -if [ "$2x" = "INSTALLx" -a ! -d ${FONTDIR} ]; then - echo '**********************************************************************' - echo "****** ${FONTDIR}/ doesn't exist." - echo "****** Creating ${FONTDIR}/" - echo '****** Please upgrade your XFree86 to 3.3.3 or upper,' - echo "****** or add this directory to your /etc/XF86Config's FontPath entry." - echo '**********************************************************************' - mkdir ${FONTDIR} -fi - -grepv() { - awk -v SRC=$1 'BEGIN{while (getline < SRC) {ENTRY[$0]=1}} (ENTRY[$0] != 1) {print}' $2 -} - -if [ "$2" = "DEINSTALL" ] ; then - FAFILE=${PKG_PREFIX}/share/doc/ja/k20fonts/fonts.alias - echo "Updating ${FONTDIR}/fonts.alias" - cd ${FONTDIR} - touch fonts.alias - cp fonts.alias fonts.alias.orig - grepv ${FAFILE} fonts.alias.orig > fonts.alias - rm -f fonts.alias.orig -fi - -echo "**********************************************************" -echo "You should restart X server or do 'xset fp rehash' command" -echo "to enable this update." -echo "**********************************************************" - -exit 0;