diff --git a/cygclass/texlive.cygclass b/cygclass/texlive.cygclass index b27ab9a..fcd4648 100644 --- a/cygclass/texlive.cygclass +++ b/cygclass/texlive.cygclass @@ -104,7 +104,10 @@ SRC_DIR="." # Installs the TeX Live package file(s) into their respective locations. #**** texlive_install() { - local f pkg pkgs tlpobj dst src + local f pkg pkgs tlpobj dst src fmt map + + __config_set texlive_fmts + __config_set texlive_maps for pkg in ${TEXLIVE_TEXMF_PKGS} do @@ -168,6 +171,18 @@ texlive_install() { dodir /usr/share/${dst%/*} __doinstall ${perm} $src /usr/share/${dst%/*} done + + for fmt in $(grep -E 'execute AddFormat' $tlpobj \ + | sed 's/.* name=\([^ ]*\).*/\1/g') + do + __config_set texlive_fmts "$(__config_get texlive_fmts) $fmt" + done + + for map in $(grep -E 'execute add[^ ]*Map' $tlpobj \ + | sed 's/execute add\([^ ]*\) */\1=/g') + do + __config_set texlive_maps "$(__config_get texlive_maps) $map" + done done } diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart index aa26c15..ae83de4 100644 --- a/lib/src_postinst.cygpart +++ b/lib/src_postinst.cygpart @@ -261,24 +261,60 @@ __prep_mateconf_schemas() { } __prep_texlive() { - dodir /etc/postinstall + local d fmt fmts map maps + + dodir /etc/postinstall /etc/preremove + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF - if [ -x /usr/bin/mktexlsr ] && \\ - [ ! -f /usr/share/texmf-dist/ls-R -o \\ - \$(find /usr/share/texmf{,-dist} -mindepth 2 -type f -cnewer /usr/share/texmf-dist/ls-R 2>/dev/null | wc -l) -gt 0 ] + /usr/bin/mktexlsr + _EOF + + fmts=$(__config_get texlive_fmts) + maps=$(__config_get texlive_maps) + + if [ -n "${maps#0}" ] + then + for map in $maps + do + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF + /usr/bin/updmap-sys --nohash --nomkmap --enable $map + _EOF + cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF + /usr/bin/updmap-sys --nohash --nomkmap --disable ${map#*=} + _EOF + done + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF + /usr/bin/updmap-sys --nohash --syncwithtrees + /usr/bin/updmap-sys --nohash + /usr/bin/mktexlsr + _EOF + fi + if [ -n "${fmts#0}" ] + then + for fmt in $fmts + do + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF + /usr/bin/fmtutil-sys --enablefmt $fmt + /usr/bin/fmtutil-sys --byfmt $fmt + _EOF + cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF + /usr/bin/fmtutil-sys --disablefmt $fmt + _EOF + done + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF + /usr/bin/mktexlsr + _EOF + fi + + for d in /usr/share/texmf{-dist,}/fonts/{opentype,truetype,type1} + do + if [ -d ${D}${d} ] then - /usr/bin/mktexlsr - if test -f /etc/texmf/web2c/updmap.cfg; then - /usr/bin/sed -i -e 's/^#! //g' /etc/texmf/web2c/updmap.cfg - fi - /usr/bin/updmap-sys --syncwithtrees - /usr/bin/updmap-sys --nohash - /usr/bin/mktexlsr - /usr/bin/fmtutil-sys --all - /usr/bin/mktexlsr + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF + /usr/bin/fc-cache -f $d + _EOF fi - - _EOF + done } # end of conditional __prepetc helpers