PKGBUILDs/community/libvirt/PKGBUILD
2018-08-18 17:04:26 +00:00

185 lines
8.8 KiB
Bash

# ${Id}: PKGBUILD 274316 2017-12-13 22:56:42Z anatolik ${}
# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jonathan Wiersma <archaur at jonw dot org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove numactl from depends, doesn't build on ARM
# - drop ceph depend until it builds
# - removed qemu makedepend
pkgname=libvirt
pkgver=4.6.0
pkgrel=3
pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
arch=('x86_64')
url="http://libvirt.org/"
license=('LGPL')
makedepends=('lvm2' 'linux-api-headers' 'dnsmasq' 'lxc' 'libiscsi' 'open-iscsi'
'perl-xml-xpath' 'libxslt' 'parted' 'python')
depends=('e2fsprogs' 'gnutls' 'iptables' 'libxml2' 'parted' 'polkit' 'avahi'
'yajl' 'libpciaccess' 'udev' 'dbus' 'libxau' 'libxdmcp' 'libpcap'
'libcap-ng' 'curl' 'libsasl' 'libgcrypt' 'libgpg-error' 'openssl'
'libxcb' 'gcc-libs' 'iproute2' 'libnl' 'libx11' 'gettext'
'libssh2' 'netcf' 'fuse2' 'glusterfs')
optdepends=('ebtables: required for default NAT networking'
'dnsmasq: required for default NAT/DHCP for guests'
'bridge-utils: for bridged networking'
'netcat: for remote management over ssh'
'radvd'
'dmidecode'
'parted')
backup=('etc/conf.d/libvirt-guests'
'etc/conf.d/libvirtd'
'etc/libvirt/libvirt.conf'
'etc/libvirt/virtlogd.conf'
'etc/libvirt/libvirtd.conf'
'etc/libvirt/lxc.conf'
'etc/libvirt/nwfilter/allow-arp.xml'
'etc/libvirt/nwfilter/allow-dhcp-server.xml'
'etc/libvirt/nwfilter/allow-dhcp.xml'
'etc/libvirt/nwfilter/allow-incoming-ipv4.xml'
'etc/libvirt/nwfilter/allow-ipv4.xml'
'etc/libvirt/nwfilter/clean-traffic.xml'
'etc/libvirt/nwfilter/no-arp-ip-spoofing.xml'
'etc/libvirt/nwfilter/no-arp-mac-spoofing.xml'
'etc/libvirt/nwfilter/no-arp-spoofing.xml'
'etc/libvirt/nwfilter/no-ip-multicast.xml'
'etc/libvirt/nwfilter/no-ip-spoofing.xml'
'etc/libvirt/nwfilter/no-mac-broadcast.xml'
'etc/libvirt/nwfilter/no-mac-spoofing.xml'
'etc/libvirt/nwfilter/no-other-l2-traffic.xml'
'etc/libvirt/nwfilter/no-other-rarp-traffic.xml'
'etc/libvirt/nwfilter/qemu-announce-self-rarp.xml'
'etc/libvirt/nwfilter/qemu-announce-self.xml'
'etc/libvirt/qemu-lockd.conf'
'etc/libvirt/qemu.conf'
'etc/libvirt/qemu/networks/default.xml'
'etc/libvirt/virt-login-shell.conf'
'etc/libvirt/virtlockd.conf'
'etc/logrotate.d/libvirtd'
'etc/logrotate.d/libvirtd.lxc'
'etc/logrotate.d/libvirtd.qemu'
'etc/logrotate.d/libvirtd.uml'
'etc/sasl2/libvirt.conf')
install="libvirt.install"
options=('emptydirs')
validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F')
source=("https://libvirt.org/sources/${pkgname}-${pkgver}.tar.xz"{,.asc}
'libvirtd.conf.d'
'libvirtd-guests.conf.d'
'libvirt.sysusers.d'
'0001-Revert-src-Move-DLOPEN_LIBS-to-libraries-introducing.patch'
'0002-Revert-Fix-link-errors-in-tools-nss-and-tests.patch'
'0003-Revert-remote-daemon-Make-sure-that-JSON-symbols-are.patch'
'0004-Revert-util-jsoncompat-Stub-out-virJSONInitialize-wh.patch'
'0005-Revert-tests-qemucapsprobe-Fix-output-after-switchin.patch'
'0006-Revert-util-avoid-symbol-clash-between-json-librarie.patch'
'0007-Revert-tests-also-skip-qemuagenttest-with-old-jansso.patch'
'0008-Revert-m4-Introduce-STABLE_ORDERING_JANSSON.patch'
'0009-Revert-build-require-Jansson-if-QEMU-driver-is-enabl.patch'
'0010-Revert-build-switch-with-qemu-default-from-yes-to-ch.patch'
'0011-Revert-Remove-virJSONValueNewStringLen.patch'
'0012-Revert-build-remove-references-to-WITH_YAJL-for-SETU.patch'
'0013-Revert-Remove-functions-using-yajl.patch'
'0014-Revert-Switch-from-yajl-to-Jansson.patch'
'0015-Revert-build-undef-WITH_JANSSON-for-SETUID_RPC_CLIEN.patch'
'0016-Revert-build-add-with-jansson.patch')
sha512sums=('beae0f1cafa73b9495d877979547bbc9b7ca2a7c3b213c5da92e6302b570d42df9d639f50380dbc0cebd6af983924dc27b1c81139c81dee0897f39a6a5158968'
'SKIP'
'fc0e16e045a2c84d168d42c97d9e14ca32ba0d86025135967f4367cf3fa663882eefb6923ebf04676ae763f4f459e5156d7221b36b47c835f9e531c6b6e0cd9d'
'ef221bae994ad0a15ab5186b7469132896156d82bfdc3ef3456447d5cf1af347401ef33e8665d5b2f76451f5457aee7ea01064d7b9223d6691c90c4456763258'
'7d1d535aaf739a6753f6819c49272c8d9b5f488e0a8553797499334a76b8631474e222b6048f2125b858e5ecc21e602face45dd02121f833d605b9ae58322982'
'd77f916871482445aa7d75e1f1b048be4d0a4d04f90e85c6866d7b3ea7f2696367e333952679ed089a99a8c3b4d0c65cfb498dad1758e21637d60984c676ba06'
'5bfcae0d1fccc082793b57115241f88fdb5085fa00da73943a1a0043f29290af67a5ddad27b4b2784b54bc945e1c6df53299e9ae299d7771852452aaf7bf5a8a'
'a4b22dc08b92600910da08508fcb4bd4a2d27346eb45e9d8bc571149309f7aca762fe16d523bf662d88f4ceb3c3ac8a1ce33759e794444fac50713e40b6cb302'
'0b37d65045b942cdbe7480217baa06fbdd747a380c85397c88a59fea2af1a92d87e283b5e9534796ecadd66039fd370d62ce3223267991bdc978201f5416244f'
'6e4b33c866e9e7e27ab85a709a45a6d591b2f9a209b3352c8835ec582b810d0b632e9d328590075d119317d360974a0dc411280d68483a38f3405eced6458f0b'
'6e9f05297f1dc671b4564b041661a6bb35f1667c641388ba2d3971c9961a73a139f4c8b24db86792c2165ff49260c72123214e61442e63398325f0b434ff2cf9'
'e31377b9da9defdc4bfbc645a805fd83a5617e6150b0348f30c3f0892834066a26695f8b19bef2deea62486743383139e83b15c452f02947cb3d29b7ffc4d861'
'80cc5ee53fc490b86fb62bdf966441020b4798e94a93e05c1319249e066246e0bafc7b4b97a3c6c10a0d44632c6b228b015ff9dc677c60112a07523c823ee24c'
'a455409fb97e191f3c2e8510906d7da659212ced5163c4a37ca206ab1c348933c0cf0c0f1479ff2ad9076d42c73b35147757da43a96a079a40a385cf334ce5bc'
'bd82f3865c2a641877e91bc7ba92b09268caca1dd9cd0ba64e53bdd88965ba37d7a66c07b1d8dedc5d4254de4bfc08ba5bcafd47caa91d10921a185d88392b8b'
'6251c32e2d9681fb5ee477f535160688793f80957bac2e693bc47592a076b3878d5b071b1d1d8fcc28d2c9127567b28d93067e02d1342cbd72e38191e1c0f2f8'
'b271b72c910ce1d872d6d16cde4b4796309b8ede2fe150398ef094ab8a84284f81c9a1a6a795d25264c098cbab81c990d963132a112e215f6e32bd2fe561849a'
'74458eab69e570c3b4531f722db6d84cd83c534cf1bb60d38d6e2c5c44fdecaa73bfae250c14c787b4761d9edf01ef70d72617d52d14c63c1ee660e0cd8541a3'
'ee1b532579b74aea3cca308f51263693f42c19f946698a647a807258017689dfb4cebd778ccfdd7cb1fea68f55b7575754f1871ba0590e234e125b57afc5c8ea'
'9196b4cd7aa9c7af188bbd9ce4028dda4b04ea316546a5639e291a542663ac78c7deafc639f311b6c1aaa0878690b2e8e0e4e5c4bbe706c54c9cbf2d92960ad9'
'dca08fbdb2e1e088dbeb0d0b192f78cc63f010a7398111a8a71fcc392e23e0176ce84eb3577c12bc6c9da097db3802dab99d7dea91bf00504ecc930f8ab841e9')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
msg2 "Applying patch $src..."
patch -Np1 < "../$src"
done
autoreconf -vi
sed -i 's|/sysconfig/|/conf.d/|g' \
src/remote/libvirtd.service.in \
tools/{libvirt-guests.service,libvirt-guests.sh,virt-pki-validate}.in \
src/locking/virtlockd.service.in
sed -i 's|@sbindir@|/usr/bin|g' src/locking/virtlockd.service.in
sed -i 's|/usr/libexec/qemu-bridge-helper|/usr/lib/qemu/qemu-bridge-helper|g' \
src/qemu/qemu{.conf,_conf.c} \
src/qemu/test_libvirtd_qemu.aug.in
sed -i 's|libsystemd-daemon|libsystemd|g' configure
sed -i 's/notify/simple/' src/remote/libvirtd.service.in
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export PYTHON=$(command -v python)
export LDFLAGS=-lX11
export RADVD=/usr/bin/radvd
[ -f Makefile ] || ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool ./configure \
--prefix=/usr \
--libexec=/usr/lib/"${pkgname}" \
--sbindir=/usr/bin \
--disable-static \
--with-init-script=systemd \
--with-qemu-user=nobody \
--with-qemu-group=kvm \
--without-hal \
--with-interface \
--with-lxc \
--with-netcf \
--with-udev \
--with-storage-disk \
--with-storage-gluster \
--with-storage-iscsi \
--with-storage-lvm \
--with-storage-zfs
# --with-audit
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -D -m644 "${srcdir}"/libvirtd.conf.d "${pkgdir}"/etc/conf.d/libvirtd
install -D -m644 "${srcdir}"/libvirtd-guests.conf.d "${pkgdir}"/etc/conf.d/libvirt-guests
install -D -m644 "${srcdir}"/libvirt.sysusers.d "${pkgdir}"/usr/lib/sysusers.d/libvirt.conf
chown 0:102 "${pkgdir}"/usr/share/polkit-1/rules.d
chmod 0750 "${pkgdir}"/usr/share/polkit-1/rules.d
rm -rf \
"${pkgdir}"/var/run \
"${pkgdir}"/var/lib/libvirt/qemu \
"${pkgdir}"/var/cache/libvirt/qemu \
"${pkgdir}"/etc/sysconfig
rm -f "${pkgdir}"/etc/libvirt/qemu/networks/autostart/default.xml
}