upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / libvirt / trunk / PKGBUILD
blobb92c65a3949f4cb21265205d9484dad916192953
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Maintainer: Robin Broda <robin@broda.me>
3 # Contributor: Christian Rebischke <chris.rebischke@archlinux.org>
4 # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
5 # Contributor: Jonathan Wiersma <archaur at jonw dot org>
7 pkgname=(libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct)
8 epoch=1
9 pkgver=9.3.0
10 pkgrel=1
11 pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
12 arch=('x86_64')
13 url="https://libvirt.org/"
14 license=('LGPL' 'GPL3') #libvirt_parthelper links to libparted which is GPL3 only
15 depends=('libpciaccess' 'yajl' 'fuse3' 'gnutls' 'parted' 'libssh' 'libxml2' 'numactl' 'polkit')
16 makedepends=('meson' 'libxslt' 'python-docutils' 'lvm2' 'open-iscsi' 'libiscsi' 'glusterfs'
17              'bash-completion' 'rpcsvc-proto' 'dnsmasq' 'iproute2' 'qemu-base')
18 optdepends=('libvirt-storage-gluster: Gluster storage backend'
19             'libvirt-storage-iscsi-direct: iSCSI-direct storage backend'
20             'gettext: required for libvirt-guests.service'
21             'openbsd-netcat: for remote management over ssh'
22             'dmidecode: DMI system info support'
23             'dnsmasq: required for default NAT/DHCP for guests'
24             'radvd: IPv6 RAD support'
25             'iptables-nft: required for default NAT networking'
26             'qemu-desktop: QEMU/KVM support'
27             'qemu-emulators-full: Support of additional QEMU architectures'
28             'lvm2: Logical Volume Manager support'
29             'open-iscsi: iSCSI support via iscsiadm'
30             'swtpm: TPM emulator support')
32 backup=(
33   'etc/libvirt/libvirt-admin.conf'
34   'etc/libvirt/libvirt.conf'
35   'etc/libvirt/libvirtd.conf'
36   'etc/libvirt/lxc.conf'
37   'etc/libvirt/nwfilter/allow-arp.xml'
38   'etc/libvirt/nwfilter/allow-dhcp-server.xml'
39   'etc/libvirt/nwfilter/allow-dhcpv6-server.xml'
40   'etc/libvirt/nwfilter/allow-dhcp.xml'
41   'etc/libvirt/nwfilter/allow-dhcpv6.xml'
42   'etc/libvirt/nwfilter/allow-incoming-ipv4.xml'
43   'etc/libvirt/nwfilter/allow-incoming-ipv6.xml'
44   'etc/libvirt/nwfilter/allow-ipv6.xml'
45   'etc/libvirt/nwfilter/allow-ipv4.xml'
46   'etc/libvirt/nwfilter/clean-traffic-gateway.xml'
47   'etc/libvirt/nwfilter/clean-traffic.xml'
48   'etc/libvirt/nwfilter/no-arp-ip-spoofing.xml'
49   'etc/libvirt/nwfilter/no-arp-mac-spoofing.xml'
50   'etc/libvirt/nwfilter/no-arp-spoofing.xml'
51   'etc/libvirt/nwfilter/no-ip-multicast.xml'
52   'etc/libvirt/nwfilter/no-ipv6-multicast.xml'
53   'etc/libvirt/nwfilter/no-ip-spoofing.xml'
54   'etc/libvirt/nwfilter/no-ipv6-spoofing.xml'
55   'etc/libvirt/nwfilter/no-mac-spoofing.xml'
56   'etc/libvirt/nwfilter/no-mac-broadcast.xml'
57   'etc/libvirt/nwfilter/no-other-l2-traffic.xml'
58   'etc/libvirt/nwfilter/no-other-rarp-traffic.xml'
59   'etc/libvirt/nwfilter/qemu-announce-self-rarp.xml'
60   'etc/libvirt/nwfilter/qemu-announce-self.xml'
61   'etc/libvirt/qemu.conf'
62   'etc/libvirt/qemu-lockd.conf'
63   'etc/libvirt/qemu/networks/default.xml'
64   'etc/libvirt/virtchd.conf'
65   'etc/libvirt/virtinterfaced.conf'
66   'etc/libvirt/virtlockd.conf'
67   'etc/libvirt/virtlogd.conf'
68   'etc/libvirt/virt-login-shell.conf'
69   'etc/libvirt/virtlxcd.conf'
70   'etc/libvirt/virtnetworkd.conf'
71   'etc/libvirt/virtnodedevd.conf'
72   'etc/libvirt/virtnwfilterd.conf'
73   'etc/libvirt/virtproxyd.conf'
74   'etc/libvirt/virtqemud.conf'
75   'etc/libvirt/virtsecretd.conf'
76   'etc/libvirt/virtstoraged.conf'
77   'etc/libvirt/virtvboxd.conf'
78   'etc/logrotate.d/libvirtd'
79   'etc/logrotate.d/libvirtd.lxc'
80   'etc/logrotate.d/libvirtd.qemu'
81   'etc/sasl2/libvirt.conf'
83 source=(
84   "https://libvirt.org/sources/$pkgname-$pkgver.tar.xz"{,.asc}
86 sha256sums=('751179b08e5a73b6cfd93200d110df199eaa3973f3554ba2ebcbd71e272bebe1'
87             'SKIP')
88 validpgpkeys=('453B65310595562855471199CA68BE8010084C9C') # Jiří Denemark <jdenemar@redhat.com>
90 prepare() {
91   cd "$pkgname-$pkgver"
93   sed -i 's|/sysconfig/|/conf.d/|g' \
94     src/remote/libvirtd.service.in \
95     tools/{libvirt-guests.service,libvirt-guests.sh,virt-pki-validate}.in \
96     docs/manpages/libvirt-guests.rst \
97     src/locking/virtlockd.service.in \
98     src/logging/virtlogd.service.in
99   sed -i 's|/usr/libexec/qemu-bridge-helper|/usr/lib/qemu/qemu-bridge-helper|g' \
100     src/qemu/qemu.conf.in \
101     src/qemu/test_libvirtd_qemu.aug.in
104 build() {
105   cd "$pkgname-$pkgver"
107   arch-meson build \
108     --libexecdir=lib/libvirt \
109     -Drunstatedir=/run \
110     -Dqemu_user=libvirt-qemu \
111     -Dqemu_group=libvirt-qemu \
112     -Dnetcf=disabled \
113     -Dopenwsman=disabled \
114     -Dapparmor=disabled \
115     -Dapparmor_profiles=disabled \
116     -Dselinux=disabled \
117     -Dwireshark_dissector=disabled \
118     -Ddriver_bhyve=disabled \
119     -Ddriver_hyperv=disabled \
120     -Ddriver_libxl=disabled \
121     -Ddriver_vz=disabled \
122     -Dsanlock=disabled \
123     -Dsecdriver_apparmor=disabled \
124     -Dsecdriver_selinux=disabled \
125     -Dstorage_vstorage=disabled \
126     -Ddtrace=disabled \
127     -Dnumad=disabled \
128     -Dstorage_zfs=enabled\
129     -Dstorage_rbd=disabled
131   ninja -C build
134 check() {
135   cd "$pkgname-$pkgver"
137   ninja -C build test
140 package_libvirt() {
141   provides=("libvirt=$pkgver" 'libvirt.so' 'libvirt-admin.so' 'libvirt-lxc.so' 'libvirt-qemu.so')
142   cd "$pkgname-$pkgver"
143   DESTDIR="$pkgdir" ninja -C build install
145   mkdir "$pkgdir"/usr/lib/{sysusers,tmpfiles}.d
146   echo 'g libvirt - -' > "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
147   echo 'u libvirt-qemu /var/lib/libvirt "Libvirt QEMU user"' >> "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
148   echo 'm libvirt-qemu kvm' >> "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
149   echo 'z /var/lib/libvirt/qemu 0751' > "$pkgdir/usr/lib/tmpfiles.d/libvirt.conf"
151   chown 0:102 "$pkgdir/usr/share/polkit-1/rules.d"
152   chmod 0750 "$pkgdir/usr/share/polkit-1/rules.d"
153   chmod 600 "$pkgdir"/etc/libvirt/nwfilter/*.xml \
154     "$pkgdir/etc/libvirt/qemu/networks/default.xml"
155   chmod 700 "$pkgdir"/etc/libvirt/secrets
157   rm -rf \
158     "$pkgdir/run" \
159     "$pkgdir/var/lib/libvirt/qemu" \
160     "$pkgdir/var/cache/libvirt/qemu" \
161     "$pkgdir/etc/logrotate.d/libvirtd.libxl"
163   rm -f "$pkgdir/etc/libvirt/qemu/networks/autostart/default.xml"
165   # move split modules
166   mv "$pkgdir"/usr/lib/libvirt/storage-backend/libvirt_storage_backend_gluster.so "$pkgdir/../"
167   mv "$pkgdir/usr/lib/libvirt/storage-backend/libvirt_storage_backend_iscsi-direct.so" "$pkgdir/../"
168   mv "$pkgdir/usr/lib/libvirt/storage-file/libvirt_storage_file_gluster.so" "$pkgdir/../"
171 package_libvirt-storage-gluster() {
172   pkgdesc="Libvirt Gluster storage backend"
173   depends=("libvirt=$pkgver" 'glusterfs')
174   optdepends=()
175   backup=()
177   install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_gluster.so"
178   install -Dv -t "$pkgdir/usr/lib/libvirt/storage-file" "$pkgdir/../libvirt_storage_file_gluster.so"
181 package_libvirt-storage-iscsi-direct() {
182   pkgdesc="Libvirt iSCSI-direct storage backend"
183   depends=("libvirt=$pkgver" 'libiscsi')
184   optdepends=()
185   backup=()
187   install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_iscsi-direct.so"