summaryrefslogtreecommitdiff
path: root/japanese/jtex209-both/files/ascii-setup.sh
blob: c99d0fc57a235bed7858017630da1dc6801278d2 (plain) (blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
# ascii-setup ${FILESDIR} ${DISTDIR} [BATCH]
if [ "$3" = "BATCH" ] ; then
        BATCH=yes
fi

if [ "${BATCH}" = "yes" ]; then
        CHOICE=default
else
	echo "Setup for ASCII pTeX"
	echo "Select kanji code on ASCII pTeX."
	echo "1. EUC (default)"
	echo "2. SJIS"
	read CHOICE
fi
case ${CHOICE} in
	2)
	echo "SJIS" ;
	echo 
	KANJI="SJIS"
	;;
	*)
	echo "EUC"
	echo 
	KANJI="EUC"
	;;
esac

if [ "$BATCH" = "yes" ]; then
        CHOICE=default
else
	echo "Select memory model of ASCII pTeX."
	echo "1. Big (default)"
	echo "2. Small"
	read CHOICE
fi
case ${CHOICE} in
	2)
	echo "Small" ;
	echo 
	MEMORY="small"
	;;
	*)
	echo "Big"
	echo 
	MEMORY="big"
	;;
esac

cd jtex1.7

if  [ "${KANJI}" = "EUC" ] ; then
	./EUCsetup
fi

cd ptex/ptex

if  [ "${KANJI}" = "EUC" ] && [ "${MEMORY}" = "big" ] ; then 
	cp texdir/pctex.ch.euc.big texdir/pctex.ch
elif  [ "${KANJI}" = "EUC" ] && [ "${MEMORY}" = "small" ] ; then 
	cp texdir/pctex.ch.euc.small texdir/pctex.ch
elif  [ "${KANJI}" = "SJIS" ] && [ "${MEMORY}" = "big" ] ; then 
	cp texdir/pctex.ch.sj.big texdir/pctex.ch
elif  [ "${KANJI}" = "SJIS" ] && [ "${MEMORY}" = "small" ] ; then
	cp texdir/pctex.ch.sj.small texdir/pctex.ch
fi

if  [ "${KANJI}" = "EUC" ] ; then
mv site.h site.h.orig
cat site.h.orig | sed -e "s/#define	SJIS/#undef	SJIS/g" | \
	sed -e "s/#undef	EUC/#define	EUC/g" > site.h
fi

cp $2/pTeX-JIS-patch .
patch < $1/pTeX-JIS-patch.of.patch
patch -p < pTeX-JIS-patch
mv site.h site.h.orig
cat site.h.orig | sed -e "s/#undef	JIS/#define	JIS/g" > site.h

if [ ! -d /usr/local/bin ] ; \
	then mkdir /usr/local/bin ; fi
if [ ! -d /usr/local/share ] ; \
	then mkdir /usr/local/share ; fi
if [ ! -d /usr/local/share/tex ] ; \
	then mkdir /usr/local/share/tex ; fi
if [ ! -d /usr/local/share/tex/fonts ] ; \
	then mkdir /usr/local/share/tex/fonts ; fi
if [ ! -d /usr/local/share/tex/jfonts ] ; \
	then mkdir /usr/local/share/tex/jfonts ; fi
if [ ! -d /usr/local/share/tex/jfonts/mincho ] ; \
	then mkdir /usr/local/share/tex/jfonts/jfms ; fi
if [ ! -d /usr/local/share/tex/ainputs ] ; \
	then mkdir /usr/local/share/tex/ainputs ; fi
if [ ! -d /usr/local/share/tex/aformats ] ; \
	then mkdir /usr/local/share/tex/aformats ; fi
if [ ! -d /usr/local/share/tex/apool ] ; \
	then mkdir /usr/local/share/tex/apool ; fi
if [ ! -d /usr/local/share/tex/inputs ] ; \
	then mkdir /usr/local/share/tex/inputs ; fi