summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-30 11:15:43 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-07-30 16:34:12 -0400
commit90bb6a7d338176a75d2afb4ce0c6b92f0ffec4f4 (patch)
tree61384be0650bb3f83b56cbda152dcfbcdfb68f82 /pcr
parent676cfdb9322b2d8c98d2eeeb5bb3e68abc7ffa1d (diff)
downloadabslibre-90bb6a7d338176a75d2afb4ce0c6b92f0ffec4f4.tar.gz
abslibre-90bb6a7d338176a75d2afb4ce0c6b92f0ffec4f4.tar.bz2
abslibre-90bb6a7d338176a75d2afb4ce0c6b92f0ffec4f4.zip
pcr/runit: Fix up the package
- Don't create a cyclical dependency with it and runit-init, making it hard to switch inits. - Install the debian example files in docs; the HTML docs link to them - Use directories recommended by doc/runlevels.html and doc/upgrade.html - Add a minimal split package with the base init setup from doc/replaceinit.html - Don't bother with prepare(), we make a /service symlink - Don't bother putting -static in CFLAGS, src/Makefile takes care of that
Diffstat (limited to 'pcr')
-rw-r--r--pcr/runit/PKGBUILD126
-rw-r--r--pcr/runit/runit.install7
2 files changed, 88 insertions, 45 deletions
diff --git a/pcr/runit/PKGBUILD b/pcr/runit/PKGBUILD
index 2ca8c2910..eb99133db 100644
--- a/pcr/runit/PKGBUILD
+++ b/pcr/runit/PKGBUILD
@@ -1,66 +1,102 @@
# Maintainer: David P. <megver83@parabola.nu>
+# Contributor: Luke Shumaker <lukeshu@parabola.nu>
# Maintainer (Artix): Chris Cromer <chris@cromer.cl>
pkgbase=runit
-pkgname=('runit' 'runit-doc')
+pkgname=('runit' 'runit-replaceinit')
pkgver=2.1.2
-pkgrel=1.parabola4
+pkgrel=2
arch=('armv7h' 'i686' 'x86_64')
url='http://smarden.org/runit/'
license=('BSD3')
source=("http://smarden.org/${pkgname}/${pkgbase}-${pkgver}.tar.gz")
sha512sums=('a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf')
-prepare() {
- # set default service path to /run/runit/service
- cd "${srcdir}/admin/${pkgbase}-${pkgver}"
- sed -i 's|"/service/"|"/run/runit/service/"|' src/sv.c
-}
-
build() {
- cd "${srcdir}/admin/${pkgbase}-${pkgver}"
-
- CFLAGS="${CFLAGS} -static"
- LDFLAGS="${LDFLAGS} -static"
-
- package/compile
+ cd "${srcdir}/admin/${pkgbase}-${pkgver}"
+ package/compile
}
check() {
- cd "${srcdir}/admin/${pkgbase}-${pkgver}"
- package/check
+ cd "${srcdir}/admin/${pkgbase}-${pkgver}"
+ package/check
}
package_runit() {
- pkgdesc='Cross-platform Unix init scheme with service supervision'
- depends=('bash' 'runit-init' 'util-linux')
- optdepends=('runit-doc: documentation')
- provides=('init')
- groups=('init')
- conflicts=('systemd-sysvcompat' 'sysvinit' 'init')
- # commands
- mkdir -p "${pkgdir}/usr/bin"
- install -Dm755 ${srcdir}/admin/${pkgbase}-${pkgver}/command/* "${pkgdir}/usr/bin"
-
- # man pages
- mkdir -p "${pkgdir}/usr/share/man/man8"
- install -Dm644 ${srcdir}/admin/${pkgbase}-${pkgver}/man/* "${pkgdir}/usr/share/man/man8"
-
- # default directories
- mkdir -p "$pkgdir/etc/runit/runsvdir/default"
-
- # license
- install -Dm644 "${srcdir}/admin/${pkgbase}-${pkgver}/package/COPYING" "$pkgdir/usr/share/licenses/runit/COPYING"
-
- # init
- ln -sf runit-init "${pkgdir}/usr/bin/init"
+ pkgdesc='Cross-platform Unix init scheme with service supervision'
+ optdepends=('runit-replaceinit')
+ install=runit.install
+
+ provides=('runit-doc')
+ conflicts=('runit-doc')
+ replaces=('runit-doc')
+
+ cd "${srcdir}/admin/${pkgbase}-${pkgver}"
+
+ # `package/install`... but use FHS and obey $pkgdir
+ local command
+ while read -r command; do
+ install -Dm755 -t "$pkgdir"/usr/bin -- "command/$command"
+ done < package/commands
+
+ # `package/install-man`... but use FHS, obey $pkgdir, and let makepkg take care of gzip
+ mkdir -p "${pkgdir}"/usr/share/man/man8
+ install -Dm644 -t "${pkgdir}"/usr/share/man/man8 -- man/*.8
+
+ # doc/runlevels.html
+ mkdir -p "${pkgdir}"/etc/runit/runsvdir/default
+ ln -sT etc/runit/runsvdir/current "${pkgdir}"/service
+ # Don't include /etc/runit/runsvdir/current in the package; let it
+ # be managed at run-time by `runsvchdir`.
+
+ # doc/upgrade.html says to link /service->/etc/service FHS systems,
+ # but per doc/runlevels.html, /service is already a symlink.
+ ln -sT runit/runsvdir/current "${pkgdir}"/etc/service
+
+ # doc/upgrade.html, since 1.4
+ mkdir -p "${pkgdir}"/etc/sv
+
+ # install other assets to their FHS location, rather than their slashpackage location
+ install -d "$pkgdir/usr/share/doc"
+ cp -rLT doc "$pkgdir/usr/share/doc/$pkgname"
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" -- package/COPYING
}
-package_runit-doc() {
- pkgdesc='Documentation for the runit init system'
- groups=('init-doc')
- arch=('any')
- install -v -m755 -d "${pkgdir}/usr/share/doc"
- cp -r "${srcdir}/admin/${pkgbase}-${pkgver}/doc" "${pkgdir}/usr/share/doc/${pkgbase}-${pkgver}"
- rm "${pkgdir}/usr/share/doc/${pkgbase}-${pkgver}/debian"
+package_runit-replaceinit() {
+ pkgdesc='Use runit as a sysvinit replacment (base configuration)'
+ depends=('runit' 'sh' 'util-linux')
+ provides=('init')
+ conflicts=('init')
+ backup=(
+ etc/runit/{1,2,3,ctrlaltdel}
+ etc/runit/runsvdir/default/getty-5
+ etc/sv/getty-5/{run,finish}
+ )
+
+ install -d "${pkgdir}"/usr/bin "${pkgdir}"/etc/sv "${pkgdir}"/etc/runit/runsvdir/default
+
+ cd "${srcdir}/admin/${pkgbase}-${pkgver}"
+
+ # doc/replaceinit.html
+ mkdir -p "$pkgdir"/etc/runit
+ cp -p etc/debian/[123] "$pkgdir"/etc/runit/
+ mkdir -p "$pkgdir"/etc/sv/getty-5
+ cp -p etc/debian/getty-tty5/{run,finish} "$pkgdir"/etc/sv/getty-5/
+ cp -p etc/debian/ctrlaltdel "$pkgdir"/etc/runit/
+ ln -s /etc/sv/getty-5 "$pkgdir"/etc/runit/runsvdir/default/
+ ln -sT runit-init "${pkgdir}"/usr/bin/init
+
+ # doc/runlevels.html
+ sed -i '/^exec env/{
+ irunsvchdir default >/dev/null
+ i
+ }' "${pkgdir}"/etc/runit/2
+
+ # extra
+
+ # change from "getty RATE PORT TERM" to "agetty PORT RATE TERM"
+ sed -ri 's,\bgetty (\S+) (\S+) (\S+),agetty \2 \1 \3,' \
+ -- "$pkgdir"/etc/sv/getty-5/run
+
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" -- package/COPYING
}
diff --git a/pcr/runit/runit.install b/pcr/runit/runit.install
new file mode 100644
index 000000000..609fd90ae
--- /dev/null
+++ b/pcr/runit/runit.install
@@ -0,0 +1,7 @@
+#!/hint/bash
+
+post_install() {
+ if ! test -L etc/runit/runsvdir/current; then
+ ln -sfvT default etc/runit/runsvdir/current
+ fi
+}