mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 23:36:46 +02:00
263 lines
11 KiB
Text
263 lines
11 KiB
Text
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
pkgname=openrc
|
|
pkgver=0.60.1
|
|
_ver=${pkgver/_git*/}
|
|
pkgrel=4
|
|
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
|
|
url="https://github.com/OpenRC/openrc"
|
|
arch="all"
|
|
license="BSD-2-Clause"
|
|
depends="ifupdown-any openrc-user=$pkgver-r$pkgrel"
|
|
makedepends_host="bsd-compat-headers libcap-dev linux-headers"
|
|
makedepends_build="meson scdoc"
|
|
checkdepends="sed"
|
|
subpackages="
|
|
$pkgname-dbg
|
|
$pkgname-doc
|
|
$pkgname-tools::noarch
|
|
$pkgname-static
|
|
$pkgname-dev
|
|
$pkgname-init:openrc_init
|
|
$pkgname-user:_user
|
|
agetty-openrc:_agetty_openrc:noarch
|
|
$pkgname-bash-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
install="$pkgname.post-install $pkgname.post-upgrade"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgver.tar.gz
|
|
0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch
|
|
0002-fsck-don-t-add-C0-to-busybox-fsck.patch
|
|
0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
|
|
0004-make-consolefont-service-compatible-with-busyboxs-se.patch
|
|
0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch
|
|
0006-Add-support-for-starting-services-in-a-specified-VRF.patch
|
|
0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch
|
|
0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch
|
|
0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch
|
|
0010-openrc-run-Fix-loading-of-user-configs-for-system-su.patch
|
|
0011-openrc-run-Support-standard-input-redirection-too.patch
|
|
|
|
supervise-daemon-defaults.patch
|
|
sysctl-readme.patch
|
|
|
|
295d6bd776bb084464ced877f7277d5c61f9cb83.patch
|
|
|
|
openrc.logrotate
|
|
hostname.initd
|
|
hwdrivers.initd
|
|
modules.initd
|
|
modloop.initd
|
|
networking.initd
|
|
modloop.confd
|
|
sysfsconf.initd
|
|
firstboot.initd
|
|
sysctl.initd
|
|
machine-id.initd
|
|
test-networking.sh
|
|
|
|
modules.7.scd
|
|
openrc-user.pam
|
|
"
|
|
options="!check" # not updated to meson build system, require makefile build
|
|
provides="ifupdown-ng-openrc=0.12.1-r4"
|
|
replaces="alpine-baselayout" # due to move of mkmntdirs
|
|
|
|
if [ -z "$BOOTSTRAP" ]; then
|
|
makedepends_host="$makedepends_host linux-pam-dev"
|
|
subpackages="$subpackages $pkgname-user-pam:_user_pam"
|
|
fi
|
|
|
|
# secfixes:
|
|
# 0.44.6-r1:
|
|
# - CVE-2021-42341
|
|
|
|
prepare() {
|
|
default_prepare
|
|
# meson overrides this with the aports tag,
|
|
# we get there first :)
|
|
sed -i -e "s|@VCS_TAG@|$pkgver|" \
|
|
src/shared/version.h.in \
|
|
src/shared/version.in
|
|
}
|
|
|
|
_build() {
|
|
if [ -z "$BOOTSTRAP" ]; then
|
|
local lto="-Db_lto=true"
|
|
fi
|
|
abuild-meson \
|
|
$lto \
|
|
-Dos=Linux \
|
|
-Dzsh-completions=true \
|
|
-Dbash-completions=true \
|
|
-Dpkgconfig=true \
|
|
--default-library=both \
|
|
--prefix=/ \
|
|
--bindir=/bin \
|
|
--sbindir=/sbin \
|
|
"$@"
|
|
}
|
|
|
|
build() {
|
|
_build -Dpam=false output
|
|
ninja -C output
|
|
|
|
if [ -z "$BOOTSTRAP" ]; then
|
|
_build -Dpam=true output-pam
|
|
|
|
# Only (re)compile OpenRC user related files with PAM support
|
|
# since only those are shipped by the openrc-user-pam subpackage.
|
|
ninja -C output-pam src/openrc-user/openrc-user \
|
|
src/pam_openrc/pam_openrc.so
|
|
fi
|
|
}
|
|
|
|
check() {
|
|
make check
|
|
|
|
# run unit tests for networking.initd
|
|
#cd "$srcdir"
|
|
#( set -e; sh test-networking.sh )
|
|
}
|
|
|
|
package() {
|
|
local i j
|
|
|
|
DESTDIR="$pkgdir" meson install --no-rebuild -C output
|
|
|
|
# If we are not bootstrapping, also provide a subpackage with
|
|
# PAM support in openrc-user for autostarting user services.
|
|
if [ -z "$BOOTSTRAP" ]; then
|
|
# Use different binary name for openrc-user to avoid a conflict
|
|
# regarding the debugging symbols provided in the openrc-dbg package.
|
|
install -D output-pam/src/openrc-user/openrc-user \
|
|
"$pkgdir"/usr/libexec/rc/bin/openrc-user-pam
|
|
install -D output-pam/src/pam_openrc/pam_openrc.so \
|
|
-t "$pkgdir"/usr/lib/security/
|
|
fi
|
|
|
|
# we cannot have anything turned on by default
|
|
rm -f "$pkgdir"/etc/runlevels/*/*
|
|
|
|
# we still use our ifup/ifdown based net config
|
|
rm -f "$pkgdir"/etc/conf.d/network "$pkgdir"/etc/init.d/network
|
|
|
|
# our hostname init script reads hostname from /etc/hostname
|
|
rm -f "$pkgdir"/etc/conf.d/hostname
|
|
|
|
# we override some of the scripts
|
|
for i in "$srcdir"/*.initd; do
|
|
j=${i##*/}
|
|
install -Dm755 $i "$pkgdir"/etc/init.d/${j%.initd}
|
|
done
|
|
|
|
# we override some of the conf.d files
|
|
for i in "$srcdir"/*.confd; do
|
|
j=${i##*/}
|
|
install -Dm644 $i "$pkgdir"/etc/conf.d/${j%.confd}
|
|
done
|
|
|
|
# additional documentation considered useful
|
|
mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
|
|
install -m644 ./*.md "$pkgdir"/usr/share/doc/$pkgname/
|
|
|
|
scdoc < "$srcdir/modules.7.scd" > modules.7
|
|
install -Dm644 modules.7 -t "$pkgdir/usr/share/man/man7/"
|
|
ln -s modules.7 "$pkgdir/usr/share/man/man7/modules-load.7"
|
|
|
|
# we use a virtual keymaps services to allow users to set their
|
|
# keymaps either with the OpenRC loadkeys service provided by
|
|
# the kbd aport or with the loadkmap service provided by the
|
|
# busybox-openrc aport.
|
|
rm -f "$pkgdir/etc/init.d/keymaps" \
|
|
"$pkgdir/etc/conf.d/keymaps"
|
|
|
|
install -Dm644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"
|
|
install -d "$pkgdir"/etc/local.d
|
|
|
|
# openrc upstream removed service(8) for whatever reason, put it back
|
|
ln -s rc-service "$pkgdir"/sbin/service
|
|
|
|
install -Dm755 "$pkgdir"/usr/share/openrc/support/deptree2dot/deptree2dot \
|
|
-t "$pkgdir"/usr/bin/
|
|
rm -r "$pkgdir"/usr/share/openrc/support/deptree2dot/deptree2dot
|
|
}
|
|
|
|
doc() {
|
|
default_doc
|
|
amove usr/share/openrc/support
|
|
}
|
|
|
|
tools() {
|
|
depends="perl"
|
|
amove usr/bin/deptree2dot
|
|
}
|
|
|
|
_agetty_openrc() {
|
|
pkgdesc="agetty program from util-linux (OpenRC init scripts)"
|
|
install_if="agetty openrc=$pkgver-r$pkgrel"
|
|
|
|
amove etc/init.d/agetty
|
|
amove etc/conf.d/agetty
|
|
}
|
|
|
|
openrc_init() {
|
|
pkgdesc="OpenRC init process"
|
|
|
|
# Alpine does not use openrc as its init by default
|
|
amove sbin/openrc-init
|
|
amove sbin/openrc-shutdown
|
|
}
|
|
|
|
_user() {
|
|
pkgdesc="OpenRC user services without PAM support"
|
|
depends=""
|
|
provider_priority=100 # highest
|
|
|
|
amove usr/libexec/rc/bin/openrc-user
|
|
}
|
|
|
|
_user_pam() {
|
|
pkgdesc="OpenRC user services with PAM support"
|
|
depends=""
|
|
provides="openrc-user=$pkgver-r$pkgrel"
|
|
provider_priority=1 # lowest
|
|
|
|
amove usr/lib/security/pam_openrc.so
|
|
amove usr/libexec/rc/bin/openrc-user-pam
|
|
ln -s openrc-user-pam "$subpkgdir"/usr/libexec/rc/bin/openrc-user
|
|
|
|
install -Dm644 "$srcdir"/openrc-user.pam \
|
|
"$subpkgdir"/etc/pam.d/openrc-user
|
|
}
|
|
|
|
sha512sums="
|
|
aa0be312ff5b1dc02c09dded0c52e7819947f6169c79b102090794a242db921eebca505b005bfe746d807b473d61479a357db9c80b854fddaef48a93dab2c2bb openrc-0.60.1.tar.gz
|
|
257861f5f0562e9b9a9fccebae474bd75c4bb51f005a2b8132fd551f061f65863de46c5bc4437f137b4a9d3ca741f9de9274bfa7b418eda70497ed4b5fd3056d 0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch
|
|
3f47b4f7e6c5b7fb53ff8a13470fbada67f7470e5eba71a683e6c022162c3905f560d561c3d61698e3fde367d6ae715edf76e99949f52a22a3bbf79debc33f64 0002-fsck-don-t-add-C0-to-busybox-fsck.patch
|
|
77b058a70cab37ad662a57fa69411b6275853ac41423e0a799ba980578d8e18d3d2ae2c2a6f5a3ba5779aeec273d7c4c2a14e8fdb31d0a6b383f2e8a64a4ed2f 0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
|
|
71a743bf969110a27259405ef4b4dc4fad608b8e49039fd6afb1b1486d0f1dfccc3ef5275410fa3d6d1554ccee59c5a3424be4f2919e14453ebb709282c588a7 0004-make-consolefont-service-compatible-with-busyboxs-se.patch
|
|
9e2ae6c8e189ceae0f3f2662d9504f796e9a6a987a26ee2e10add85746b6596eb04cc256dc532a39f711b4e1aa07f1d12a384ef45d23cab49878b887bf0a878c 0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch
|
|
aa44e62392c47c5f20a66072574ae452be0c1b0c4914bb58fa35b6ecc3e2a75c7a2d6245198e30a8ad5fb96db30644425637f64effcf60559c16a978bb29b2cb 0006-Add-support-for-starting-services-in-a-specified-VRF.patch
|
|
431ac28808e684bea5511386bf5f06efe7f509f1dbe7e15ae6309563d813deae8f3edd872a0943ef8088e3cf778d7bc5ebd15a893dc4a08f4022b7a56bbafc63 0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch
|
|
475f4ea63b9b5d7eb9c623e96b6cc3d3072abcb7194d0045b84e0688836c8514fccfc68b0eae0b4bee60878cdea8042c3ce7e48406ee7a2f0e4a3e128a153468 0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch
|
|
d7b8b1facd7fb9a6a8350912644cce3956947bcaa8bcb645f9c26a2bb0d062970efaa14bd66a7987f0748daff7b5a8e701b45b3fcca7c7c7e393ac262728f1a6 0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch
|
|
1fa65d7b692a5647cc2db61506f2801a874e7bebec8b4380929431e13a0b32bd76ec892ef818b0de6765a7297e75e64eccfea0a210166ee4d5b97e419a636555 0010-openrc-run-Fix-loading-of-user-configs-for-system-su.patch
|
|
30183429c98be9ee3f0cc3ce2d3e8a17592ec4a9500ac9c020630242146fe6af1ea9f865859b91fce58bf78eddf749cb295f7c75d783317ce882d1ec8d14016c 0011-openrc-run-Support-standard-input-redirection-too.patch
|
|
86a2fb1564b8537f5dd7e06587a572ebefd110bf8bea049bc2254d4008ed3fed2296b4e9fde793ddbed7a66f70335b6c228f0b10fc0a6e7d106d3ad226fc0ba4 supervise-daemon-defaults.patch
|
|
903ff555275a67ff08da91badb55d9fa6c6a2901e8ef09ca8366bd74d69757491c8336347f04551268ecf053c8ae974f50decd869926894dd94e382008e3e925 sysctl-readme.patch
|
|
e441b5ad8e3d1a4ea6cc18e831fc0ad88d2b217294d0ff75e523d74654bc86774f77cbeb1ab89f7c41568a32a35b86eabdcb0652029c9dfcf70208ca1b66884a 295d6bd776bb084464ced877f7277d5c61f9cb83.patch
|
|
12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec openrc.logrotate
|
|
afbb4cb4f2d6c2a5cf81ee2b5da8dfcd1f573e8168f1f3586681222ccfc59d6dda65eca3f2cb97c94ce7af4da60db0c4c6c643c014358dcecf94a6152466c89c hostname.initd
|
|
594d0b8c8a8eafdcbf6f566ec43797cbe98debfa5d9ee8b2e78344d8031184c23cf1a22588fbb4b0aaf2769458bef233332b4f8da71337db4df6a431c4bafa8f hwdrivers.initd
|
|
bc152c2b5eb37a08035f289b21e85d41461914e8b1f3c6a6a87ba0dd0cfeb20c9a5e6d7dab132e345339245a7ae1ffcb741f5bfde76fb8e0c87e4de5e0b1faf0 modules.initd
|
|
47bea7e48444fc15f30b1da168e3d33b124c7f3480e08adcf93c5d301504cc6e73d96b254833fe20e906e353053eba8e8f410f238a3d4cd65743718a800939e5 modloop.initd
|
|
aa1dd3d31872d7ec308b534044e490136de47a3e72575a96522f60c5740ee3b953a17e05013359d27985ac16b048ff8fff76e8ac1103802a4fb75a31d2185d45 networking.initd
|
|
80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd
|
|
d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd
|
|
990855f875513a85c2b737685ac5bfdfa86f8dadacf00c1826a456547f99b69d4ecf1b9a09c0ce002f1df618b44b1febabe53f95a2c0cd02b504d565bccb50c8 firstboot.initd
|
|
2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1 sysctl.initd
|
|
a60129f4bed134a27773c61994d114b3a5d1ab9f20097b096956f5bb696c056f4a608577cabb34c32b51899c69dce3bd0d8ffa61f5b66fd00fc5085d1ebba54f machine-id.initd
|
|
af17947aa3954e317dc06580da829200e0b0f2ddc37ce842c3fc7fc0d8ca2f40220e4f4665f61b4b5ec47c96416db0127e2ed979b9421bf21df89d4c4f998b7f test-networking.sh
|
|
edf23bbec3c67457f3039d193cd3a756a079ab080e5e3d87e724a1a0d9be86b82797bf2bf5280fbf33d1c60b98e3859d9d9c265f8119a84ccdcaa9937ab72296 modules.7.scd
|
|
fa0be773e472f913d83539de4f86b121331ada79ebaf76e01d23f9631604ae2fef7edab993b7071def6ccab0adc15a4b31cf1527441b9fa01a714f0b570023ec openrc-user.pam
|
|
"
|