PKGBUILDs/community/libvirt/PKGBUILD

178 lines
6.4 KiB
Bash
Raw Normal View History

2018-01-27 03:59:37 +00:00
# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
2020-06-02 13:53:24 +00:00
# Maintainer: Robin Broda <robin@broda.me>
2018-01-27 03:59:37 +00:00
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
2013-07-01 23:28:11 +00:00
# Contributor: Jonathan Wiersma <archaur at jonw dot org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2020-06-02 13:53:24 +00:00
# - removed ceph makedepend, libvirt-storage-rbd package
2015-09-03 12:31:20 +00:00
# - removed qemu makedepend
2013-07-01 23:28:11 +00:00
2020-06-02 13:53:24 +00:00
pkgname=(libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct)
pkgver=6.4.0
pkgrel=1
2013-07-01 23:28:11 +00:00
pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
2017-12-10 14:08:31 +00:00
arch=('x86_64')
2019-03-04 19:25:16 +00:00
url="https://libvirt.org/"
2020-06-02 13:53:24 +00:00
license=('LGPL' 'GPL3') #libvirt_parthelper links to libparted which is GPL3 only
install=libvirt.install
depends=('libpciaccess' 'yajl' 'fuse2' 'gnutls' 'parted' 'libssh' 'libxml2' 'numactl' 'polkit')
makedepends=('libxslt' 'python-docutils' 'lvm2' 'open-iscsi' 'libiscsi' 'glusterfs'
'bash-completion' 'rpcsvc-proto' 'dnsmasq' 'iproute2')
checkdepends=('ebtables')
optdepends=('libvirt-storage-gluster: Gluster storage backend'
'libvirt-storage-iscsi-direct: iSCSI-direct storage backend'
'gettext: required for libvirt-guests.service'
'openbsd-netcat: for remote management over ssh'
'dmidecode: DMI system info support'
2018-08-13 18:36:37 +00:00
'dnsmasq: required for default NAT/DHCP for guests'
2020-06-02 13:53:24 +00:00
'radvd: IPv6 RAD support'
'ebtables: required for default NAT networking'
'lvm2: Logical Volume Manager support'
'open-iscsi: iSCSI support via iscsiadm')
backup=(
2018-06-08 17:45:38 +00:00
'etc/conf.d/libvirtd'
2020-06-02 13:53:24 +00:00
'etc/conf.d/libvirt-guests'
'etc/conf.d/virtinterfaced'
'etc/conf.d/virtlockd'
'etc/conf.d/virtlogd'
'etc/conf.d/virtlxcd'
'etc/conf.d/virtnetworkd'
'etc/conf.d/virtnodedevd'
'etc/conf.d/virtnwfilterd'
'etc/conf.d/virtproxyd'
'etc/conf.d/virtqemud'
'etc/conf.d/virtsecretd'
'etc/conf.d/virtstoraged'
'etc/conf.d/virtvboxd'
'etc/libvirt/libvirt-admin.conf'
2018-06-08 17:45:38 +00:00
'etc/libvirt/libvirt.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'
2020-06-02 13:53:24 +00:00
'etc/libvirt/nwfilter/clean-traffic-gateway.xml'
2018-06-08 17:45:38 +00:00
'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.conf'
2020-06-02 13:53:24 +00:00
'etc/libvirt/qemu-lockd.conf'
2018-06-08 17:45:38 +00:00
'etc/libvirt/qemu/networks/default.xml'
2020-06-02 13:53:24 +00:00
'etc/libvirt/virtinterfaced.conf'
2018-06-08 17:45:38 +00:00
'etc/libvirt/virtlockd.conf'
2020-06-02 13:53:24 +00:00
'etc/libvirt/virtlogd.conf'
'etc/libvirt/virt-login-shell.conf'
'etc/libvirt/virtlxcd.conf'
'etc/libvirt/virtnetworkd.conf'
'etc/libvirt/virtnodedevd.conf'
'etc/libvirt/virtnwfilterd.conf'
'etc/libvirt/virtproxyd.conf'
'etc/libvirt/virtqemud.conf'
'etc/libvirt/virtsecretd.conf'
'etc/libvirt/virtstoraged.conf'
'etc/libvirt/virtvboxd.conf'
2018-06-08 17:45:38 +00:00
'etc/logrotate.d/libvirtd'
'etc/logrotate.d/libvirtd.lxc'
'etc/logrotate.d/libvirtd.qemu'
2020-06-02 13:53:24 +00:00
'etc/sasl2/libvirt.conf'
)
source=("https://libvirt.org/sources/$pkgname-$pkgver.tar.xz"{,.asc})
sha256sums=('586ebcf220369d08a07c6cc17035e8a91bb3741e4300199459904e9e02478be7'
'SKIP')
validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F') # Daniel Veillard <veillard@redhat.com>
2014-02-10 13:14:42 +00:00
prepare() {
2020-06-02 13:53:24 +00:00
mkdir build
cd "$pkgname-$pkgver"
2014-04-10 20:46:43 +00:00
sed -i 's|/sysconfig/|/conf.d/|g' \
2018-03-25 00:41:50 +00:00
src/remote/libvirtd.service.in \
2014-04-10 20:46:43 +00:00
tools/{libvirt-guests.service,libvirt-guests.sh,virt-pki-validate}.in \
2020-06-02 13:53:24 +00:00
src/locking/virtlockd.service.in \
src/logging/virtlogd.service.in
2014-06-23 12:25:10 +00:00
sed -i 's|/usr/libexec/qemu-bridge-helper|/usr/lib/qemu/qemu-bridge-helper|g' \
2020-06-02 13:53:24 +00:00
src/qemu/qemu.conf \
2014-06-23 12:25:10 +00:00
src/qemu/test_libvirtd_qemu.aug.in
2016-03-07 13:17:00 +00:00
2018-03-25 00:41:50 +00:00
sed -i 's/notify/simple/' src/remote/libvirtd.service.in
2014-04-10 20:46:43 +00:00
}
build() {
2020-06-02 13:53:24 +00:00
cd build
ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool \
"../$pkgname-$pkgver/configure" \
2018-08-13 18:36:37 +00:00
--prefix=/usr \
2020-06-02 13:53:24 +00:00
"--libexec=/usr/lib/$pkgname" \
2018-08-13 18:36:37 +00:00
--sbindir=/usr/bin \
2020-06-02 13:53:24 +00:00
--with-runstatedir=/run \
--with-qemu-group=kvm
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
2013-07-01 23:28:11 +00:00
make
}
2020-06-02 13:53:24 +00:00
check() {
cd build
make check
}
package_libvirt() {
provides=('libvirt.so' 'libvirt-admin.so' 'libvirt-lxc.so' 'libvirt-qemu.so')
cd build
make DESTDIR="$pkgdir" install
2013-07-01 23:28:11 +00:00
2020-06-02 13:53:24 +00:00
mv "$pkgdir"/etc/{sysconfig,conf.d}
mkdir "$pkgdir"/usr/lib/{sysusers,tmpfiles}.d
echo "g libvirt - -" > "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
echo "z /var/lib/libvirt/qemu 0751" > "$pkgdir/usr/lib/tmpfiles.d/libvirt.conf"
2013-07-01 23:28:11 +00:00
2020-06-02 13:53:24 +00:00
chown 0:102 "$pkgdir/usr/share/polkit-1/rules.d"
chmod 0750 "$pkgdir/usr/share/polkit-1/rules.d"
chmod 600 "$pkgdir"/etc/libvirt/nwfilter/*.xml \
"$pkgdir/etc/libvirt/qemu/networks/default.xml"
2015-07-25 01:16:28 +00:00
2020-06-02 13:53:24 +00:00
# Strip auto-generated UUID, so it will be generated per-install. (reproducible builds)
sed -i 's|<uuid>.*</uuid>|<uuid></uuid>|' "$pkgdir"/etc/libvirt/qemu/networks/default.xml
2014-07-30 19:22:25 +00:00
2013-07-01 23:28:11 +00:00
rm -rf \
2020-06-02 13:53:24 +00:00
"$pkgdir/run" \
"$pkgdir/var/lib/libvirt/qemu" \
"$pkgdir/var/cache/libvirt/qemu" \
"$pkgdir/etc/logrotate.d/libvirtd.libxl"
2017-03-03 19:25:31 +00:00
2020-06-02 13:53:24 +00:00
rm -f "$pkgdir/etc/libvirt/qemu/networks/autostart/default.xml"
# move split modules
mv "$pkgdir"/usr/lib/libvirt/storage-backend/libvirt_storage_backend_gluster.so "$pkgdir/../"
mv "$pkgdir/usr/lib/libvirt/storage-backend/libvirt_storage_backend_iscsi-direct.so" "$pkgdir/../"
mv "$pkgdir/usr/lib/libvirt/storage-file/libvirt_storage_file_gluster.so" "$pkgdir/../"
}
package_libvirt-storage-gluster() {
pkgdesc="Libvirt Gluster storage backend"
depends=("libvirt=$pkgver" 'glusterfs')
optdepends=()
backup=()
install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_gluster.so"
install -Dv -t "$pkgdir/usr/lib/libvirt/storage-file" "$pkgdir/../libvirt_storage_file_gluster.so"
}
2019-06-05 12:48:46 +00:00
2020-06-02 13:53:24 +00:00
package_libvirt-storage-iscsi-direct() {
pkgdesc="Libvirt iSCSI-direct storage backend"
depends=("libvirt=$pkgver" 'libiscsi')
optdepends=()
backup=()
2019-06-05 12:48:46 +00:00
2020-06-02 13:53:24 +00:00
install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_iscsi-direct.so"
2013-07-01 23:28:11 +00:00
}