-
Notifications
You must be signed in to change notification settings - Fork 7
/
installit
executable file
·65 lines (54 loc) · 1.72 KB
/
installit
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
#! /bin/sh
VERSION=2.0
OWNER=${OWNER:-root}
GROUP=${GROUP:-root}
INSTALLBIN="install -g $GROUP -o $OWNER -m 755"
INSTALLDOC="install -g $GROUP -o $OWNER -m 644"
if [ -z $1 ]; then
echo "Usage: installit <prefix>"
echo "You will want to set the following environment variables:"
echo ""
echo " Name Description (Default)"
echo " ─────────────────────────────────"
echo " TEXDIR Your texmf-local directory (<prefix>/share/texmf-local)"
echo " DOCDIR Documentation (<prefix>/doc/chezweb-$VERSION)"
echo " BINDIR Binaries (<prefix>/bin)"
echo " LIBDIR Libraries (<prefix>/lib/chezweb)"
exit 1
fi
PREFIX=$1
TEXDIR=${TEXDIR:-$PREFIX/share/texmf-local}
DOCDIR=${DOCDIR:-$PREFIX/doc/chezweb-$VERSION}
BINDIR=${BINDIR:-$PREFIX/bin}
LIBDIR=${LIBDIR:-$PREFIX/lib/chezweb}
TEXSUB=${TEXDIR}/tex/generic
echo "Installing to $PREFIX"
echo "Tex Macros installed to $TEXDIR"
echo "Documentation installed to $DOCDIR"
echo "Binaries installed to $BINDIR"
echo "Libraries installed to $LIBDIR"
set -e
echo -n "Making directories..."
mkdir -p $TEXSUB $DOCDIR $BINDIR $LIBDIR
echo "Done."
# Copy documentation
echo -n "Installing documentation..."
$INSTALLDOC README chezweb.pdf doc/cwebman.pdf $DOCDIR
echo "Done."
# Install libraries
echo -n "Installing libraries..."
if [ -e runtime.so ]; then
$INSTALLDOC runtime.so $LIBDIR
fi
$INSTALLDOC runtime.sls $LIBDIR
$INSTALLDOC runtime.ss $LIBDIR
$INSTALLDOC chezweb.ss $LIBDIR
echo "Done."
# Install binaries
echo -n "Installing binaries..."
$INSTALLBIN chezweave cheztangle $BINDIR
echo "Done."
# Install tex macros
echo -n "Installing tex macros..."
$INSTALLDOC chezwebmac.tex $TEXSUB
echo "Done."