File: emacsen-install

package info (click to toggle)
goby 1.1%2B0.20180214-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,372 kB
  • sloc: lisp: 2,139; makefile: 80; sh: 66
file content (63 lines) | stat: -rw-r--r-- 1,487 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
#! /bin/sh
# /usr/lib/emacsen-common/packages/install/goby
set -e

FLAVOR=$1
PACKAGE=goby

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

ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
ELDIR=/usr/share/$PACKAGE
TOELDIR=../../../$PACKAGE
ELCSTAMP=$ELCDIR/compile-stamp
if [ -f "$ELCSTAMP" ]; then
    if [ -z "`find "$ELDIR/$PACKAGE.el" -newer "$ELCSTAMP"`" ]; then
	echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped"
	exit 0
    fi
    rm -f "$ELCSTAMP"
fi

LOG=`mktemp -t elc.XXXXXXXXXXXX`
chmod 644 "$LOG"
echo "install/$PACKAGE: byte-compiling for $FLAVOR, logged in $LOG"

cd "$ELDIR"
FILES=`echo *.el`
if [ ! -d "$ELCDIR" ]; then
    mkdir "$ELCDIR"
    chmod 755 "$ELCDIR"
fi
cd "$ELCDIR"
rm -f *.elc __myinit.el
for f in $FILES; do
    ln -sf "$TOELDIR/$f" .
done

cat > __myinit.el << EOF
(setq load-path (cons "." load-path))
(setq byte-compile-warnings nil)
EOF

FLAGS="-q -no-site-file -batch -l __myinit.el -f batch-byte-compile"
echo "$FLAVOR" $FLAGS $FILES >> "$LOG"
"$FLAVOR" $FLAGS $FILES >> "$LOG" 2>&1
chmod 644 *.elc

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

echo "install/$PACKAGE: deleting $LOG"
rm -f "$LOG" __myinit.el*

touch "$ELCSTAMP"
exit 0