Debian Codegraph @

debian/emacsen-install

raw symbols SCIP
1 #! /bin/sh
2 # /usr/lib/emacsen-common/packages/install/apel
3 set -e
4
5 FLAVOR=$1
6 PACKAGE=apel
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 "$ELCSTAMP" ]; then
19 if [ -z "`find "$ELDIR/poem.el" -newer "$ELCSTAMP"`" ]; then
20 echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped"
21 exit 0
22 fi
23 rm -f "$ELCSTAMP"
24 fi
25
26 LOG="$ELCDIR/CompilationLog"
27 echo "install/$PACKAGE: byte-compiling for $FLAVOR"
28
29 cd "$ELDIR"
30 LINKS=`echo *.el`
31 if [ ! -d "$ELCDIR" ]; then
32 mkdir "$ELCDIR"
33 chmod 755 "$ELCDIR"
34 fi
35
36 cd "$ELCDIR"
37 TOELDIR=../../../$PACKAGE
38 rm -f *.elc __myinit.el
39 for f in $LINKS; do
40 ln -sf "$TOELDIR/$f" .
41 done
42 rm -f *-e20_2.el *-18.el *-om.el *-nemacs.el localhook.el env.el pces-raw.el timezone.el emu-mule.el tinyrich.el tinycustom.el
43 rm -f poe-xemacs.el pces-xm.el pces-xfc.el poem-xm.el mcs-xmu.el mcs-xm.el inv-xemacs.el
44 rm -f poem-ltn1.el mcs-ltn1.el
45 FILES=`/bin/ls -1 *.el | grep -v '^mcs-xmu.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 "." load-path))
52 (setq byte-compile-warnings t)
53 EOF
54
55 FLAGS="-q -no-site-file -batch -l __myinit.el -f batch-byte-compile"
56 echo "$FLAVOR" $FLAGS $FILES > "$LOG"
57 set +e
58 "$FLAVOR" $FLAGS $FILES >> "$LOG" 2>&1
59 if [ $? -ne 0 ]; then cat "$LOG"; exit 1; fi
60 set -e
61 gzip -9f "$LOG"
62 chmod 644 *.elc
63
64 if [ ! -f pces-20.elc ]; then
65 # Remove pces-20.el to prevent a literal-test-file problem.
66 rm -f pces-20.el
67 fi
68
69 rm -f __myinit.el*
70
71 if [ -f /usr/share/emacsen-common/debian-startup.el ] && \
72 [ ! -f "/etc/$FLAVOR/site-start.d/20$PACKAGE.el" ] && \
73 [ -f "/etc/emacs/site-start.d/20$PACKAGE.el" ] && \
74 [ -d "/etc/$FLAVOR/site-start.d" ]; then
75 ln -sf "../../emacs/site-start.d/20$PACKAGE.el" "/etc/$FLAVOR/site-start.d/20$PACKAGE.el"
76 fi
77
78 echo "install/$PACKAGE: byte-compiling for reverse dependency"
79 pkgs=
80
81 for p in w3m-el:w3m w3m-el-snapshot:w3m flim bitmap-mule cmail elscreen elpoint eldav initz liece; do
82 pkg=`echo $p | cut -d : -f 1`
83 sname=`echo $p | cut -d : -f 2`
84 dir=/usr/share/$FLAVOR/site-lisp/$sname
85 if [ -n "$sname" ] && [ -d "$dir" ] && [ -f "/usr/lib/emacsen-common/packages/install/$pkg" ]; then
86 rm -f "$dir"/*.elc "$dir"/*/*.elc "$dir"/*-stamp
87 pkgs="$pkg $pkgs"
88 fi
89 done
90 for pkg in $pkgs; do
91 "/usr/lib/emacsen-common/packages/install/$pkg" "$FLAVOR"
92 done
93
94 touch "$ELCSTAMP"
95 exit 0