aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/APKBUILD
blob: 007f3006a05edf08d3f3730637fed84ea273be3d (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
# 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.1.3
pkgrel=0
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
arch="x86 x86_64"
license="GPL"
depends="udev syslinux bash"
depends_dev="openssl-dev python-dev e2fsprogs-dev gettext zlib-dev ncurses-dev
	libiconv-dev dev86 texinfo perl iasl pciutils-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-hypervisor"
source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz
	blktap2_libvhd_add_iconv.patch
	detect_libiconv.patch
	fix_bswap_blktap.patch
	fix_bswap_blktap2.patch
	define_fsimage_dir.patch
	librt.patch
	busybox-sed.patch

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

_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

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

	echo "LIBLEAFDIR_x86_64=lib" >> .config
}

build() {
	cd "$_builddir"

	# Unset CFLAGS and LDFLAGS because the xen build system
	# doesn't support them. Instead use .config in xen root
	# folder if necessary.
	unset CFLAGS
	unset LDFLAGS

	msg "Running preflight check..."
	(cd tools/check; ./chk build) || return 1

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

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

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

package() {
	cd "$_builddir"

	unset CFLAGS
	unset LDFLAGS

	make -j1 DESTDIR="$pkgdir" install-xen install-tools 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
}

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

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

md5sums="bed929d5c5e5135cab40e2a6aab73fa0  xen-4.1.3.tar.gz
6d4b045ae56be6288733d0e078f591ea  blktap2_libvhd_add_iconv.patch
ed3283697cb1ddff066f4087eabf68c6  detect_libiconv.patch
503f0883f4a0b50fe4e37e09ed9a6177  fix_bswap_blktap.patch
b973dc1ffcc6872e222b36f3b7b4836b  fix_bswap_blktap2.patch
0bb8a435020a5a49b38b1a447fb69977  define_fsimage_dir.patch
fa06495a175571f4aa3b6cb88937953e  librt.patch
1bea3543ddc712330527b62fd9ff6520  busybox-sed.patch
6e5739dad7e2bd1b625e55ddc6c782b7  xenstored.initd
b017ccdd5e1c27bbf1513e3569d4ff07  xenstored.confd
ed262f15fb880badb53575539468646c  xenconsoled.initd
ec2252c72050d7d5870a3a629b873ba6  xenconsoled.confd
89c936ddf327a3a78eaee33835880517  xend.initd
9261ad0f285836c1b0ea07f306e4586e  xend.confd
35448ff063f8123ec4bba2e001f39c6c  xendomains.initd
9b20e056d475b50586cf9e1fc94e13c4  xendomains.confd
9df68ac65dc3f372f5d61183abdc83ff  xen-consoles.logrotate"