summaryrefslogtreecommitdiff
path: root/aports/openrc/APKBUILD
blob: daff08bbe555fb4c96b69565f373073273e13e7c (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
147
148
# Maintainer: Gabor Pali <pali.gabor@gmail.com>
pkgname=openrc
pkgver=0.44.10
pkgrel=0 # base: 7
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="bsd-compat-headers linux-headers 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
	0009-fix-bootmisc-mv-error.patch
	0010-noexec-devfs.patch
	seedrng.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/common/version.h.in \
		src/common/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="
0e41f5268c6b8c325a6773511ca58c38ba52a1987aa47165794df8a99359bd1bfcb99d30e0d129b9242a2661663234f6f85c92c55c891dbb6c5b8a11d93edea4  openrc-0.44.10.tar.gz
6085d127f7385eb86a00676a263c8613748fb0cbbf064bc908d346a1b368e226d8a3014e871d281f57d334a70ec1301269fe431e085f0e907b4f6ef8a99bf07f  0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch
3f47b4f7e6c5b7fb53ff8a13470fbada67f7470e5eba71a683e6c022162c3905f560d561c3d61698e3fde367d6ae715edf76e99949f52a22a3bbf79debc33f64  0002-fsck-don-t-add-C0-to-busybox-fsck.patch
61c72be18283108163bde4349616e55adb535bd34312ee09f90fcd85277ffe17dcef792bbf465877c0d8b1fec87a3836f714d8d849a9cf322902a89bc1256e13  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
354b2df343ddf82aedba104039bbdb1dd5fdd9c4abac52f89e881341443b73fcf000ed9e8b88e9610f1c3218cb89722ff6a774e1ef2f7fe71fa6ff62b75f572b  0009-fix-bootmisc-mv-error.patch
0535d7837ae0c695f25208199f4dec3a4031558366da346a8a1dd13c0fa2a044f14088b75eca37ce0f4a681e85c82b84aac3d65aac9176639e82b33a9355cb2a  0010-noexec-devfs.patch
715af2188cf4d1ed42f75b31ad718f5c533ea6f8cfc3c5df0fd7fc4240cd342dc637b7edf358c5da1e77d700618adaa7927ddaeae60698dd9f130dd64d83d8d5  seedrng.patch
12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec  openrc.logrotate
493f27d588e64bb2bb542b32493ed05873f4724e8ad1751002982d7b4e07963cfb72f93603b2d678f305177cf9556d408a87b793744c6b7cd46cf9be4b744c02  hostname.initd
c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55  hwdrivers.initd
7113c930f7f5fb5b345b115db175f8e5837e3541b3e022d5cecf1b59067ed4b40b2adea2324a008035b97d653311217ac5cf961b4d0fc8b714a8b2505883cdc6  modules.initd
61857beb0ce1b462ff4bde595ee3808d12b1c51935e6a6bc263bf26a4adc99b434676277e270d82ed2886ceb9c82cb2a5604887bc25fef20bec223097c4d0ee4  modloop.initd
80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2  modloop.confd
d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88  sysfsconf.initd
990855f875513a85c2b737685ac5bfdfa86f8dadacf00c1826a456547f99b69d4ecf1b9a09c0ce002f1df618b44b1febabe53f95a2c0cd02b504d565bccb50c8  firstboot.initd
2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1  sysctl.initd
35682e1742196133b79e4a0b21fe8df039a982ba4fdd0181b1e3872f3885e40726179d4996fec83a1da11ff314d71f8910609c1c05acb3d0f9b923147e2f1d55  machine-id.initd
"