Debian Codegraph @

debian/emacsen-install

raw symbols SCIP
1 #! /bin/sh
2 # /usr/lib/emacsen-common/packages/install/semi
3 set -e
4
5 FLAVOR=$1
6 PACKAGE=semi
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/alist.elc" ]; then exit 0; fi
19 if [ ! -f "/usr/share/$FLAVOR/site-lisp/flim/mime.elc" ]; then exit 0; fi
20
21 if [ -f "$ELCSTAMP" ]; then
22 if [ -z "`find "$ELDIR/mime-view.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 FILES=`echo sig*.el mime*.el semi*.el mail*.el | sed 's/mime-mc.el//; s/mime-vcard.el//'`
46
47 cat > __myinit.el << EOF
48 (setq inhibit-automatic-native-compilation t)
49 (setq native-comp-deferred-compilation nil)
50 (setq comp-enable-subr-trampolines nil)
51 (setq load-path (cons "/usr/share/$FLAVOR/site-lisp/apel" load-path))
52 (setq load-path (cons "/usr/share/$FLAVOR/site-lisp/flim" load-path))
53 (setq load-path (cons "/usr/share/$FLAVOR/site-lisp/bitmap-mule" load-path))
54 (setq load-path (cons "." load-path))
55 (setq byte-compile-warnings t)
56 EOF
57
58 FLAGS="-q -no-site-file -batch -l __myinit.el -f batch-byte-compile"
59 echo "$FLAVOR" $FLAGS $FILES > "$LOG"
60 set +e
61 "$FLAVOR" $FLAGS $FILES >> "$LOG" 2>&1
62 if [ $? -ne 0 ]; then cat "$LOG"; exit 1; fi
63 set -e
64 gzip -9f "$LOG"
65 chmod 644 *.elc
66
67 rm -f __myinit.el*
68
69 if [ -f /usr/share/emacsen-common/debian-startup.el ] && \
70 [ ! -f "/etc/$FLAVOR/site-start.d/51$PACKAGE.el" ] && \
71 [ -f "/etc/emacs/site-start.d/51$PACKAGE.el" ] && \
72 [ -d "/etc/$FLAVOR/site-start.d" ]; then
73 ln -sf "../../emacs/site-start.d/51$PACKAGE.el" "/etc/$FLAVOR/site-start.d/51$PACKAGE.el"
74 fi
75
76 echo "install/$PACKAGE: byte-compiling for reverse dependency"
77 pkgs=
78 for p in wl:wl wl-beta:wl w3m-el:w3m w3m-el-snapshot:w3m cmail t-gnus; do
79 pkg=`echo $p | cut -d : -f 1`
80 sname=`echo $p | cut -d : -f 2`
81 dir=/usr/share/$FLAVOR/site-lisp/$sname
82 if [ -n "$sname" ] && [ -d "$dir" ] && [ -f "/usr/lib/emacsen-common/packages/install/$pkg" ]; then
83 rm -f "$dir"/*.elc "$dir"/*/*.elc "$dir"/*-stamp "$dir"/*/*-stamp
84 pkgs="$pkg $pkgs"
85 fi
86 done
87 for pkg in $pkgs; do
88 "/usr/lib/emacsen-common/packages/install/$pkg" "$FLAVOR"
89 done
90
91 touch "$ELCSTAMP"
92 exit 0