forked from mighty-gerbils/gerbil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·41 lines (35 loc) · 1.13 KB
/
install.sh
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
#!/bin/sh
set -e
cd $(dirname "$0")
die() {
echo "install failed"
exit 1
}
install() {
local prefix="${1}"
mkdir -p "${prefix}" || die
cp -av build/* "${prefix}" || die
mkdir -p "${prefix}/share/emacs/site-lisp" || die
cp -v etc/gerbil-mode.el "${prefix}/share/emacs/site-lisp" || die
cp -v src/gambit/misc/gambit.el "${prefix}/share/emacs/site-lisp" || die
}
link_version() {
local base="${1}"
local version="${2}"
(cd "${base}" && rm -f current && ln -sf "${version}" current) || die
(cd "${base}" && rm -f bin && ln -sf current/bin bin) || die
(cd "${base}" && rm -f lib && ln -sf current/lib lib) || die
(cd "${base}" && rm -f include && ln -sf current/include include) || die
(cd "${base}" && rm -f share && ln -sf current/share share) || die
}
if [ -e build-env.sh ]; then
. ./build-env.sh
else
echo "build-env.sh does not exist; did you run configure?"
die
fi
install "${DESTDIR}${GERBIL_PREFIX}"
GERBIL_BASE=$(dirname "${GERBIL_PREFIX}")
if [ "${GERBIL_BASE}/${GERBIL_VERSION}" = "${GERBIL_PREFIX}" ]; then
link_version "${DESTDIR}${GERBIL_BASE}" "${GERBIL_VERSION}"
fi