-
Notifications
You must be signed in to change notification settings - Fork 6
/
do-install
executable file
·42 lines (34 loc) · 1.09 KB
/
do-install
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
#!/bin/sh
: ${USE_SYSTEMD=true}
: ${USE_OPENRC=false}
: ${USE_APPARMOR=false}
: ${PREFIX:=/usr}
: ${SYSCONFDIR:=/etc}
: ${RUNSTATEDIR:=/var/run}
: ${systemd_unitdir:=${PREFIX}/lib/systemd}
: ${LIBEXEC:=${PREFIX}/libexec}
set -euf
cd "$(dirname "$0")"
install -d "$DESTDIR$PREFIX/bin"
install illum-d "$DESTDIR$PREFIX/bin"
if $USE_SYSTEMD; then
install -d "$DESTDIR${systemd_unitdir}/system"
sed -e 's;@bindir@;'$PREFIX'/bin;' \
"illum.service" > "$DESTDIR${systemd_unitdir}/system/illum.service"
fi
if $USE_OPENRC; then
install -d "$DESTDIR$SYSCONFDIR/init.d"
sed -e 's;@bindir@;'$PREFIX'/bin;' \
-e 's;@runstatedir@;'$RUNSTATEDIR';' \
-e 's;@libexec@;'$LIBEXEC';' \
"illum.openrc" > "$DESTDIR$SYSCONFDIR/init.d/illum"
chmod +x "$DESTDIR$SYSCONFDIR/init.d/illum"
mkdir -p "$DESTDIR$LIBEXEC/illum"
install with-syslog "$DESTDIR$LIBEXEC/illum"
fi
if $USE_APPARMOR; then
bindir_dot="$(printf ${PREFIX} | sed 's;/;.;').bin"
install -d "$DESTDIR$SYSCONFDIR/apparmor.d"
sed -e 's;@bindir@;'$PREFIX'/bin;' \
"illum.apparmor" > "$DESTDIR$SYSCONFDIR/apparmor.d/${bindir_dot}.illum-d"
fi