4 test $# -ge 1 && SCRIPT=`basename "$1"`
6 echo "Usage: $SCRIPT <LyX source directory>" >&2
11 # It appears that this environment variable is not defined on Sun,
15 # document the created archive name
17 echo "$KERNEL" | grep MINGW >/dev/null && KERNEL=win32
20 ARCHIVEBASE="tex2lyx_${KERNEL}_${ARCH}_"`date +%d%b%y`
23 test $# -eq 1 || usage "$0"
25 ./autogen.sh || usage "$0" "autogen.sh failed"
27 BUILDDIR=build-tex2lyx
28 test -d "$BUILDDIR" || {
29 mkdir "$BUILDDIR" || usage "$0" "mkdir $BUILDDIR failed"
32 cd "$BUILDDIR" || usage "$0" "cd $BUILDDIR failed"
35 CONFIGURE="../configure --disable-debug --enable-optimization --prefix='$PWD/$INSTALLDIR' --with-frontend=foo"
37 eval "${CONFIGURE}" || usage "$0" "configure failed"
39 (cd boost && make) || usage "$0" "make in boost failed"
40 (cd src/support && make) || usage "$0" "make in src/support failed"
41 (cd src/tex2lyx && make) || usage "$0" "make in src/tex2lyx failed"
42 (cd src/tex2lyx && make install) || usage "$0" "make install in src/tex2lyx failed"
43 (cd lib && make install) || usage "$0" "make install in lib failed"
45 # Remove stuff that's not needed by tex2lyx.
48 RESOURCES="$INSTALLDIR"/`ls $INSTALLDIR | sed '/bin/d;/man/d'`
50 test -d "$RESOURCES" || \
51 usage "$0" "Unable to ascertain installed resources dir $RESOURCES"
52 BINDIR="$INSTALLDIR"/bin
54 rm -f "$RESOURCES"/charset.alias
55 rm -rf "$RESOURCES"/locale
56 rm -f "$BINDIR"/noweb2lyx
57 # Gets tex2lyx and tex2lyx.exe
58 strip "$BINDIR"/tex2lyx*
62 rm -f configure encodings external_templates languages lyxrc.example symbols
63 # 02/11/05, J>P. Chrétien, <chretien@cert.fr>
64 # removed the scripts dir from the list as tex2lyx needs layout2layout
65 # rm -rf bind clipart doc examples help images kbd scripts templates tex ui xfonts
66 rm -rf bind clipart doc examples help images kbd templates tex ui xfonts
74 PATH="/c/Program Files/ZIP":$PATH
79 echo "zip is not in your PATH. Please add it here." >&2
83 ARCHIVE="$ARCHIVEBASE".zip
85 zip "$ARCHIVEBASE" `find "$INSTALLDIR" -name '*'`
88 # Not all tars understand "cvzf", so do this in two steps.
89 ARCHIVE="$ARCHIVEBASE".tar
91 tar cvf "$ARCHIVE" "$INSTALLDIR"
98 echo "$PWD/$ARCHIVE available"