diff options
author | Cem Keylan <cem@ckyln.com> | 2020-02-13 11:34:51 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-02-13 11:34:51 +0300 |
commit | 14942f3c48055b4bd12d55b2e45162d806a97ee2 (patch) | |
tree | 3c7b79e377aa8ae42cd628f337aca9c094869525 /core/runit/build | |
parent | db137df80bb89928ec08bf696fe1a122377105a6 (diff) | |
download | repository-14942f3c48055b4bd12d55b2e45162d806a97ee2.tar.gz |
runit: make it usable
Diffstat (limited to 'core/runit/build')
-rwxr-xr-x | core/runit/build | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/core/runit/build b/core/runit/build index 3fc5c37a..9b848bf9 100755 --- a/core/runit/build +++ b/core/runit/build @@ -1,26 +1,27 @@ #!/bin/sh -e -cd runit-2.1.2/src - -sed -e 's@sbin/runit@usr/bin/runit@g' -i runit.h - -# Build statically -echo "${CC:-gcc} -D_GNU_SOURCE $CFLAGS -static" > conf-cc -echo "${CC:-gcc} $LDFLAGS -static -Wl,-z -Wl,noexecstack" > conf-ld - -# Set service path to /var/service -sed -i -e 's:^char \*varservice ="/service/";$:char \*varservice ="/var/service/";:' sv.c - -make - -for bin in chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset; do - install -Dm755 "$bin" "$1/usr/bin/$bin" -done -cd ../man -for man in ./*; do - install -Dm644 "$man" "$1/usr/share/man/man8/$man" -done - - -mkdir -p "$1/var" -ln -s ../run/runit/runsvdir/current "$1/var/service" +for patch in ./*.patch ; do patch -p0 < "$patch" ; done +cd runit-2.1.2 + +( + cd src + + sed 's@sbin/runit@usr/bin/runit@g' -i runit.h + printf '%s -D_GNU_SOURCE -static\n' "${CC-cc}" "$CFLAGS" > conf-cc + printf '%s %s -static -Wl,-z -Wl,noexecstack\n' "${CC-cc}" "$CFLAGS" > conf-ld + sed -i 's:^char \*varservice ="/service/";$:char \*varservice ="/var/service/";:' sv.c + + make + + install -Dm755 -t "$1/usr/bin/" chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset +) + +install -Dm644 -t "$1/usr/share/man/man8" man/* + +mkdir -p "$1/var/service" "$1/etc/runit" +ln -s runit-init "$1/usr/bin/init" +ln -s /usr/lib/init/rc.boot "$1/etc/runit/1" +ln -s /usr/lib/init/rc.shutdown "$1/etc/runit/3" + +install -Dm755 ../2 "$1/etc/runit/2" +install -Dm755 -t "$1/usr/bin" ../poweroff ../reboot |