summaryrefslogtreecommitdiff
path: root/aports/openrc/APKBUILD
blob: 7efd42ec217f76e2f027a8e1f5997c9d0ea2c8b1 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Maintainer: Gabor Pali <pali.gabor@gmail.com>
pkgname=openrc
pkgver=0.48
pkgrel=0 # base: 0
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"
makedepends_host="bsd-compat-headers libcap-dev linux-headers"
makedepends_build="meson"
checkdepends=
subpackages=
install=
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

	supervise-daemon-defaults.patch

	openrc.logrotate
	hostname.initd
	hwdrivers.initd
	modules.initd
	modloop.initd
	modloop.confd
	sysfsconf.initd
	firstboot.initd
	sysctl.initd
	machine-id.initd
	"
options="!check" # not updated to meson build system, require makefile build

# 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() {
	abuild-meson \
		-Dzsh-completions=false \
		-Dbash-completions=false \
		-Dpam=false \
		-Dsplit-usr=false \
		-Dpkgconfig=false \
		--default-library=both \
		--prefix=/ \
		--libdir=/usr/lib \
		--libexecdir=/lib \
		--bindir=/bin \
		--sbindir=/sbin \
		. output
	meson compile -C output
}

package() {
	local i j

	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	# Alpine does not use openrc as its init so delete
	# openrc-init & openrc-shutdown to avoid confusion.
	rm -f "$pkgdir"/sbin/openrc-init "$pkgdir"/sbin/openrc-shutdown

	# 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

	# 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-initscripts 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 "$pkgdir"/run

	# openrc upstream removed service(8) for whatever reason, put it back
	ln -s /sbin/rc-service "$pkgdir"/sbin/service

	# remove deprecated /sbin/runscript to avoid conflict with minicom
	rm "$pkgdir"/sbin/runscript

	rm -rf "$pkgdir"/usr/share/man \
		"$pkgdir"/usr/share/openrc \
		"$pkgdir"/usr/include \
		"$pkgdir"/usr/lib/pkgconfig \
		"$pkgdir"/etc/sysctl.d/README \
		"$pkgdir"/etc/local.d/README
}

sha512sums="
c67c0a1c87f44a6fde0a7634fcdff0683a821eef5183a4f3e1ef850d04dd7f6c23ec0a72b4a76d9f6c08cb34e362d5e204937caec549eadc638c286c2389c5ee  openrc-0.48.tar.gz
257861f5f0562e9b9a9fccebae474bd75c4bb51f005a2b8132fd551f061f65863de46c5bc4437f137b4a9d3ca741f9de9274bfa7b418eda70497ed4b5fd3056d  0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch
3f47b4f7e6c5b7fb53ff8a13470fbada67f7470e5eba71a683e6c022162c3905f560d561c3d61698e3fde367d6ae715edf76e99949f52a22a3bbf79debc33f64  0002-fsck-don-t-add-C0-to-busybox-fsck.patch
0bd69d9e8e9c321a5e67cf924be07b9dd0b58801143c18f74bebf442958fc878e46a65f07cc2842566a8c3434e788ef3ca0c90c607de6b10931f01324bfc1b11  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
8bf00b82d7fc0eb1b529ec735009f91d277141ba7e5c04e23d10bbcf36eb453f0b31d48aec45e50b5be4c14f611acc4454933f3cefdf8beab07d851328223464  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
1323a8476580f7b56a9cf1b24b26b10da76c5916cf23d7dab01f08a3261751341dfe01d1ed884df8e6ea17ff6a52021cc40fb3101e99b77d4ae7f3f61ee330e8  supervise-daemon-defaults.patch
12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec  openrc.logrotate
493f27d588e64bb2bb542b32493ed05873f4724e8ad1751002982d7b4e07963cfb72f93603b2d678f305177cf9556d408a87b793744c6b7cd46cf9be4b744c02  hostname.initd
787d783f91919c115809890f18d06d0812055f0aca42378e081d2cfbe2ff20a1db8d937b823ec4adbe0d380a6f02a2310dc74f6c3a2c36fd5d5371d51ad6d459  hwdrivers.initd
7113c930f7f5fb5b345b115db175f8e5837e3541b3e022d5cecf1b59067ed4b40b2adea2324a008035b97d653311217ac5cf961b4d0fc8b714a8b2505883cdc6  modules.initd
61857beb0ce1b462ff4bde595ee3808d12b1c51935e6a6bc263bf26a4adc99b434676277e270d82ed2886ceb9c82cb2a5604887bc25fef20bec223097c4d0ee4  modloop.initd
80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2  modloop.confd
d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88  sysfsconf.initd
990855f875513a85c2b737685ac5bfdfa86f8dadacf00c1826a456547f99b69d4ecf1b9a09c0ce002f1df618b44b1febabe53f95a2c0cd02b504d565bccb50c8  firstboot.initd
2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1  sysctl.initd
35682e1742196133b79e4a0b21fe8df039a982ba4fdd0181b1e3872f3885e40726179d4996fec83a1da11ff314d71f8910609c1c05acb3d0f9b923147e2f1d55  machine-id.initd
"