summaryrefslogtreecommitdiff
path: root/repo/libvirt/libvirt.xibuild
blob: a6e8d4bc22e709f75d425e2a56c509c4ddbc91ee (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
#!/bin/sh

NAME="libvirt"
DESC="A virtualization API for several hypervisor and container systems"

MAKEDEPS="augeas libsasl device-mapper e2fsprogs gnutls libcap-ng libgpg-error netcf libnl libxml2 libxslt libtasn1 lvm2 lxc libgcrypt parted perl pkg-config eudev zlib yajl libpcap curl libpciaccess polkit readline linux-headers jansson libtirpc perl-xml-xpath fuse util-linux bash-completion bridge-utils dmidecode dnsmasq iptables pm-utils netcat rpcsvc-proto python-docutils meson ninja"
DEPS="dmidecode dnsmasq"

PKG_VER=8.7.0
SOURCE="https://libvirt.org/sources/libvirt-$PKG_VER.tar.xz"

ADDITIONAL="
libvirt-6.0.0-fix_paths_in_libvirt-guests_sh.patch
libvirt-guests.confd
libvirt-guests.initd
libvirt.confd
libvirt.initd
libvirt.post-install
musl-fix-includes.patch
stderr-fix.patch
virtlockd.initd
virtlogd.initd
"

build() {
	export ac_cv_path_QEMU_BRIDGE_HELPER="/usr/lib/qemu/qemu-bridge-helper"
	meson --prefix=/usr \
		--libexec=/usr/lib/libvirt \
		. output

	meson configure output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$PKG_DEST" ninja -C output install
	install -Dm755 $BUILD_ROOT/libvirt.initd $PKG_DEST/etc/init.d/libvirtd
	install -Dm644 $BUILD_ROOT/libvirt.confd $PKG_DEST/etc/conf.d/libvirtd
	install -Dm755 $BUILD_ROOT/libvirt-guests.initd $PKG_DEST/etc/init.d/libvirt-guests
	install -Dm644 $BUILD_ROOT/libvirt-guests.confd $PKG_DEST/etc/conf.d/libvirt-guests

	install -Dm755 $BUILD_ROOT/virtlogd.initd $PKG_DEST/etc/init.d/virtlogd
	install -Dm755 $BUILD_ROOT/virtlockd.initd $PKG_DEST/etc/init.d/virtlockd

	install -d "$PKG_DEST"/lib/modules-load.d
	echo "tun" > "$PKG_DEST"/lib/modules-load.d/libvirt.conf

	rm -rf "$PKG_DEST"/etc/sysconfig
	rm -rf "$PKG_DEST"/usr/lib/charset.alias
	rmdir -p "$PKG_DEST"/usr/lib 2>/dev/null || true
}

postinstall () {
    groupadd libvirt 2>/dev/null && {
        sed -i 's/^#unix_sock_group/unix_sock_group/g'
        sed -i 's/^#unix_sock_rw_perms/unix_sock_rw_perms/g'
    }
    exit 0
}