aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/APKBUILD
blob: 90577059d5ef53f5849e3f30163a6c7a620bb241 (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openrc
pkgver=0.42.1
_ver=${pkgver/_git*/}
pkgrel=21
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"
checkdepends="sed"
subpackages="$pkgname-doc $pkgname-dev $pkgname-dbg
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
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-force-root-be-rw-before-localmount.patch
	0004-hide-error-when-migrating-var-run-to-run.patch
	0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
	0007-make-consolefont-service-compatible-with-busyboxs-se.patch
	0001-fsck-don-t-add-C0-to-busybox-fsck.patch
	0008-fix-undeclared-UT_LINESIZE.patch
	0009-Support-early-loading-of-keymap-if-kdb-is-installed.patch
	0010-rc-mount-make-timeout-invocation-compatible-with-bus.patch
	0011-vrf.patch
	0012-gcc-10.patch
	0013-fix-osclock.patch
	0014-time_t-64bit.patch
	0015-CVE-2018-21269.patch
	0016-fix-typo-synbolic-symbolic.patch
	0017-checkpath-replace-mkdir-with-mkdirat.patch
	0018-checkpath-remove-extra-slashes.patch
	0019-checkpath-fix-code-to-walk-the-directory-path.patch

	seedrng.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
	"

# secfixes:
#   0.42.1-r20:
#     - CVE-2018-21269

prepare() {
	default_prepare
	sed -i -e '/^sed/d' "$builddir"/pkgconfig/Makefile
}

build() {
	export MKZSHCOMP=yes
	export MKBASHCOMP=yes
	make LIBEXECDIR=/lib/rc
}

check() {
	make check

	# run unit tests for networking.initd
	#cd "$srcdir"
	#( set -e; sh test-networking.sh )
}

package() {
	local i j

	make LIBEXECDIR=/lib/rc DESTDIR="$pkgdir/" install

	# 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 ChangeLog *.md "$pkgdir"/usr/share/doc/$pkgname/

	# 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
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion
	mv "$pkgdir"/usr/share/bash-completion/completions \
		"$subpkgdir"/usr/share/bash-completion
	rm -rf "$pkgdir"/usr/share/bash-completion
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh
	mv "$pkgdir"/usr/share/zsh/site-functions \
		"$subpkgdir"/usr/share/zsh
	rm -rf "$pkgdir"/usr/share/zsh
}

sha512sums="
579b9bfbb151b945a364a2c12b037d2e15991820ca99a07ac18e9bdc50074e67fbf0dcf9865aa4deabe2bf82092e4623be51c9e0b4014384951e0a92ac1e7646  openrc-0.42.1.tar.gz
71fce711adbcb411189a089f1d49567c50348e12c42b7a9c9b582dae5d18051f88ccf81c768337e87d6792d953e84d1e8b93d7978a1947d7d20ef3b1cd330875  0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch
b1cedd38badda4fc308decdff06f9644b96fe35617792da8d6d62407409841705fd71b5b57d1804a6395095604a70898f80830c76395ec99f715038a0809d815  0002-force-root-be-rw-before-localmount.patch
d54630d40a2d6b10a325cb012d4efcda997a60c008ca953ce5d60059d3f267308a59dabddf93a5fc0d301aa91967137d144effbe5f574394af768ce4ebc48738  0004-hide-error-when-migrating-var-run-to-run.patch
39a35c54ec9112fe84c901ed155a711cec8e194af02d5483ee60b80743dab12391e6fdc7b3da2f86844dd4edcf53e681ff95bd4d6fa1101a89ce54dce2ddbb7c  0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
234c4f3cf39df3350dbea25c00b8d584794b28194f44c726767a6a16d91a26fee1b5d2dd16635f19803fc015b4e9d99c52b23128e6b815938b88365feba8cf59  0007-make-consolefont-service-compatible-with-busyboxs-se.patch
dbe3f170440f0f357f31ac4d49c56a9a7ec22172df2701bf4a0afdee22aedda1f88b9fa5ffdbe19a5eea3c764ad0e4c802e19b95b7082a72d423d46d30c18edd  0001-fsck-don-t-add-C0-to-busybox-fsck.patch
d2b8700f56b05579926352855de8fcee5cf78f0c13200643a5195f8c60e2b5082d476b42cc77b13246b9fb883aa002d723237b0fc7ae84ccd7ebe3b25690cf50  0008-fix-undeclared-UT_LINESIZE.patch
667085d89e194f7e2255d5c098c3d8de272f54cb925710cb98d5e7a6b58982d0acfe15f97b574cfc646b139cd7aa5b527ba700ef9b8048a6d6d9dee8cc74913c  0009-Support-early-loading-of-keymap-if-kdb-is-installed.patch
ff9bf2f6e4f55633a9641385398f70a2e591e2b3b56b1903f168a97b07bd56dc5a65d151deeab94229452b2e892b597c16dc3d57d5d47ec35a48cf5343190c36  0010-rc-mount-make-timeout-invocation-compatible-with-bus.patch
34c5b1157d9f1e26f9c9121b649f7a31c32f3bdd62a17f451d3391f276ec8ca82623c1b917506867647523d18a1ee665a17d261ac12ff1732ab5c19cfaf91aac  0011-vrf.patch
24c665098475c8a1dca75677b48864dc554930f8039900785d8f73c4ebab857255607297fdcbce6249f18f2b97bd7804a35a782721d4658a1c7a7b7b985418ff  0012-gcc-10.patch
4dca5fb25dc9cf356716042650e3b50969b4749f4e839505f87054d45ca074931ac9ef9aca6b6be4f36cc82c46e838a9e9122ee27154de703d8d9eb7b6f6273b  0013-fix-osclock.patch
af0d5a3e6bdd09abd65174a0292450ebb79116a6be50ad4dc368e7ade497020bf4f7d55487335eb32067616603c7d9c3f8596228064c93bfd47596fb12ef7215  0014-time_t-64bit.patch
715016b4f481a6d4d2ab37d23659e6cacc023b02fa6908b566391ee2744369076ea74e54f0fe576e2cc1d3371d4d9e3818395ca3f417233358fc70a9edc4dba6  0015-CVE-2018-21269.patch
95a5e825836be935009d233d8e4e00707bf2fda0ff3f01f97a10a4a3a0a42eded0a235a008345bf4b89a60bc363bad05ff0a98c00dd179a4b56c573523f17630  0016-fix-typo-synbolic-symbolic.patch
cdad2ee011efa0ec38c27243cfec6f4353b6a1d9de3bff29e79e1c341e45bd4ef29aa1f641363a50246a3a876b8668b66971f59c857e979a2beb41fb5a25a327  0017-checkpath-replace-mkdir-with-mkdirat.patch
3c502dda023387c852e1fe92e873ca88ff9e6311a870f3f5317e9529b9513e0c42b8b7241ba6546129530e42a64f7c61b074fc1cb262c3228aabaf83db1cc1d8  0018-checkpath-remove-extra-slashes.patch
90e50369c04a4b2c4e5924f9ae084d69f6d3d09a3bd7c902a7e3797d5d52c725e1a4033e5c554f104807f3a7ecbb3ab2ecb89636680d69024fd0ec123866a35b  0019-checkpath-fix-code-to-walk-the-directory-path.patch
e204fef5e5d1e8da140c43f42f0eb97283cb56c02193d137f56217cfd7b9ae0dfad5954fb8d1ce0fcb63c20537551ba706e7fd09f3f012fc2a6a0c1106d2540b  seedrng.patch
12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec  openrc.logrotate
493f27d588e64bb2bb542b32493ed05873f4724e8ad1751002982d7b4e07963cfb72f93603b2d678f305177cf9556d408a87b793744c6b7cd46cf9be4b744c02  hostname.initd
c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55  hwdrivers.initd
7113c930f7f5fb5b345b115db175f8e5837e3541b3e022d5cecf1b59067ed4b40b2adea2324a008035b97d653311217ac5cf961b4d0fc8b714a8b2505883cdc6  modules.initd
c1615dbeb18e2f988237ecbef830a01fd79970365a799e8704abefab9c716ab45553b3c15f1e3d24320d422fd25d21ab38f519f0edd4ca25cf19846713195ae1  modloop.initd
7883ed880c49db3f7fb7598c8cc01f9830ccb5f70b64ed620213baf4900289a718d89a5f7bf97dc94593465eb0e1e3ed126b19dfeaaf9d03a7c46e4e7b6c4472  networking.initd
80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2  modloop.confd
d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88  sysfsconf.initd
990855f875513a85c2b737685ac5bfdfa86f8dadacf00c1826a456547f99b69d4ecf1b9a09c0ce002f1df618b44b1febabe53f95a2c0cd02b504d565bccb50c8  firstboot.initd
2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1  sysctl.initd
35682e1742196133b79e4a0b21fe8df039a982ba4fdd0181b1e3872f3885e40726179d4996fec83a1da11ff314d71f8910609c1c05acb3d0f9b923147e2f1d55  machine-id.initd
af17947aa3954e317dc06580da829200e0b0f2ddc37ce842c3fc7fc0d8ca2f40220e4f4665f61b4b5ec47c96416db0127e2ed979b9421bf21df89d4c4f998b7f  test-networking.sh
"