File: emacsen-install

package info (click to toggle)
ddskk 17.1-4%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,760 kB
  • sloc: lisp: 30,155; ruby: 476; python: 414; makefile: 167; sh: 92
file content (77 lines) | stat: -rw-r--r-- 2,310 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# /usr/lib/emacsen-common/packages/install/ddskk
set -e

FLAVOR=$1
PACKAGE=ddskk

if [ -z "${FLAVOR}" ]; then exit 1; fi

case $FLAVOR in
    emacs23|emacs22|emacs21|emacs20|emacs19|mule2|*xemacs*)
    exit 0
    ;;
esac

ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
ELDIR=/usr/share/$PACKAGE
ELCSTAMP=$ELCDIR/compile-stamp

if [ -f "$ELCSTAMP" ]; then
    if [ -z "`find "$ELDIR/skk.el" -newer "$ELCSTAMP"`" ]; then
	echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped"
	exit 0
    fi
    rm -f "$ELCSTAMP"
fi

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

FLAGS="-no-site-file -q -batch -l __path.el"

install -m 755 -d ${ELCDIR}
cd ${ELDIR}
LINKS=`echo SKK-* *.el*`
if [ -d nicola ]; then
    LINKS="$LINKS "`echo nicola/NICOLA-* nicola/*.el*`
fi
cd ${ELCDIR}
for f in $LINKS; do
    ln -sf "../../../$PACKAGE/$f" .
done
cp -R "$ELDIR/maint" .

cat << EOF > __path.el
(set-language-environment "Japanese")
(prefer-coding-system 'euc-jp)
(prefer-coding-system 'iso-2022-jp)
(setq SKK_SET_JISYO nil)
(setq load-path (cons "/usr/share/${FLAVOR}/site-lisp/apel" load-path))
(setq load-path (cons "${ELCDIR}" load-path))
(setq byte-compile-warnings nil)
EOF
mv -f skk-setup.el.in skk-setup.el
mv -f leim-list.el.in leim-list.el
rm -f *.elc
${FLAVOR} ${FLAGS} -f batch-byte-compile skk-setup.el >>CompilationLog 2>&1
${FLAVOR} ${FLAGS} -l SKK-MK -f SKK-MK-compile >>CompilationLog 2>&1

${FLAVOR} ${FLAGS} -l NICOLA-DDSKK-ELS -l NICOLA-DDSKK-MK -f nicola-ddskk-generate-autoloads >>CompilationLog 2>&1
${FLAVOR} ${FLAGS} -f batch-byte-compile nicola-ddskk-autoloads.el >>CompilationLog 2>&1
${FLAVOR} ${FLAGS} -l maint/install.el -l NICOLA-DDSKK-MK -f compile-nicola-ddskk NONE NONE NONE >>CompilationLog 2>&1

rm -f SKK-* leim-list.el* *.in NICOLA-* __path.el*
rm -f ${ELCDIR}/skk-lookup.elc ${ELCDIR}/skk-jisx0213.elc
rm -f ${ELCDIR}/ptexinfmt.el* ${ELCDIR}/install.el*
rm -rf "$ELCDIR/maint"
gzip -9qf CompilationLog

if [ -f /usr/share/emacsen-common/debian-startup.el ] && \
   [ ! -f "/etc/$FLAVOR/site-start.d/50$PACKAGE.el" ] && \
   [ -f "/etc/emacs/site-start.d/50$PACKAGE.el" ] && \
   [ -d "/etc/$FLAVOR/site-start.d" ]; then
    ln -sf "../../emacs/site-start.d/50$PACKAGE.el" "/etc/$FLAVOR/site-start.d/50$PACKAGE.el"
fi

touch "$ELCSTAMP"
exit 0