-
Notifications
You must be signed in to change notification settings - Fork 2
/
installer
executable file
·50 lines (41 loc) · 894 Bytes
/
installer
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
#!/bin/sh
# Installer script.
#
# So-libraries will be installed into "$DESTDIR/lib64",
# C-headers into "$DESTDIR/usr/include/libnel".
MANIFEST=install_manifest.txt
case "$1" in
install)
[ -n "$DESTDIR" ] || {
echo "Error: DESTDIR must be specified."
exit 1
}
DESTDIR=$(realpath "$DESTDIR")
truncate -s0 $MANIFEST
LIBDIR="$DESTDIR/lib64"
mkdir -p "$LIBDIR"
for f in *.so; do
cp "$f" "$LIBDIR"
echo "$LIBDIR/$f" >>$MANIFEST
done
INCDIR="$DESTDIR/usr/include/libnel"
mkdir -p "$INCDIR"
for f in *.h; do
cp "$f" "$INCDIR"
echo "$INCDIR/$f" >>$MANIFEST
done
;;
uninstall)
[ -f $MANIFEST ] || {
echo "Error: \"$MANIFEST\" not found."
exit 1
}
# NOTE: created dirs will be left, e.g. if you install
# into the root, then "/usr/include/libnel" will be left
# empty after uninstall.
cat $MANIFEST | xargs rm
;;
*)
echo "Usage: install|uninstall"
;;
esac