58 lines
1.5 KiB
Bash
58 lines
1.5 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
pkgname="runit"
|
||
|
pkgver="2.1.2"
|
||
|
|
||
|
src="http://smarden.org/runit/runit-${pkgver}.tar.gz"
|
||
|
|
||
|
prepare () {
|
||
|
[ -f "${pkgname}-src.tar.gz" ] || curl -o "${pkgname}-src.tar.gz" "${src}"
|
||
|
tar -C "${srcdir}" -xvf "${pkgname}-src.tar.gz"
|
||
|
}
|
||
|
|
||
|
build () {
|
||
|
cd "${srcdir}/admin/runit-${pkgver}"
|
||
|
|
||
|
echo "${CC:-gcc} $CFLAGS" > src/conf-cc
|
||
|
echo "${CC:-gcc -s} $LDFLAGS" > src/conf-ld
|
||
|
|
||
|
# Fix quirks
|
||
|
sed -i 's/ -static//g' src/Makefile
|
||
|
sed -i 's#/service#/var&#g' src/sv.c
|
||
|
sed -i 's#/service#/var&#g' etc/debian/3
|
||
|
|
||
|
make -C src
|
||
|
make -C src check
|
||
|
}
|
||
|
|
||
|
package () {
|
||
|
cd "${srcdir}/admin/runit-${pkgver}"
|
||
|
|
||
|
# Oh boy...
|
||
|
install -d -m 755 "${pkgdir}"/etc/runit/runsvdir/pkg-default
|
||
|
install -d -m 755 "${pkgdir}"/etc/runit/runsvdir/all
|
||
|
install -d -m 755 "${pkgdir}"/var
|
||
|
install -m 755 etc/debian/{1,2,3} "${pkgdir}"/etc/runit/
|
||
|
install -m 755 etc/debian/ctrlaltdel "${pkgdir}"/etc/runit/
|
||
|
ln -s ../etc/runit/runsvdir/current "${pkgdir}"/var/service
|
||
|
|
||
|
# Install binaries
|
||
|
install -d -m 755 "${pkgdir}"/usr/bin
|
||
|
for f in $(<package/commands); do
|
||
|
install -s -m 755 "src/${f}" "${pkgdir}"/usr/bin
|
||
|
done
|
||
|
|
||
|
# Symlink runit to /sbin/init
|
||
|
ln -s /usr/bin/runit-init "${pkgdir}"/usr/bin/init
|
||
|
|
||
|
# Manual pages
|
||
|
install -d -m 755 "${pkgdir}"/usr/share/man/man8
|
||
|
install -m 644 man/* "${pkgdir}"/usr/share/man/man8
|
||
|
|
||
|
# Documentation
|
||
|
install -d -m 755 "${pkgdir}"/usr/share/doc/runit
|
||
|
install -m 644 doc/*.html "${pkgdir}"/usr/share/doc/runit
|
||
|
}
|
||
|
|
||
|
. ../common.sh
|