summaryrefslogtreecommitdiff
path: root/chinese/ttfm
diff options
context:
space:
mode:
authorYen-Ming Lee <leeym@FreeBSD.org>2005-02-19 13:51:50 +0000
committerYen-Ming Lee <leeym@FreeBSD.org>2005-02-19 13:51:50 +0000
commitaadd0f3a5f2ad007d555aacb1928190b7589aaaf (patch)
tree104a3c7a9e42ff9be3b7e0939521876cfb8f9126 /chinese/ttfm
parentAccount for src/include/stdbool.h and src/sys/i386/include/_types.h have (diff)
- add chinese/Makefile.ttf to control install/deinstall process of all
TrueType fonts in chinese/*ttf - update related Makefile(s) and remove pkg-{install,pkg-deinstall,pkg-plist} - relocate non-font files to DATADIR or DOCSDIR - fix "unable to reomve fonts from gscjk" problem in ttfm.sh and gscjk.ttfm - update chinese/zh-fireflyttf to 1.2.6 [1] PR: [1] 77438 Submitted by: leeym Approved by: statue at freebsd.sinica.edu.tw
Notes
Notes: svn path=/head/; revision=129283
Diffstat (limited to 'chinese/ttfm')
-rw-r--r--chinese/ttfm/Makefile8
-rw-r--r--chinese/ttfm/Makefile.ttf91
-rw-r--r--chinese/ttfm/files/patch-modules::gscjk.ttfm23
-rw-r--r--chinese/ttfm/files/patch-ttfm.sh11
-rw-r--r--chinese/ttfm/pkg-plist5
5 files changed, 128 insertions, 10 deletions
diff --git a/chinese/ttfm/Makefile b/chinese/ttfm/Makefile
index 4664bb34bd78..e76a77955e8b 100644
--- a/chinese/ttfm/Makefile
+++ b/chinese/ttfm/Makefile
@@ -16,14 +16,15 @@ COMMENT= A Big5/GB enhanced TrueType Font Manager
RUN_DEPENDS= mkfontdir:${X_CLIENTS_PORT}
LIB_DEPENDS= freetype.9:${PORTSDIR}/print/freetype2
-FONTSDIR= ${PREFIX}/share/fonts/TrueType/
+PORTDOCS= README USAGE
+MAN1= ttfm.sh.1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/ttfinfo ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/ttfm.sh ${PREFIX}/bin
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
-.for doc in README USAGE
+.for doc in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
.endfor
.endif
@@ -32,8 +33,5 @@ do-install:
.for module in gscjk.ttfm xttfm.ttfm
${INSTALL_SCRIPT} ${WRKSRC}/modules/${module} ${DATADIR}
.endfor
- @${MKDIR} ${FONTSDIR}
-
-MAN1= ttfm.sh.1
.include <bsd.port.mk>
diff --git a/chinese/ttfm/Makefile.ttf b/chinese/ttfm/Makefile.ttf
new file mode 100644
index 000000000000..00eda812348e
--- /dev/null
+++ b/chinese/ttfm/Makefile.ttf
@@ -0,0 +1,91 @@
+# makefile for use of: chinese/*ttf
+# Date created: 17 Feb 2005
+# Whom: leeym
+#
+# $FreeBSD$
+#
+# The variable(s) for installing TrueType fonts.
+# TTF - Name(s) of font file(s) installed in FONTSDIR. Mandatory.
+#
+# The variable(s) to change the behavior of installing TrueType fonts.
+# WITH_GS - Add Ghostscript support
+# WITHOUT_X11 - Remove X Window support
+#
+
+FONTSDIR?= ${PREFIX}/share/fonts/TrueType
+FONTSDIR_REL= ${FONTSDIR:S,^${PREFIX}/,,}
+PLIST_SUB+= FONTSDIR=${FONTSDIR_REL}
+
+XFONTSDIR?= ${X11BASE}/lib/X11/fonts/TrueType
+XFONTSDIR_REL= ${XFONTSDIR:S,${X11BASE}/,,}
+PLIST_SUB+= XFONTSDIR=${XFONTSDIR_REL}
+
+.if !defined(WITHOUT_X11)
+RUN_DEPENDS+= ${X11BASE}/bin/fc-cache:${PORTSDIR}/x11-fonts/fontconfig
+_TTF_MODULES= xttfm
+.endif
+
+.if defined(WITH_GS)
+RUN_DEPENDS+= ${LOCALBASE}/share/ghostscript/Resource/ai0/CMap/Identity-H:${PORTSDIR}/print/adobe-cmaps
+_TTF_MODULES+= gscjk
+.endif
+
+.if defined(_TTF_MODULES)
+RUN_DEPENDS+= ${PREFIX}/bin/ttfm.sh:${PORTSDIR}/chinese/ttfm
+.endif
+
+check-makefile: check-makefile-ttf
+check-makefile-ttf:
+.if !defined(_TTF_MODULES)
+ @${ECHO_CMD} "Makefile warning: You choose neither X11 nor GS. Only font files themselves are installed"
+.else
+ @${ECHO_CMD} ""
+ @${ECHO_CMD} "You may use the following options:"
+ @${ECHO_CMD} " WITH_GS - if you want Ghostscript support"
+ @${ECHO_CMD} " WITHOUT_X11 - if you DON'T want X Window support"
+ @${ECHO_CMD} ""
+.endif
+.if !defined(TTF)
+ @${ECHO_CMD} "Makefile error: You need to define TTF for installing TrueType fonts"
+ @${FALSE}
+.endif
+
+post-install: do-install-ttf
+do-install-ttf:
+.if defined(_TTF_MODULES)
+ @${ECHO_MSG} "===> Running ttfm.sh"
+.endif
+.for module in ${_TTF_MODULES}
+. for ttf in ${TTF}
+ ${PREFIX}/bin/ttfm.sh --add ${module} ${FONTSDIR}/${ttf}
+. endfor
+.endfor
+.if !defined(WITHOUT_X11)
+ @${ECHO_MSG} "===> Running fc-cache"
+ -@${X11BASE}/bin/fc-cache -f -v ${XFONTSDIR}
+.endif
+
+add-plist-post: add-plist-ttf
+add-plist-ttf:
+.for module in ${_TTF_MODULES}
+. for ttf in ${TTF}
+ @${ECHO_CMD} "@unexec %D/bin/ttfm.sh --remove ${module} ${FONTSDIR}/${ttf} || true" >> ${TMPPLIST}
+. endfor
+.endfor
+.for ttf in ${TTF}
+ @${ECHO_CMD} "${FONTSDIR_REL}/${ttf}" >> ${TMPPLIST}
+.endfor
+.for module in ${_TTF_MODULES}
+. for ttf in ${TTF}
+ @${ECHO_CMD} "@exec %D/bin/ttfm.sh --add ${module} ${FONTSDIR}/${ttf} || true" >> ${TMPPLIST}
+. endfor
+.endfor
+.if !defined(WITHOUT_X11)
+ @${ECHO_CMD} "@unexec ${X11BASE}/bin/fc-cache -f -v ${XFONTSDIR} || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@exec ${X11BASE}/bin/fc-cache -f -v ${XFONTSDIR} || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec find ${XFONTSDIR} -size -3c -delete || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir ${XFONTSDIR} 2>/dev/null || true" >> ${TMPPLIST}
+.endif
+ @${ECHO_CMD} "@unexec rmdir ${FONTSDIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/share/fonts 2>/dev/null || true" >> ${TMPPLIST}
+
diff --git a/chinese/ttfm/files/patch-modules::gscjk.ttfm b/chinese/ttfm/files/patch-modules::gscjk.ttfm
new file mode 100644
index 000000000000..3f326593323a
--- /dev/null
+++ b/chinese/ttfm/files/patch-modules::gscjk.ttfm
@@ -0,0 +1,23 @@
+--- modules/gscjk.ttfm.orig Wed Sep 24 17:51:46 2003
++++ modules/gscjk.ttfm Sat Feb 19 09:14:28 2005
+@@ -148,9 +148,8 @@
+ remove_fonts()
+ {
+ for f in "$@"; do
+- targetname=`basename $f`
+-
+- rm -f ${CJKCIDPath}/${targetname} ${CJKFontPath}/${targetname}*
++ guess_ttf_info "$f"
++ rm -f ${CJKCIDPath}/${TTF_ALIAS}* ${CJKFontPath}/${TTF_ALIAS}*
+ done
+ }
+
+@@ -236,7 +235,7 @@
+ # else
+ # TTF_ALIAS=${TTFINFO_FOUNDRY_NAME}"`echo $TTFINFO_FONT_NAME |sed -e "s/ //g"`"
+ # fi
+- TTF_ALIAS=$TTFINFO_FONT_PSNAME
++ TTF_ALIAS=`echo $TTFINFO_FONT_PSNAME | sed -e "s/ //g"`
+
+ # case "$fontweight" in
+ # 'bold')
diff --git a/chinese/ttfm/files/patch-ttfm.sh b/chinese/ttfm/files/patch-ttfm.sh
new file mode 100644
index 000000000000..cf6e19780eab
--- /dev/null
+++ b/chinese/ttfm/files/patch-ttfm.sh
@@ -0,0 +1,11 @@
+--- ttfm.sh.orig Wed Jan 31 17:34:46 2001
++++ ttfm.sh Sat Feb 19 09:14:56 2005
+@@ -258,7 +258,7 @@
+ # Call script with --remove
+ for i in "$INSTALLSCRIPT"; do
+ if [ -x "$i" ] ; then
+- $i --remove "$FONTFILENAME" || {
++ $i --remove "${DefaultFontPath}/$FONTFILENAME" || {
+ echo "Error in running $i to remove $DefaultFontPath/$FONTFILENAME." > /dev/stderr
+ }
+ else
diff --git a/chinese/ttfm/pkg-plist b/chinese/ttfm/pkg-plist
index f5aae51f4f2d..af5050040277 100644
--- a/chinese/ttfm/pkg-plist
+++ b/chinese/ttfm/pkg-plist
@@ -1,10 +1,5 @@
bin/ttfinfo
bin/ttfm.sh
-%%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%%%DOCSDIR%%/USAGE
%%DATADIR%%/gscjk.ttfm
%%DATADIR%%/xttfm.ttfm
@dirrm %%DATADIR%%
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@unexec rmdir %D/share/fonts/TrueType 2>/dev/null || true
-@unexec rmdir %D/share/fonts 2>/dev/null || true