summaryrefslogtreecommitdiff
blob: db6ea04c1d9d26468a869d7296d3df15679ab3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
#
# Utility to update Gentoo TeXLive distribution configuration files
#

echo "Configuring TeXLive ..."

PATH=/bin:/usr/bin

# Fix for all those with altered umask for root
umask 022

# Make sure we have a correct environment, bug #30432
# The list of env. vars is taken from the INSTALL file
for texvar in AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS \
	DVIPSHEADERS GFFONTS GLYPHFONTS INDEXSTYLE MFBASES MFINPUTS \
	MFPOOL MFTINPUTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS \
	OFMFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PKFONTS PSHEADERS \
	T1FONTS T1INPUTS TEXBIB TEXCONFIG TEXDOCS TEXFONTMAPS TEXFONTS \
	TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF TEXMFDBS TEXMFINI \
	TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS TEXSOURCES TFMFONTS TRFONTS \
	VFFONTS XDVIFONTS XDVIVFS ; do

	if [ "${!texvar}" ]; then
		if ! $(echo ${!texvar} | grep '^:\|::\|:$' &>/dev/null) ; then
			export ${texvar}="${!texvar}:"
		fi
	fi
done

if [ "$TEXINPUTS" ]; then
	if $(echo ${TEXINPUTS} | grep '/usr/share/texmf' &>/dev/null) ; then
		export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/usr/share/texmf/*:\?||g')
	elif $(echo ${TEXINPUTS} | grep '/var/lib/texmf' &>/dev/null) ; then
		export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/var/lib/texmf/*:\?||g')
	fi
fi

if [ -d /etc/texmf/texmf.d ]; then
    echo "Generating /etc/texmf/web2c/texmf.cnf from /etc/texmf/texmf.d ..."
    cat /etc/texmf/texmf.d/*.cnf > "/etc/texmf/web2c/texmf.cnf"
fi

if [ -d /etc/texmf/fmtutil.d ]; then
    echo "Generating /etc/texmf/web2c/fmtutil.cnf from /etc/texmf/fmtutil.d ..."
    cat /etc/texmf/fmtutil.d/*.cnf > "/etc/texmf/web2c/fmtutil.cnf"
fi

if [ -d /etc/texmf/updmap.d ]; then
    echo "Generating /etc/texmf/web2c/updmap.cfg from /etc/texmf/updmap.d ..."
    cat /etc/texmf/updmap.d/*.cfg > "/etc/texmf/web2c/updmap.cfg"
fi

echo "Generating ls-R files"
mktexlsr &>/dev/null

# Generate language.dat file, from texlive install-pkg.sh
X=`kpsewhich language.dat`
if test -n "$X"; then
    echo "Generating language.dat file"
    cd `dirname $X`
    Z=`pwd`

    Y=`kpsewhich language.us`
    cd `dirname $Y`
    cat language.us > $Z/language.dat
    for i in language.*.dat; do
            test -f $i && cat $i >> $Z/language.dat
    done
fi

echo "Generating format files ..."
fmtutil-sys --all &>/dev/null

echo "Generating font maps..."
updmap-sys &>/dev/null

texconfig-sys confall &>/dev/null
texconfig-sys font rw &>/dev/null
texconfig-sys font vardir /var/cache/fonts &>/dev/null

echo
echo "Use 'texconfig font ro' to disable font generation for users"
echo