File: emacsen.install

package info (click to toggle)
psgml 1.3.2-8
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,164 kB
  • ctags: 1,046
  • sloc: lisp: 10,073; sh: 497; makefile: 53
file content (126 lines) | stat: -rw-r--r-- 3,338 bytes parent folder | download
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
#				-*- Mode: Sh -*- 
# emacsen.install --- 
# Author	   : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
# Created On	   : Fri Apr  3 14:39:59 1998
# Created On Node  : tiamat.datasync.com
# Last Modified By : Manoj Srivastava
# Last Modified On : Sat Dec  3 15:15:31 2005
# Last Machine Used: glaurung.internal.golden-gryphon.com
# Update Count	   : 48
# Status	   : Unknown, Use with caution!
# HISTORY	   : 
# Description	   : 
# 
# arch-tag: 4d6d66e0-840b-46a1-84ba-6f8f48ea548e
#

set -e

FLAVOUR=$1
PACKAGE="=P"
VERSION="=V"

if [ "X$FLAVOUR" = "X" ]; then
    echo Need argument to determin FLAVOUR of emacs;
    exit 1
fi

if [ "X$PACKAGE" = "X" ]; then
    echo Internal error: need package name;
    exit 1;
fi

if [ "X$VERSION" = "X" ]; then
    echo Internal error: need package version;
    exit 1;
fi

ELDIR=/usr/share/emacs/site-lisp/$PACKAGE
ELCDIR=/usr/share/$FLAVOUR/site-lisp/$PACKAGE
STARTDIR=/etc/$FLAVOUR/site-start.d
INFO_FILES="psgml-api.info psgml.info";
STARTFILE="$PACKAGE-init.el";
STAMPFILE=psgml-api.elc

# Darn it, this may well change.
EMACSB="$FLAVOUR -batch -l psgml-maint.el";

case "$FLAVOUR" in
    emacs | emacs20 | emacs19)
	echo "install/$PACKAGE: Ignoring $FLAVOUR."
	;;
    emacs21 | emacs22 | emacs-snapshot)
	echo -n "install/$PACKAGE: Byte-compiling for $FLAVOUR..."
	if [ -d $ELCDIR ]; then
            if [ -e "${ELCDIR}/${STAMPFILE}" ]; then
                echo "${PACKAGE} files already compiled in ${ELCDIR}." 
                exit 0
            else
	        rm -f $ELCDIR/install.log;
	        find $ELCDIR -type f -name \*.elc -exec rm -f {} \; || true
	        rmdir --ignore-fail-on-non-empty $ELCDIR
            fi
	fi
	if [ ! -d $ELCDIR ]; then
	    install -m 755 -d $ELCDIR
	fi
	LOG=`tempfile`;
	trap "test -f $LOG && mv -f $LOG  $ELCDIR/install.log > /dev/null 2>&1" exit
	cd $ELDIR
	if [ -x /usr/bin/autoconf ]; then
	    echo rm -f config.status >> $LOG  2>&1;
	    rm -f config.status
	    ./configure --prefix=/usr >> $LOG  2>&1;
	fi
	# if we do not have make, well, we are hosed.
	if [ -x /usr/bin/make ]; then
	    make clean                                  >> $LOG;
	    (make EMACS=$FLAVOUR lispdir=$ELCDIR)      >> $LOG  2>&1;
	    set X *.elc 
	    shift
	    for file
	    do
		echo install -m 644 $file $ELCDIR           >> $LOG;
		install -m 644 $file $ELCDIR;
	    done
	    make clean                                >> $LOG;
	else
	    echo $EMACSB -f psgml-compile-files       > $LOG;
	    $EMACSB -f psgml-compile-files
	    set X *.elc 
	    shift
	    for file
	    do
		echo install -m 644 $file $ELCDIR         >> $LOG;
		install -m 644 $file $ELCDIR;
		echo rm -f $file                          >> $LOG;
		rm -f $file;
	    done
	fi
	mv -f $LOG       $ELCDIR/install.log;
	chmod 644        $ELCDIR/install.log;
	sed -e "s|=F|/usr/share/$FLAVOUR/site-lisp/$PACKAGE|" \
            $STARTFILE > $ELCDIR/$STARTFILE
	ucf $ELCDIR/$STARTFILE $STARTDIR/50$STARTFILE;
	if test -x /usr/sbin/install-info-altdir; then
	    for infofile in $INFO_FILES; do
		if [ -x $infofile ]; then
		    install-info-altdir --quiet --section "" "" \
			--dirname=${FLAVOUR} $infofile
		fi
	    done
	fi
	echo " done."
	;;
    *)
	echo "install/$PACKAGE: Ignoring emacsen flavor $FLAVOUR."
	;;
esac

exit 0


### Local Variables:
### mode: shell-script
### End: