forked from shirok/Gauche
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDIST
executable file
·187 lines (173 loc) · 6.75 KB
/
DIST
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/sh
TGZ_DEST="$HOME/shiro.dreamhost.com/scheme/vault/"
MAN_DEST="$HOME/shiro.dreamhost.com/scheme/gauche/man/"
DOC_DEST="../test"
RPMDIR="$HOME/rpm"
CHANGELOG_DEST="$HOME/shiro.dreamhost.com/scheme/gauche/ChangeLog.txt"
XTRA_TEST_DIR="$HOME/src/test"
while [ $# -gt 0 ]; do
case $1 in
gen) gen=yes; shift ;;
doc) doc=yes; shift ;;
docs) doc=yes; docs=yes; shift ;;
tgz) tgz=yes; shift ;;
test) test=yes; shift ;;
testcode) testcode=yes; shift ;;
testclean) testclean=yes; shift ;;
rpm) rpm=yes; shift;;
rpmfiles) rpmfiles=yes; shift;;
*) echo "DIST [doc][docs][tgz][test][testclean][rpm][rpmfiles]"; exit 0;;
esac
done
if [ "$gen" = "yes" ]; then
autoconf
(cd gc; autoconf)
fi
if [ "$tgz" = "yes" ]; then
if [ -f Makefile ]; then make maintainer-clean; fi
if [ -f examples/spigot/Makefile ]; then
(cd examples/spigot; make maintainer-clean);
fi
autoconf
(cd gc; autoconf)
./configure --enable-threads=pthreads -C || exit 1
(cd src; for stub in *.stub; do make `echo $stub | sed 's/\.stub/.c/'` ; done) || exit 1
(cd src; make autoloads.c) || exit 1
(cd src; make builtin-syms.c) || exit 1
(cd ext/charconv/; make GOSH=gosh eucj2ucs.c) || exit 1
(cd ext/charconv/; make GOSH=gosh guess_tab.c) || exit 1
(cd ext/charconv/data; make GOSH=gosh) || exit 1
(cd doc; make GOSH=gosh texi) || exit 1
make distclean || exit 1
if [ ! -f VERSION ]; then echo "No VERSION; something wrong?"; exit 1; fi
VERSION=`cat VERSION`
rm -rf ../Gauche-$VERSION
rm -f DIST_EXCLUDE_X
cat DIST_EXCLUDE > DIST_EXCLUDE_X
find . -name CVS -print -prune >> DIST_EXCLUDE_X
escm -i gosh -o INSTALL INSTALL.esc
LANG=ja_JP escm -i gosh -o INSTALL.eucjp INSTALL.esc
mkdir ../Gauche-$VERSION
tar cvfX - DIST_EXCLUDE_X . | (cd ../Gauche-$VERSION; tar xf -)
(cd ..; tar cvf - Gauche-$VERSION | gzip -9 > Gauche-$VERSION.tgz)
rm -rf ../Gauche-$VERSION
# if [ -d $TGZ_DEST ]; then
# mv ../Gauche-$VERSION.tgz $TGZ_DEST
# cp ChangeLog $CHANGELOG_DEST
# fi
fi
if [ "$doc" = "yes" ]; then
(cd doc; make texi)
for lang in j e; do
rm -rf $DOC_DEST/gauche-ref$lang
mkdir $DOC_DEST/gauche-ref$lang
cp doc/*.texi doc/Makefile doc/extract $DOC_DEST/gauche-ref$lang/
(cd $DOC_DEST/gauche-ref$lang; make gauche-ref${lang}_toc.html; rm -f *.texi extract Makefile)
done
fi
if [ "$docs" = "yes" ]; then
rm -rf $MAN_DEST
mkdir $MAN_DEST
for lang in j e; do
(cd doc; make gauche-ref$lang.html; gzip gauche-ref$lang.html; mv gauche-ref$lang.html.gz $TGZ_DEST)
(cd $DOC_DEST; tar czf $TGZ_DEST/gauche-ref$lang.tgz gauche-ref$lang)
cp $DOC_DEST/gauche-ref$lang/* $MAN_DEST
done
fi
if [ "$test" = "yes" ]; then
if [ ! -f VERSION ]; then echo "No VERSION; do DIST tgz first"; exit 1; fi
VERSION=`cat VERSION`
if [ ! -f ../Gauche-$VERSION.tgz ]; then echo "No tarball; do DIST tgz first"; exit 1; fi
mkdir -p ../test
rm -rf ../test/Gauche-$VERSION ../test/test-inst
cd ../test
mkdir -p test-inst
tar xzvf ../Gauche-$VERSION.tgz
cd Gauche-$VERSION
./configure --enable-threads=pthreads --prefix=`pwd`/../test-inst
make
make -s test
make install
make install-check
cd ..
testgosh=`pwd`/test-inst/bin/gosh
if [ -f $XTRA_TEST_DIR/r4rstest/r4rstest.scm ]; then
(cd $XTRA_TEST_DIR/r4rstest/ && make GOSH=$testgosh test)
fi
fi
if [ "$testcode" = "yes" ]; then
if [ ! -f VERSION ]; then echo "No VERSION; do DIST tgz first"; exit 1; fi
VERSION=`cat VERSION`
if [ ! -f ../Gauche-$VERSION.tgz ]; then echo "No tarball; do DIST tgz first"; exit 1; fi
mkdir -p ../test
rm -rf ../test/Gauche-$VERSION
cd ../test
tar xzvf ../Gauche-$VERSION.tgz >& /dev/null
cd Gauche-$VERSION
rm -f testcode.log
echo "EUC-JP ----------------------------------------------------"
./configure -C --enable-threads=pthreads --enable-multibyte=euc-jp >> testcode.log 2>&1
make -s >> testcode.log 2>&1
make -s test
make -s distclean
echo "UTF-8 -----------------------------------------------------"
./configure -C --enable-threads=pthreads --enable-multibyte=utf-8 >> testcode.log 2>&1
make -s >> testcode.log 2>&1
make -s test
make -s distclean
echo "SJIS ------------------------------------------------------"
./configure -C --enable-threads=pthreads --enable-multibyte=sjis >> testcode.log 2>&1
make -s >> testcode.log 2>&1
make -s test
make -s distclean
echo "NONE ------------------------------------------------------"
./configure -C --enable-threads=pthreads --enable-multibyte=none >> testcode.log 2>&1
make -s >> testcode.log 2>&1
make -s test
fi
if [ "$testclean" = "yes" ]; then
rm -rf ../test/Gauche ../test/test-inst
rm -rf ../test/test.log ../test/temp.o ../test/tmp1.o
if [ -f VERSION ]; then rm -rf ../test/Gauche-`cat VERSION`; fi
fi
if [ "$rpmfiles" = "yes" ]; then
# NB: you should be careful to run this _before_ installing any
# additional Gauche packages.
rm -f rpmfiles-common.txt rpmfiles-encoding.txt rpmfiles-gdbm.txt
if [ ! -f VERSION ]; then echo "No VERSION; do DIST tgz first"; exit 1; fi
VERSION=`cat VERSION`
find /usr/share/gauche/$VERSION -type f -print | grep -v 'dbm/[ong]dbm' > rpmfiles-common.txt
find /usr/share/gauche/$VERSION -type f -print | grep 'dbm/[ong]dbm' > rpmfiles-gdbm.txt
find /usr/lib/gauche/$VERSION -type f -print | grep -v '/[ong]dbm' > rpmfiles-encoding.txt
find /usr/lib/gauche/$VERSION -type f -print | grep '/[ong]dbm' >> rpmfiles-gdbm.txt
fi
if [ "$rpm" = "yes" ]; then
if [ ! -f VERSION ]; then echo "No VERSION; do DIST tgz first"; exit 1; fi
VERSION=`cat VERSION`
if [ ! -f ../Gauche-$VERSION.tgz ]; then echo "No tarball; do DIST tgz first"; exit 1; fi
rm -f $RPMDIR/SOURCES/Gauche-$VERSION.tgz
cp ../Gauche-$VERSION.tgz $RPMDIR/SOURCES/
spec=$RPMDIR/SPECS/Gauche.spec
# echo "UTF8, i386 ----------------------------------------------"
# rm -f $spec
# cat Gauche.spec | sed 's/%define encoding .*/%define encoding utf8/' > $spec
# rpm -bb --clean $spec
echo "UTF8, i686 ----------------------------------------------"
rm -f $spec
cat Gauche.spec | sed 's/%define encoding .*/%define encoding utf8/' > $spec
rpmbuild -bb --clean --target i686 $spec
# echo "EUC, i386 -----------------------------------------------"
# rm -f $spec
# cat Gauche.spec | sed 's/%define encoding .*/%define encoding eucjp/' > $spec
# rpm -bb --clean $spec
echo "EUC, i686 -----------------------------------------------"
rm -f $spec
cat Gauche.spec | sed 's/%define encoding .*/%define encoding eucjp/' > $spec
rpmbuild -ba --clean --target i686 $spec
echo "Finishing..."
# mv $RPMDIR/RPMS/i386/Gauche-eucjp-*.rpm $TGZ_DEST
# mv $RPMDIR/RPMS/i386/Gauche-utf8-*.rpm $TGZ_DEST
# mv $RPMDIR/RPMS/i686/Gauche-eucjp-*.rpm $TGZ_DEST
# mv $RPMDIR/RPMS/i686/Gauche-utf8-*.rpm $TGZ_DEST
# mv $RPMDIR/SRPMS/Gauche-*.rpm $TGZ_DEST
fi