File: jisftconfig

package info (click to toggle)
ptex-jisfonts 2-21
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 240 kB
  • ctags: 7
  • sloc: sh: 176; makefile: 74
file content (85 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download | duplicates (3)
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
85
#!/bin/sh -e

map=/etc/texmf/vfontmap
cfg=/etc/texmf/dvipsj/config.ps

checkinstalled ()
{
	echo "Checking $1 package..."
	dpkg -s $1 2>/dev/null| grep '^Status:' | grep 'ok installed' > /dev/null
}

checkversion ()
{
	dpkg -s $1 | grep '^Version:' | cut -d: -f2
}

case "$1" in
add)
	echo "Check DVI-ware which you've installed"

	if checkinstalled dvipsk-ja ; then
		dvipsk_ja_v=`checkversion dvipsk-ja`
		echo "dvipsk-ja (${dvipsk_ja_v} ) .... installed"
		dvipsk_ja=installed
	fi

	if checkinstalled xdvik-ja ; then
		xdvik_ja_v=`checkversion xdvik-ja`
		echo "xdvik-ja (${xdvik_ja_v} ) .... installed"
		xdvik_ja=installed
	fi

# for vfontmap (xdvik-ja)
	if [ -f "${map}" ] && [ ${xdvik_ja:-0} = "installed" ] && \
	dpkg --compare-versions ${xdvik_ja_v} lt 22.40s-j1.12-0.1; then
		# version 22.40s-j1.12-0.1 or later supports jisfonts
		# without special settings
		if ! grep -q "#-- ptex-jisfonts begin" ${map}; then
		cp -f ${map} ${map}_giro
		sed -e '$a\
#-- ptex-jisfonts begin\
jis	min\
jisg	goth\
#-- ptex-jisfonts end' < ${map} > ${map}_$$
		mv -f ${map}_$$ ${map}
		fi
	fi

# for config.ps (dvipsk-ja)
	if [ -f ${cfg} ] && [ ${dvipsk_ja:-0} = "installed" ] ; then
		if ! grep -q "%-- ptex-jisfonts begin" ${cfg}; then
		cp -f ${cfg} ${cfg}_giro
		sed -e '$a\
%-- ptex-jisfonts begin\
p +jis.map\
%-- ptex-jisfonts end' < ${cfg} > ${cfg}_$$ && \
		mv -f ${cfg}_$$ ${cfg}
		fi
	fi

;;

clean)
	rm -f ${map}_giro
	rm -f ${cfg}_giro
;;

remove)
	if [ -f "${map}" ] ; then
		sed -e '/#-- ptex-jisfonts begin/,/#-- ptex-jisfonts end/d' < \
		${map} > ${map}_$$ && mv -f ${map}_$$ ${map}
	fi

	if [ -f ${cfg} ] ; then
		sed -e '/%-- ptex-jisfonts begin/,/%-- ptex-jisfonts end/d' < \
		${cfg} > ${cfg}_$$ && mv -f ${cfg}_$$ ${cfg}
	fi

;;

*)
	echo "Usage: jisftconfig add | remove | clean"
	echo "$0 is called with wrong options"
;;
esac