diff options
Diffstat (limited to 'chinese/arphicttf')
-rw-r--r-- | chinese/arphicttf/Makefile | 33 | ||||
-rw-r--r-- | chinese/arphicttf/pkg-deinstall | 31 | ||||
-rw-r--r-- | chinese/arphicttf/pkg-install | 142 | ||||
-rw-r--r-- | chinese/arphicttf/pkg-plist | 37 |
4 files changed, 104 insertions, 139 deletions
diff --git a/chinese/arphicttf/Makefile b/chinese/arphicttf/Makefile index 823156d87944..a5991ee67ad7 100644 --- a/chinese/arphicttf/Makefile +++ b/chinese/arphicttf/Makefile @@ -7,29 +7,42 @@ PORTNAME= arphicttf PORTVERSION= 2.11 +PORTREVISION= 1 CATEGORIES= chinese x11-fonts MASTER_SITES= ftp://freebsd.sinica.edu.tw/pub/keith/ -DISTNAME= ${PKGNAME} +DISTNAME= ${PKGNAMEPREFIX}${PORTNAME}-${PORTVERSION} MAINTAINER= keith@FreeBSD.org -LIB_DEPENDS= font.1:${PORTSDIR}/x11-servers/XttXF86srv-common +RUN_DEPENDS= ttfm.sh:${PORTSDIR}/chinese/ttfm -USE_X_PREFIX= yes +CJK?= NO +GS6?= NO +XTT?= YES -NO_BUILD= yes +NO_BUILD= YES SHAREMODE= 644 WRKSRC= ${WRKDIR}/arphic -FONTDIR= ${PREFIX}/lib/X11/fonts/TrueType +USE_XLIB= YES +FONTDIR= ${PREFIX}/share/fonts/TrueType +XFONTDIR= ${X11BASE}/lib/X11/fonts/TrueType +INSTALL_ENV= PKG_PREFIX=${PREFIX} CJK=${CJK} GS6=${GS6} XTT=${XTT} \ + XFREE86_VERSION=${XFREE86_VERSION} .include <bsd.port.pre.mk> +.if ${CJK} != "NO" +RUN_DEPENDS+= bg5latex:${PORTSDIR}/chinese/CJK +.endif +.if ${GS6} != "NO" +RUN_DEPENDS+= ${LOCALBASE}/share/ghostscript/CJK/CMap/B5pc-H:${PORTSDIR}/chinese/ghostscript6 +.endif +.if ${XFREE86_VERSION} == 3 && ${XTT} != "NO" +RUN_DEPENDS+= mkfontdir.pl:${PORTSDIR}/x11-servers/XttXF86srv-common +.endif + do-install: .if !exists(${FONTDIR}) - @${ECHO} "=========================================================" - @${ECHO} "Please add ${FONTDIR} to your font path" - @${ECHO} "in /etc/XF86Config." - @${ECHO} "=========================================================" @${MKDIR} ${FONTDIR} .endif @${INSTALL_DATA} ${WRKSRC}/font/bkai00mp.ttf ${FONTDIR} @@ -40,6 +53,6 @@ do-install: @${MKDIR} ${FONTDIR}/arphic @${CP} -fr ${WRKSRC}/license ${FONTDIR}/arphic @${CP} -f ${WRKSRC}/logo.gif ${WRKSRC}/release.txt ${FONTDIR}/arphic - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${SETENV} ${INSTALL_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.post.mk> diff --git a/chinese/arphicttf/pkg-deinstall b/chinese/arphicttf/pkg-deinstall index ed6e4ba2c642..c29500f46075 100644 --- a/chinese/arphicttf/pkg-deinstall +++ b/chinese/arphicttf/pkg-deinstall @@ -1,17 +1,26 @@ #!/bin/sh + if [ "$2" != "DEINSTALL" ]; then exit 0 fi -FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType -cd ${FONTDIR} -# Restore fonts.dir -sed -e '/ -ar-/d' -e '/ -arphic-/d' fonts.dir > fonts.dir.tmp -numfonts=$(echo $(cat fonts.dir.tmp | wc -l) - 1 | bc) -echo ${numfonts} > fonts.dir -sed -e 1d fonts.dir.tmp >> fonts.dir -rm -f fonts.dir.tmp +PKGNAME=$1 +PREFIX=${PKG_PREFIX} +TTFM=${PKG_PREFIX}/bin/ttfm.sh + +FONTDIR=${PREFIX}/share/fonts/TrueType +FONTS="bkai00mp.ttf bsmi00lp.ttf gbsn00lp.ttf gkai00mp.ttf" +DEFAULTMING="default_ming-big5-0.ttf default_ming-gb2312.1980-0.ttf" +DEFAULTKAI="default_kai-big5-0.ttf default_kai-gb2312.1980-0.ttf" + +if [ -r $FONTDIR/$PKGNAME ]; then + for i in `cat $FONTDIR/$PKGNAME`; do + for f in $FONTS $DEFAULTMING $DEFAULTKAI; do + $TTFM --remove $i $f + done + done +fi + +rm -f $FONTDIR/$PKGNAME -# Restore fonts.alias -sed -e '/^-ar-/d' -e '/^-arphic-/d' fonts.alias > fonts.alias.tmp -mv -f fonts.alias.tmp fonts.alias +exit 0 diff --git a/chinese/arphicttf/pkg-install b/chinese/arphicttf/pkg-install index ef163538c1c5..c1d5fa4f208e 100644 --- a/chinese/arphicttf/pkg-install +++ b/chinese/arphicttf/pkg-install @@ -1,113 +1,55 @@ #!/bin/sh -FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType + if [ "$2" = "PRE-INSTALL" ]; then - echo "Please add ${FONTDIR} to your /etc/XF86Config file" exit 0 fi -cd ${FONTDIR} - -echo "Updating fonts.dir & fonts.alias. This may take a while..." -# Update fonts.dir -touch fonts.dir -sed -e '/ -ar-/d' -e '/ -arphic-/d' fonts.dir > fonts.dir.tmp -# Add 16 new fonts -numfonts=$(echo $(cat fonts.dir.tmp |wc -l) - 1 + 16 |bc) -if [ ${numfonts} -le 16 ]; then # fonts.dir.tmp is empty - echo 16 > fonts.dir -else - echo ${numfonts} > fonts.dir - sed -e 1d fonts.dir.tmp >> fonts.dir -fi -rm -f fonts.dir.tmp - -# The TTF filenames are so diverse that we can only iterate one -# by one, instead of a generic for loop. - -# bkai00mp.ttf (Big5) -echo bkai00mp.ttf -ar-kai-medium-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ab=y:bkai00mp.ttf -ar-kai-bold-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ai=0.3:bkai00mp.ttf -ar-kai-medium-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ab=y:ai=0.3:bkai00mp.ttf -ar-kai-bold-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -# bsmi00lp.ttf (Big5) -echo bsmi00lp.ttf -ar-ming-medium-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ab=y:bsmi00lp.ttf -ar-ming-bold-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ai=0.3:bsmi00lp.ttf -ar-ming-medium-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir -echo ab=y:ai=0.3:bsmi00lp.ttf -ar-ming-bold-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir +PKGNAME=$1 +PREFIX=${PKG_PREFIX} +TTFM=${PREFIX}/bin/ttfm.sh -# gbsn00lp.ttf (GB) -echo gbsn00lp.ttf -ar-sung-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ab=y:gbsn00lp.ttf -ar-sung-bold-r-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ai=0.3:gbsn00lp.ttf -ar-sung-medium-i-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ab=y:ai=0.3:gbsn00lp.ttf -ar-sung-bold-i-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir +FONTDIR=${PREFIX}/share/fonts/TrueType +FONTS="bkai00mp.ttf bsmi00lp.ttf gbsn00lp.ttf gkai00mp.ttf" +DEFAULTMING="bsmi00lp.ttf gbsn00lp.ttf" +DEFAULTKAI="bkai00mp.ttf gkai00mp.ttf" -# gkai00mp.ttf (GB) -echo gkai00mp.ttf -ar-kai-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ab=y:gkai00mp.ttf -ar-kai-bold-r-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ai=0.3:gkai00mp.ttf -ar-kai-medium-i-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir -echo ab=y:ai=0.3:gkai00mp.ttf -ar-kai-bold-i-normal--0-0-0-0-c-0-gb2312.1980-0 >> fonts.dir +[ "X$XTT" = "X" ] && XTT=YES +if [ ! -x $TTFM ]; then + echo "$TTFM not found!" + exit 1 +fi -# Update fonts.alias, font size ranges from 8 to 128. -# Medium/Bold & Roman/Italic variations are also added. -touch fonts.alias -sed -e '/^-ar-/d' -e '/^-arphic-/d' fonts.alias > fonts.alias.tmp -mv -f fonts.alias.tmp fonts.alias - -# Iterate four fonts, same as in fonts.dir. +rm -f $FONTDIR/$PKGNAME -# bkai00mp.ttf (Big5) -SIZE=8 -for WEIGHT in medium bold -do - (for SLANT in r i - do - (while [ ${SIZE} -le 128 ] - do - echo -arphic-kai-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 -ar-kai-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 >> fonts.alias; - SIZE=`expr ${SIZE} + 1`; - done) # SIZE - done) # SLANT -done # WEIGHT +if [ "$CJK" = "YES" -o "$CJK" = "yes" ]; then + # There's no CJK module now. +fi -# bsmi00lp.ttf (Big5) -SIZE=8 -for WEIGHT in medium bold -do - (for SLANT in r i - do - (while [ ${SIZE} -le 128 ] - do - echo -arphic-ming-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 -ar-ming-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 >> fonts.alias; - SIZE=`expr ${SIZE} + 1`; - done) # SIZE - done) # SLANT -done # WEIGHT +if [ "$GS6" = "YES" -o "$GS6" = "yes" ]; then + for f in $FONTS; do + $TTFM --add ghostscript6 $FONTDIR/$f + done + for f in $DEFAULTMING; do + $TTFM --setdefault ghostscript6 $FONTDIR/$f + done + for f in $DEFAULTKAI; do + $TTFM --setdefault_kai ghostscript6 $FONTDIR/$f + done + echo "ghostscript6" >> $FONTDIR/$PKGNAME +fi -# gbsn00lp.ttf (GB) -SIZE=8 -for WEIGHT in medium bold -do - (for SLANT in r i - do - (while [ ${SIZE} -le 128 ] - do - echo -arphic-sung-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-gb2312.1980-0 -ar-sung-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-gb2312.1980-0 >> fonts.alias; - SIZE=`expr ${SIZE} + 1`; - done) # SIZE - done) # SLANT -done # WEIGHT +if [ "$XTT" = "YES" -o "$XTT" = "yes" ]; then + for f in $FONTS; do + $TTFM --add xttfm $FONTDIR/$f + done + for f in $DEFAULTMING; do + $TTFM --setdefault xttfm $FONTDIR/$f + done + for f in $DEFAULTKAI; do + $TTFM --setdefault_kai xttfm $FONTDIR/$f + done + echo "xttfm" >> $FONTDIR/$PKGNAME +fi -# gkai00mp.ttf (GB) -SIZE=8 -for WEIGHT in medium bold -do - (for SLANT in r i - do - (while [ ${SIZE} -le 128 ] - do - echo -arphic-kai-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-gb2312.1980-0 -ar-kai-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-gb2312.1980-0 >> fonts.alias; - SIZE=`expr ${SIZE} + 1`; - done) # SIZE - done) # SLANT -done # WEIGHT +exit 0 diff --git a/chinese/arphicttf/pkg-plist b/chinese/arphicttf/pkg-plist index c9f3509595bc..299cca314c5a 100644 --- a/chinese/arphicttf/pkg-plist +++ b/chinese/arphicttf/pkg-plist @@ -1,18 +1,19 @@ -lib/X11/fonts/TrueType/bkai00mp.ttf -lib/X11/fonts/TrueType/bsmi00lp.ttf -lib/X11/fonts/TrueType/gbsn00lp.ttf -lib/X11/fonts/TrueType/gkai00mp.ttf -lib/X11/fonts/TrueType/arphic/license/BIG5/ARPHICPL.DOC -lib/X11/fonts/TrueType/arphic/license/BIG5/ARPHICPL.TXT -lib/X11/fonts/TrueType/arphic/license/ENGLISH/ARPHICPL.DOC -lib/X11/fonts/TrueType/arphic/license/ENGLISH/ARPHICPL.TXT -lib/X11/fonts/TrueType/arphic/license/GB/ARPHICPL.DOC -lib/X11/fonts/TrueType/arphic/license/GB/ARPHICPL.TXT -lib/X11/fonts/TrueType/arphic/logo.gif -lib/X11/fonts/TrueType/arphic/release.txt -@dirrm lib/X11/fonts/TrueType/arphic/license/BIG5 -@dirrm lib/X11/fonts/TrueType/arphic/license/ENGLISH -@dirrm lib/X11/fonts/TrueType/arphic/license/GB -@dirrm lib/X11/fonts/TrueType/arphic/license -@dirrm lib/X11/fonts/TrueType/arphic -@unexec rmdir %D/lib/X11/fonts/TrueType 2>/dev/null || true +share/fonts/TrueType/bkai00mp.ttf +share/fonts/TrueType/bsmi00lp.ttf +share/fonts/TrueType/gbsn00lp.ttf +share/fonts/TrueType/gkai00mp.ttf +share/fonts/TrueType/arphic/license/BIG5/ARPHICPL.DOC +share/fonts/TrueType/arphic/license/BIG5/ARPHICPL.TXT +share/fonts/TrueType/arphic/license/ENGLISH/ARPHICPL.DOC +share/fonts/TrueType/arphic/license/ENGLISH/ARPHICPL.TXT +share/fonts/TrueType/arphic/license/GB/ARPHICPL.DOC +share/fonts/TrueType/arphic/license/GB/ARPHICPL.TXT +share/fonts/TrueType/arphic/logo.gif +share/fonts/TrueType/arphic/release.txt +@dirrm share/fonts/TrueType/arphic/license/BIG5 +@dirrm share/fonts/TrueType/arphic/license/ENGLISH +@dirrm share/fonts/TrueType/arphic/license/GB +@dirrm share/fonts/TrueType/arphic/license +@dirrm share/fonts/TrueType/arphic +@unexec rmdir %D/share/fonts/TrueType 2>/dev/null || true +@unexec rmdir %D/share/fonts 2>/dev/null || true |