Debian Codegraph @

debian/emacsen-install

raw symbols SCIP
1 #! /bin/sh
2 # /usr/lib/emacsen-common/packages/install/mu-cite
3 set -e
4
5 FLAVOR=$1
6 PACKAGE=mu-cite
7
8 ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
9 ELDIR=/usr/share/$PACKAGE
10 ELCSTAMP=$ELCDIR/compile-stamp
11
12 case $FLAVOR in
13 *xemacs*|emacs2[0-3]|emacs1?|mule2)
14 exit 0
15 ;;
16 esac
17
18 if [ ! -f "/usr/share/$FLAVOR/site-lisp/apel/poem.elc" ]; then exit 0; fi
19 if [ ! -f "/usr/share/$FLAVOR/site-lisp/flim/std11.elc" ]; then exit 0; fi
20
21 if [ -f "$ELCSTAMP" ]; then
22 if [ -z "`find "$ELDIR/$PACKAGE.el" -newer "$ELCSTAMP"`" ]; then
23 echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped"
24 exit 0
25 fi
26 rm -f "$ELCSTAMP"
27 fi
28
29 LOG="$ELCDIR/CompilationLog"
30 echo "install/$PACKAGE: byte-compiling for $FLAVOR"
31
32 cd "$ELDIR"
33 LINKS=`echo *.el`
34 if [ ! -d "$ELCDIR" ]; then
35 mkdir "$ELCDIR"
36 chmod 755 "$ELCDIR"
37 fi
38
39 cd "$ELCDIR"
40 TOELDIR=../../../$PACKAGE
41 rm -f *.elc __myinit.el
42 for f in $LINKS; do
43 ln -sf "$TOELDIR/$f" .
44 done
45
46 cat > __myinit.el << EOF
47 (setq inhibit-automatic-native-compilation t)
48 (setq native-comp-deferred-compilation nil)
49 (setq comp-enable-subr-trampolines nil)
50 (setq load-path (cons "/usr/share/$FLAVOR/site-lisp/apel" load-path))
51 (setq load-path (cons "/usr/share/$FLAVOR/site-lisp/flim" load-path))
52 (setq load-path (cons "." load-path))
53 (setq byte-compile-warnings nil)
54 EOF
55
56 FILES=`echo *.el | sed 's/mu-bbdb.el//'`
57 FLAGS="-q -no-site-file -batch -l __myinit.el -f batch-byte-compile"
58 echo "$FLAVOR" $FLAGS $FILES > "$LOG"
59 set +e
60 "$FLAVOR" $FLAGS $FILES >> "$LOG" 2>&1
61 if [ $? -ne 0 ]; then cat "$LOG"; exit 1; fi
62 set -e
63 gzip -9f "$LOG"
64 chmod 644 *.elc
65
66 rm -f __myinit.el*
67
68 if [ -f /usr/share/emacsen-common/debian-startup.el ] && \
69 [ ! -f "/etc/$FLAVOR/site-start.d/51$PACKAGE.el" ] && \
70 [ -f "/etc/emacs/site-start.d/51$PACKAGE.el" ] && \
71 [ -d "/etc/$FLAVOR/site-start.d" ]; then
72 ln -sf "../../emacs/site-start.d/51$PACKAGE.el" "/etc/$FLAVOR/site-start.d/51$PACKAGE.el"
73 fi
74
75 touch "$ELCSTAMP"
76 exit 0