aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/APKBUILD
blob: 6f6f5642b16061b618a7546f0b8e14d1c33cc7e6 (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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Contributor: Roger Pau Monne <roger.pau@entel.upc.edu>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
pkgver=4.4.1
pkgrel=8
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
arch="x86_64"
license="GPL"
depends="syslinux bash iproute2 logrotate"
depends_dev="openssl-dev python-dev e2fsprogs-dev gettext zlib-dev ncurses-dev
	dev86 texinfo perl iasl pciutils-dev glib-dev yajl-dev
	spice-dev gnutls-dev curl-dev libaio-dev lzo-dev xz-dev util-linux-dev
	e2fsprogs-dev linux-headers"
makedepends="$depends_dev autoconf automake libtool"
install=""
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-hypervisor
	py-$pkgname:_py"
source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz
	xsa108.patch
	xsa109.patch
	xsa110.patch
	xsa111.patch
	xsa112.patch
	xsa113.patch
	xsa114-4.4.patch
	xsa116.patch
	xsa118-4.4.patch

	qemu-coroutine-gthread.patch
	qemu-xen-musl-openpty.patch
	qemu-xen_paths.patch

	hotplug-vif-vtrill.patch
	0001-ipxe-dont-clobber-ebp.patch

	init-xenstore-domain.patch

	musl-support.patch
	musl-hvmloader-fix-stdint.patch
	stdint_local.h
	elf_local.h

	xen-hotplug-lockfd.patch
	xen-fd-is-file.c

	xenstored.initd
	xenstored.confd
	xenconsoled.initd
	xenconsoled.confd
	xendomains.initd
	xendomains.confd
	xen-consoles.logrotate
	xenqemu.confd
	xenqemu.initd
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"

	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	# install our stdint_local.h and elf_local.h
	install "$srcdir"/stdint_local.h "$srcdir"/elf_local.h \
		"$_builddir"/tools/firmware/ || return 1

	# remove all -Werror
	msg "Eradicating -Werror..."
	find . -name '*.mk' -o -name 'Make*' | xargs sed -i -e 's/-Werror//g' \
		|| return 1

	msg "Updating config.sub..."
	update_config_sub || return 1

	msg "Autoreconf..."
	autoreconf || return 1

	unset CFLAGS
	unset LDFLAGS
}

# Unset CFLAGS and LDFLAGS because the xen build system
# doesn't support them. Instead use .config in xen root
# folder if necessary.
munge_cflags() {
	msg "Munging CFLAGS..."

	unset CFLAGS
	unset LDFLAGS
	unset LANG
	unset LC_ALL
}

# These tasks are added as separate tasks to enable a packager
# to invoke specific tasks like building the hypervisor.  i.e.
#    $ abuild configure build_tools
configure() {
	cd "$_builddir"

	msg "Running configure..."
	./configure --prefix=/usr \
		--build=$CBUILD \
		--host=$CHOST \
		|| return 1
}

build_hypervisor() {
	munge_cflags

	msg "Building hypervisor..."
	make xen || return 1
}

build_tools() {
	munge_cflags

	msg "Building tools..."
	make tools || return 1
}

build_docs() {
	munge_cflags

	msg "Building documentation..."
	make docs || return 1
}

build_stubdom() {
	munge_cflags

	msg "Building stub domains..."
	make stubdom || return 1
}

build() {
	cd "$_builddir"

	configure || return 1
	build_hypervisor || return 1
	build_tools || return 1
	build_docs || return 1
	build_stubdom || return 1

	${CC:-gcc} -o xen-fd-is-file "$srcdir"/xen-fd-is-file.c
}

package() {
	cd "$_builddir"

	unset CFLAGS
	unset LDFLAGS

	make -j1 DESTDIR="$pkgdir" install-xen install-tools install-docs \
		install-stubdom || return 1

	# remove default xencommons
	rm -rf "$pkgdir"/etc/init.d/xencommons

	for i in $source; do
		case $i in
		*.initd) install -Dm755 "$srcdir"/$i \
				"$pkgdir"/etc/init.d/${i%.*};;
		*.confd) install -Dm644 "$srcdir"/$i \
				"$pkgdir"/etc/conf.d/${i%.*};;
		esac
	done
	install -Dm644 "$srcdir"/xen-consoles.logrotate \
		"$pkgdir"/etc/xen/xen-consoles.logrotate

	install -m755 xen-fd-is-file "$pkgdir"/usr/lib/xen/bin/xen-fd-is-file
}

libs() {
	pkgdesc="Libraries for Xen tools"
	replaces="xen"
	depends=
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.so.* \
		"$pkgdir"/usr/lib/fs \
		"$subpkgdir"/usr/lib/
}

hypervisor() {
	pkgdesc="Xen hypervisor"
	depends=
	mkdir -p "$subpkgdir"
	mv "$pkgdir"/boot "$subpkgdir"/
}

_py() {
	pkdesc="Python bindings and tools for Xen"
	depends=
	mkdir -p "$subpkgdir"/usr/lib/xen/bin \
		"$subpkgdir"/usr/bin \
		"$subpkgdir"/usr/sbin \
		|| return 1
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/bin/xencons \
		"$pkgdir"/usr/bin/xentrace_format \
		"$subpkgdir"/usr/bin/ || return 1
	mv "$pkgdir"/usr/sbin/xenmon.py \
		"$pkgdir"/usr/sbin/xen-ringwatch \
		"$pkgdir"/usr/sbin/xen-python-path \
		"$subpkgdir"/usr/sbin/ || return 1
	mv "$pkgdir"/usr/lib/xen/bin/pygrub \
		"$pkgdir"/usr/lib/xen/bin/xenpvnetboot \
		"$subpkgdir"/usr/lib/xen/bin/ || return 1

	# verify we dont have any python deps in main package left
	if find "$pkgdir" -type f -print 0 | xargs -0 file --mime-type \
			| grep python; then
		return 1
	fi
}

md5sums="1868433f393503000877d15cd4e93d15  xen-4.4.1.tar.gz
1f66f6c52941309c825f60e1bf144987  xsa108.patch
c8bd3d689db98dddee53f6ad97010ada  xsa109.patch
e8d2d4ca0c48570c8b0da7505e2e0d34  xsa110.patch
887c8ca8b57d07e22dfd18890493dd47  xsa111.patch
e0f14ff509c91b324e367ee35f024b85  xsa112.patch
8c802cd95e29ecb085a8c436d3539c36  xsa113.patch
7566238066a655770dfba9fe30e3a347  xsa114-4.4.patch
6f0ed43665d54dada7a8ff10ec53563c  xsa116.patch
afd7d4f04a5d1241dd1a375619a9ee8e  xsa118-4.4.patch
de1a3db370b87cfb0bddb51796b50315  qemu-coroutine-gthread.patch
dd8603eaab5857816843bfc37647d569  qemu-xen-musl-openpty.patch
c4d2d95ae3e5f538b7145becb3c6098e  qemu-xen_paths.patch
e449bb3359b490804ffc7b0ae08d62a0  hotplug-vif-vtrill.patch
229539a822e14a6a62babffd71ecfbf3  0001-ipxe-dont-clobber-ebp.patch
08a30d56902b660f5102a5c208e545c9  init-xenstore-domain.patch
f7aa282a27f270a923f229f2040cd7b5  musl-support.patch
2b1afbf120b69c5d14c846178378116b  musl-hvmloader-fix-stdint.patch
c9313a790faa727205627a1657b9bf06  stdint_local.h
c13f954d041a6fa78d0d241ad1780c0b  elf_local.h
750138c31ec96d1a11fe0c665ac07e9e  xen-hotplug-lockfd.patch
649f77b90978cd2b6d506ac44ec6c393  xen-fd-is-file.c
821ebcac530998cc3c93925aaf9451c4  xenstored.initd
d86504e12f05deca6b3eeeb90157160e  xenstored.confd
ed262f15fb880badb53575539468646c  xenconsoled.initd
ec2252c72050d7d5870a3a629b873ba6  xenconsoled.confd
1877044e61a18700c8d6a998c9095d23  xendomains.initd
dcdd1de2c29e469e834a02ede4f47806  xendomains.confd
9df68ac65dc3f372f5d61183abdc83ff  xen-consoles.logrotate
6a2f777c16678d84039acf670d86fff6  xenqemu.confd
f9afbf39e2b5a7d9dde60ebbd249ea7d  xenqemu.initd"
sha256sums="55b49d3c4575d7791275125ff87c0f86f1d1e0f7f2718b6fd1c4f88a9bc7ea25  xen-4.4.1.tar.gz
cf7ecf4b4680c09e8b1f03980d8350a0e1e7eb03060031788f972e0d4d47203e  xsa108.patch
729b87c2b9979fbda47c96e934db6fcfaeb10e07b4cfd66bb1e9f746a908576b  xsa109.patch
eac4691848dcd093903e0a0f5fd7ab15be15d0f10b98575379911e91e5dcbd70  xsa110.patch
3c418f065cd452c225af34c3cccf9bdbc37efb6c6a5fc5940fd83ad8620510d3  xsa111.patch
cc39a4cdcb52929ed36ab696807d2405aa552177a6f029d8a1a52041ca1ed519  xsa112.patch
a0f2b792a6b4648151f85fe13961b0bf309a568ed03e1b1d4ea01e4eabf1b18e  xsa113.patch
b35ed8710693163cc33772c36e4c17dc76e25a0b2025fff4a5aa3b46c459938a  xsa114-4.4.patch
84b5a7bb2386e3d95d9d836a4a2504870723694ddaf537f1b59db75b7c63e9bd  xsa116.patch
5741cfe408273bd80e1a03c21a5650f963d7103fd022c688730f55dcf5373433  xsa118-4.4.patch
3941f99b49c7e8dafc9fae8aad2136a14c6d84533cd542cc5f1040a41ef7c6fe  qemu-coroutine-gthread.patch
fe76c7c8faf686060b20491bfed4a13ce37b1bc3dcdbf33d242e388cee14c7c1  qemu-xen-musl-openpty.patch
a6ccc0ed0dab8465188f92ceb3c983f10d65cd93bb2c8bab4e4155ef13536f5d  qemu-xen_paths.patch
dd1e784bc455eb62cb85b3fa24bfc34f575ceaab9597ef6a2f1ee7ff7b3cae0a  hotplug-vif-vtrill.patch
751ef06569de66578b8713dc170976832b0671ac2696f32eb9ad69d60332d594  0001-ipxe-dont-clobber-ebp.patch
0204d69804e83864cd6b2122f51b9c1940588158a35c159a7ef0c3b8fb0af4cb  init-xenstore-domain.patch
2513ab530c80b32bd7fe4d35a5b1ecbda14c8e093e556e040a68226796e63791  musl-support.patch
09b9feb9ea6f9c1bda5cc1672f42e8fc5186dc9dd5561f28c6f1904d80aca7fa  musl-hvmloader-fix-stdint.patch
6b4ad2a9fdb3e23b06c8c1961a46b06c15a46471fe6fb13cdc269da37466f334  stdint_local.h
7f1ed2db24d8eba87a08eea0601a9ab339209906fdfa74c8c03564a1a6e6471e  elf_local.h
b183ed028a8c42a64e6fd3fb4b2b6dad832f52ed838fceb69bf681de4e7d794f  xen-hotplug-lockfd.patch
d0b3e5f282a07878341c38f40d01041ed37623757a99d6e0a420ca64d1f4ef2a  xen-fd-is-file.c
87d391c666a1facafaf33bdd69523ec877a687262e267ff032cbca7f714ccd15  xenstored.initd
991bb7c9da02941556e29714bd96b26e39e57e0a5b514eadd78d9bfa3fa5a9dc  xenstored.confd
93bea2eb90ea1b4628854c8141dd351bbd1fbc5959b12795447ea933ad025f01  xenconsoled.initd
2a74be03eb74f6013242a4a5d721df6cb9b959b43c405de1e32813f52d749060  xenconsoled.confd
a3ab3779c589e1a24a38a802afc238cb451f6a3779a7d6041b3f1517027ea3da  xendomains.initd
046540c36328809fc351ad209d2b40300f91581d6d46da0caf79f57f2c212285  xendomains.confd
0da87a4b9094f934e3de937e8ef8d3afc752e76793aa3d730182d0241e118b19  xen-consoles.logrotate
4cfcddcade5d055422ab4543e8caa6e5c5eee7625c41880a9000b7a87c7c424e  xenqemu.confd
bf17808a79c57a9efc38b9f14cc87f556b2bb7ecfdec5763d9cf686255a47fce  xenqemu.initd"
sha512sums="bcd577014f4e8cb37b934f17a4dfb6f12e72e865a9e553cc435fdbe6665c733a4d20a812bf126727eca0946188a6abbd9419579757d7e03a38059f3656371c1c  xen-4.4.1.tar.gz
f511a13ee4223ea2fa9d109fea1802b462f178d3be7de630aeba6eb40ef5d17c7db9d3b99ea414c5794d92d181a60c0bd2061f51987c6deb3a9071f5626fd049  xsa108.patch
0b3675cfdd7f026802b7ff6c604f22c785ddbaad09faa48782d21526aaecb8d7a9ff30e908eec847c9bd5fea83d80e5903202368a748134732c9b9ecda003416  xsa109.patch
0975ea1abf34d8d75396bed2ba65f9b146f8b6cace2e367772226d65f8fea9af57e965684c25f79db934467a99397073685f99b1435d7ce113ecfc6241cb20f3  xsa110.patch
bfb12408bf9f5449fbe11bb24f1f4b13c6dafbc755b6696658235ad2387933bc449e2012c217a5fbb937cc2d0ef2895f52a201646ff1a8b61360199c1456d821  xsa111.patch
d9d08039c0127007ea0db792d2b1375ac9f94d91982324cc945afd97dd3d14049195f5dceea37969442e36e49fa008053e75255dd4cbffc7d7fd265080f6ca4d  xsa112.patch
be8223e778eb529d10a752f507c0dfaef0a607191924b400979dc5fd4c1f2806e39ec49c84fb299d5d06505ffe2d4b4268551db6e909a2520f70f70bb40bb3cb  xsa113.patch
c8ed45c7a6bb9bc7cfe08aae06e36c6a88ce79c3c33ad6f707fea88b5fb70e9eb1c1ee98534b7e49ca6e52cdea56b0893d6c839874057b05ae815c2c94b7ce8f  xsa114-4.4.patch
8d0d6b01e4836195f0c57c5102fdb933c742cb941e0c565adff0dfd4ad660618dfd6b5c2c7bf367e73645a560d097d2677511d52399d19100e26e55d25aaacd1  xsa116.patch
a6c24b4bd6b7b8cc750c203b74fbe8a8dde26c2f5b06d27822353ea14778de9d6b375aaea5ee64b42a1235a1811a25119b0028234a22424747f4c6eba91b0ffa  xsa118-4.4.patch
c3c46f232f0bd9f767b232af7e8ce910a6166b126bd5427bb8dc325aeb2c634b956de3fc225cab5af72649070c8205cc8e1cab7689fc266c204f525086f1a562  qemu-coroutine-gthread.patch
a8b7378516172389450834985e8558d7a86d7cd808154bdc846bb98325e40fc4e87b1fc6d725297f4bef6eb54ebcbcbfa4d9d0363d83f635755795fb0726e006  qemu-xen-musl-openpty.patch
1f19cf495142dfc9f1786af6d4f7d497a482119fa2f1c10d4f9174994d38562719bc5190820dd444c32da0fb9af78fadac8dc8958437c26d6ca385f2409794e8  qemu-xen_paths.patch
f095ea373f36381491ad36f0662fb4f53665031973721256b23166e596318581da7cbb0146d0beb2446729adfdb321e01468e377793f6563a67d68b8b0f7ffe3  hotplug-vif-vtrill.patch
c3a1b270347a99c8ce21118010ad8d817b4462a31cc5c75352faa7086969ef0646f3f4d0922d85c2e504cff091ce7e9fe79c92f983c2ba4af2fae85c52c3835a  0001-ipxe-dont-clobber-ebp.patch
475eb800660dc928914b8c15562f18f24d6e7a76f4cc7bed9249ce52d444c29aec1aef843eb37ade0c7c9616195bbbc1606a3195e25b2bd4b6a1d1af5f69256e  init-xenstore-domain.patch
3d6b180d631c6d7baeff9976503cf6b16f24b0e99c25b2b2a5153db85f41600159d10d4f47eda0e33e1f41197dc9d6d935cf33f31ffbcf429d35002e0affdb2d  musl-support.patch
4acf7e360ae94f7c0f7541fcd106389402f215c28bd18ed1fd4be9d4b9d12550e17152f7e19b19793e16d4ee0e131ec3e3ce6011b42bc7683fcebdb4051c6109  musl-hvmloader-fix-stdint.patch
9dcb481c5b83c7df23e87be717d8a9234014f26a0f80893e125fe8110e2923562d95162d18ff64c08b5782cd7c085f90378a9e0802b3995c077c8ba32bbb669f  stdint_local.h
853467a2d055c5bfbdc7bdca175a334241be44a7c5ac3c0a84a4bc5463b5c070b66d37e2a557429ef860727a6b7350683af758cc2494d85b6be4d883143a2c0d  elf_local.h
79cb1b6b81b17cb87a064dfe3548949dfb80f64f203cac11ef327102b7a25794549ce2d9c019ebf05f752214da8e05065e9219d069e679c0ae5bee3d090c685e  xen-hotplug-lockfd.patch
e76816c6ad0e91dc5f81947f266da3429b20e6d976c3e8c41202c6179532eec878a3f0913921ef3ac853c5dbad8082da3c9cd53b65081910516feb492577b7fc  xen-fd-is-file.c
84b62a02709e1fd760d766c2d72f69a5d18dfc54bcbc9db140e30131b5f5fe1b163911bd910012184229586f0ff9a48b6190cc3f7a604d2393df0220d016984e  xenstored.initd
093f7fbd43faf0a16a226486a0776bade5dc1681d281c5946a3191c32d74f9699c6bf5d0ab8de9d1195a2461165d1660788e92a3156c9b3c7054d7b2d52d7ff0  xenstored.confd
12f981b2459c65d66e67ec0b32d0d19b95a029bc54c2a79138cfe488d3524a22e51860f755abfe25ddcdaf1b27f2ded59b6e350b9d5f8791193d00e2d3673137  xenconsoled.initd
30df69cc38d0bed26bc4d6e08a2b62cbdc654d5f663009a05cb3b83b3e3dc5e206362d3fd59abbb753ceb8d6d79eaa6e15d079bb8f4f35dc74667103faf4e85d  xenconsoled.confd
e3c8d3ab21468fb9ce20f47976352cd7b24fd20a3a691bf4672190b2272762ac306e27a8adc85bf14290348108b2cf0ce95418ff7fae4d6075b9da8bd056b48a  xendomains.initd
a3dddcb841a22305cfe1780c4ef6cf1ee67227ca9fe6ca0d24a7cc8be2cff9e5f3fbd75c2faf85e5ce6dc3b73631879ce10e19b02afb4611c72db183e116123a  xendomains.confd
ab2105c75cfe01768aecd5bcbb56269d63666e8a44e42b6a83aee87df6c84ee2f9ab249171c21b2e09f8fec2cae8318f6e87d160989398a3e7dd68db8d52c426  xen-consoles.logrotate
bdbe15c924071cdc2d0f23e53ba8e3f837d4b5369bfb218abd3405f9bef25d105269aaf0784baeb69c073a5786b8c82ffdfd414e86874da34293cfdc2c497928  xenqemu.confd
2341a01a000e4badd9dbfd122e7eb3e594982921a80186c0e4174744daf31114c384b42458864d9904ed1b463746efb774efa707ad48280a25ce897ef5ac9e83  xenqemu.initd"