-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·43 lines (40 loc) · 1.05 KB
/
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
43
#!/bin/sh
#
# Socklog - system and kernel logging services for daemontools
# http://smarden.org/socklog/
#
# (cloux@rote.ch)
SOCKLOG_GIT="https://github.com/cloux/socklog"
if [ $(id -u) -ne 0 ]; then printf 'Need to be root!\n'; exit 1; fi
#
# determine the package manager
#
APTINST="$(command -v aptitude)"
[ "$APTINST" ] || APTINST="$(command -v apt-get)"
export DEBIAN_FRONTEND=noninteractive
#
# git clone/pull and compile source
#
printf '\nInstalling socklog from %s ...\n' "$SOCKLOG_GIT"
cd /usr/src
if [ -d "${SOCKLOG_GIT##*/}" ]; then
cd ${SOCKLOG_GIT##*/}
git fetch -q --all || exit 1
if [ "$(git rev-parse HEAD)" = "$(git rev-parse @{u})" ]; then
printf 'Source is up to date.\n'
else
git pull -q || exit 1
fi
else
# install dependencies
[ "$APTINST" ] && $APTINST --assume-yes -o Dpkg::Use-Pty=0 install git gcc make
# clone repo
git clone -q $SOCKLOG_GIT || exit 1
cd ${SOCKLOG_GIT##*/}
fi
package/compile || exit 1
#package/check || exit 1
package/install-man
printf 'Installing commands ...\n'
cd command || exit 1
cp -puvf -t /usr/bin/ *