~ubuntu-branches/ubuntu/intrepid/wnn7egg/intrepid

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
#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/wnn7egg

# skelton file is
# Written by Jim Van Zandt <jrv@vanzandt.mv.com>, borrowing heavily
# from the install scripts for gettext by Santiago Vila
# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
#
# Modified for wnn7egg by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
#

FLAVOR=$1
PACKAGE=wnn7egg

if [ ${FLAVOR} = emacs ]; then exit 0; fi

echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}

EL_ONLY="eggrc-wnn7 wnn7egg-edep.el its-v309"
SRCS="wnn7egg-cnv.el wnn7egg-leim.el wnn7egg-jsymbol.el wnn7egg-lib.el wnn7egg.el"
EMACS_SRCS="wnn7egg-com.el wnn7egg-rpc.el"
XEMACS_SRCS="wnn7egg-comx21.el wnn7egg-comx214.el wnn7egg-rpcx21.el"

FLAVORTEST=`echo $FLAVOR | cut -c-6`
if [ ${FLAVORTEST} = xemacs ] ; then
    SITEFLAG="-no-site-file"
    FILES="${SRCS} ${XEMACS_SRCS}"
    XEMACS=`ls /usr/bin/xemacs*21*-mule* 2> /dev/null | head -1`
    if [ -z ${XEMACS} ]; then exit 0; fi
    COMPILE_EMACS=${XEMACS}
else
    SITEFLAG="--no-site-file"
    FILES="${SRCS} ${EMACS_SRCS}"
    COMPILE_EMACS=${FLAVOR} 
fi
FLAGS="${SITEFLAG} -q -batch -l path.el -l ./wnn7egg-lib.el -f batch-byte-compile"

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
STARTDIR=/etc/${FLAVOR}/site-start.d
STARTFILE="${PACKAGE}-init.el";


case "${FLAVOR}" in
    emacs)
    ;;

    emacs21|emacs22|emacs-snapshot|xemacs21)
    install -m 755 -d ${ELCDIR}
    (cd ${ELDIR}

    cp -r ${FILES} ${EL_ONLY} ${ELCDIR}
    cd ${ELCDIR}

    echo '(setq load-path (cons "." load-path) byte-compile-warnings nil)'> path.el
    echo "(if (featurep 'xemacs)(or (featurep 'mule) (kill-emacs)))" >> path.el

    ${COMPILE_EMACS} ${FLAGS} ${FILES} > CompilationLog 2>&1
    rm -f ${FILES} path.el)

    if [ ! -d ${STARTDIR} ]; then
	install -m 755 -d ${STARTDIR}
    fi

    cp ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE};

    echo "done."
    ;;
    *)
    ;;
esac

exit 0;