diff options
author | minskim <minskim@pkgsrc.org> | 2009-03-06 18:12:59 +0000 |
---|---|---|
committer | minskim <minskim@pkgsrc.org> | 2009-03-06 18:12:59 +0000 |
commit | e2959389e18b2e49f76a00ca50c0231aa59888d2 (patch) | |
tree | 592e0a71c90e19240c94967cbc6565714a80570a /print/texlive-tetex | |
parent | 2c349e7c0efd0465ca6b8af8ee1fa270f8857290 (diff) | |
download | pkgsrc-e2959389e18b2e49f76a00ca50c0231aa59888d2.tar.gz |
Add a Makefile fragment and templates to install/deinstall hyphenation
patterns.
Diffstat (limited to 'print/texlive-tetex')
-rw-r--r-- | print/texlive-tetex/files/hyphen-deinstall.tmpl | 26 | ||||
-rw-r--r-- | print/texlive-tetex/files/hyphen-install.tmpl | 43 | ||||
-rw-r--r-- | print/texlive-tetex/hyphen.mk | 26 |
3 files changed, 95 insertions, 0 deletions
diff --git a/print/texlive-tetex/files/hyphen-deinstall.tmpl b/print/texlive-tetex/files/hyphen-deinstall.tmpl new file mode 100644 index 00000000000..facce89078f --- /dev/null +++ b/print/texlive-tetex/files/hyphen-deinstall.tmpl @@ -0,0 +1,26 @@ +# $NetBSD: hyphen-deinstall.tmpl,v 1.1 2009/03/06 18:13:00 minskim Exp $ +# +# Deinstall hyphenation patterns. +# + +LANGUAGE_DAT=${PKG_SYSCONFBASE}/texmf/tex/generic/config/language.dat +LANGUAGE_DEF=${PKG_SYSCONFBASE}/texmf/tex/generic/config/language.def + +case ${STAGE} in +DEINSTALL) + ${AWK} "\ +BEGIN { do_print=1; } \ +/^%%% BEGIN @PKGBASE@\$/ { do_print=0; } \ +{ if (do_print) print \$0; } \ +/^%%% END @PKGBASE@\$/ { do_print=1; }" ${LANGUAGE_DAT} > ${LANGUAGE_DAT}.tmp && + ${MV} ${LANGUAGE_DAT}.tmp ${LANGUAGE_DAT} + ${AWK} "\ +BEGIN { do_print=1; } \ +/^%%% BEGIN @PKGBASE@\$/ { do_print=0; } \ +{ if (do_print) print \$0; } \ +/^%%% END @PKGBASE@\$/ { do_print=1; }" ${LANGUAGE_DEF} > ${LANGUAGE_DEF}.tmp && + ${MV} ${LANGUAGE_DEF}.tmp ${LANGUAGE_DEF} + ;; +*) + ;; +esac diff --git a/print/texlive-tetex/files/hyphen-install.tmpl b/print/texlive-tetex/files/hyphen-install.tmpl new file mode 100644 index 00000000000..7dc873be725 --- /dev/null +++ b/print/texlive-tetex/files/hyphen-install.tmpl @@ -0,0 +1,43 @@ +# $NetBSD: hyphen-install.tmpl,v 1.1 2009/03/06 18:13:00 minskim Exp $ +# +# Install hyphenation patterns. +# + +LANGUAGE_DAT=${PKG_SYSCONFBASE}/texmf/tex/generic/config/language.dat +LANGUAGE_DEF=${PKG_SYSCONFBASE}/texmf/tex/generic/config/language.def + +case ${STAGE} in +POST-INSTALL) + hyphen_dat="@HYPHEN_DAT@" + set -- dummy $hyphen_dat; shift; + ${ECHO} "%%% BEGIN @PKGBASE@" >> ${LANGUAGE_DAT} + while ${TEST} $# -gt 0; do + cmd="$1"; arg="$2" + shift; shift + if ${TEST} $cmd = "="; then + ${ECHO} "$cmd$arg" >> ${LANGUAGE_DAT} + else + ${ECHO} "$cmd $arg" >> ${LANGUAGE_DAT} + fi + done + ${ECHO} "%%% END @PKGBASE@" >> ${LANGUAGE_DAT} + @FMTUTIL_SYS@ --byhyphen ${LANGUAGE_DAT} + hyphen_def="@HYPHEN_DEF@" + ${AWK} "\ +BEGIN { f=\"${LANGUAGE_DEF}.tmp\"; } \ +/^%%% No changes/ { f=\"${LANGUAGE_DEF}.post\"; } \ +{ print>f; }" ${LANGUAGE_DEF} && + set -- dummy $hyphen_def; shift; + ${ECHO} "%%% BEGIN @PKGBASE@" >> ${LANGUAGE_DEF}.tmp + for line in $hyphen_def ; do + echo "${line}" >> ${LANGUAGE_DEF}.tmp + done + ${ECHO} "%%% END @PKGBASE@" >> ${LANGUAGE_DEF}.tmp + ${CAT} ${LANGUAGE_DEF}.post >> ${LANGUAGE_DEF}.tmp + ${RM} ${LANGUAGE_DEF}.post + ${MV} ${LANGUAGE_DEF}.tmp ${LANGUAGE_DEF} + @FMTUTIL_SYS@ --byhyphen ${LANGUAGE_DEF} + ;; +*) + ;; +esac diff --git a/print/texlive-tetex/hyphen.mk b/print/texlive-tetex/hyphen.mk new file mode 100644 index 00000000000..83ec7cba87d --- /dev/null +++ b/print/texlive-tetex/hyphen.mk @@ -0,0 +1,26 @@ +# $NetBSD: hyphen.mk,v 1.1 2009/03/06 18:12:59 minskim Exp $ +# +# This Makefile fragment is intended to be included by packages that +# install TeX hyphenation pattens. It updates format files at +# (de)installation time. +# +# The following variable can be defined: +# +# TEX_HYPHEN_DAT - A list of hyphenation entries for language.dat. +# TEX_HYPHEN_DEF - A list of hyphenation entries for language.def. +# + +.if !defined(TEX_HYPHEN_MK) +TEX_HYPHEN_MK= # defined + +DEPENDS+= texlive-tetex>=2008:../../print/texlive-tetex +DEPENDS+= tex-hyphen-base-[0-9]*:../../print/tex-hyphen-base + +EVAL_PREFIX+= TETEX_PREFIX=texlive-tetex +FILES_SUBST+= FMTUTIL_SYS=${TETEX_PREFIX:Q}/bin/fmtutil-sys +FILES_SUBST+= HYPHEN_DAT=${TEX_HYPHEN_DAT:Q} +FILES_SUBST+= HYPHEN_DEF=${TEX_HYPHEN_DEF:Q} +INSTALL_TEMPLATES+= ../../print/texlive-tetex/files/hyphen-install.tmpl +DEINSTALL_TEMPLATES+= ../../print/texlive-tetex/files/hyphen-deinstall.tmpl + +.endif # TEX_HYPHEN_MK |