226 lines
8.1 KiB
Bash
226 lines
8.1 KiB
Bash
#!/usr/bin/bash
|
|
# JOBoRun : Jwm OpenBox Obarun RUNit
|
|
# Maintainer : Joe Bo Run <joborun@disroot.org>
|
|
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
|
|
# Website : https://pozol.eu
|
|
#-----------------------------------------| DESCRIPTION |---------------------------------------
|
|
|
|
pkgname=(libvirt) # (libvirt-storage-gluster libvirt-storage-iscsi-direct libvirt-storage-rbd)
|
|
epoch=1
|
|
pkgver=10.1.0
|
|
pkgrel=01
|
|
pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc) w/o zstd iscsi systemd"
|
|
url="https://libvirt.org/"
|
|
depends=('libpciaccess' 'yajl' 'fuse3' 'gnutls' 'parted' 'libssh' 'libxml2' 'numactl' 'polkit' 'libnbd' 'libnl')
|
|
#makedepends=('open-iscsi' 'ceph-libs') # need systemd-libs
|
|
makedepends=('meson' 'libxslt' 'python-docutils' 'lvm2'
|
|
'bash-completion' 'dnsmasq' 'iproute2' 'qemu-base')
|
|
# 'libiscsi' 'glusterfs' 'ceph-libs' 'glusterfs'
|
|
optdepends=('libvirt-storage-rbd: RBD storage backend'
|
|
'gettext: required for libvirt-guests.service'
|
|
'openbsd-netcat: for remote management over ssh'
|
|
'dmidecode: DMI system info support'
|
|
'dnsmasq: required for default NAT/DHCP for guests'
|
|
'iptables-nft: required for default NAT networking'
|
|
'qemu: QEMU/KVM support'
|
|
'lvm2: Logical Volume Manager support')
|
|
backup=(
|
|
'etc/libvirt/libvirt-admin.conf'
|
|
'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-dhcpv6-server.xml'
|
|
'etc/libvirt/nwfilter/allow-dhcp.xml'
|
|
'etc/libvirt/nwfilter/allow-dhcpv6.xml'
|
|
'etc/libvirt/nwfilter/allow-incoming-ipv4.xml'
|
|
# 'etc/libvirt/nwfilter/allow-incoming-ipv6.xml'
|
|
# 'etc/libvirt/nwfilter/allow-ipv6.xml'
|
|
'etc/libvirt/nwfilter/allow-ipv4.xml'
|
|
'etc/libvirt/nwfilter/clean-traffic-gateway.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-ipv6-multicast.xml'
|
|
'etc/libvirt/nwfilter/no-ip-spoofing.xml'
|
|
# 'etc/libvirt/nwfilter/no-ipv6-spoofing.xml'
|
|
'etc/libvirt/nwfilter/no-mac-spoofing.xml'
|
|
'etc/libvirt/nwfilter/no-mac-broadcast.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'
|
|
'etc/libvirt/qemu-lockd.conf'
|
|
'etc/libvirt/qemu/networks/default.xml'
|
|
'etc/libvirt/virtchd.conf'
|
|
'etc/libvirt/virtinterfaced.conf'
|
|
'etc/libvirt/virtlockd.conf'
|
|
'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'
|
|
'etc/logrotate.d/libvirtd'
|
|
'etc/logrotate.d/libvirtd.lxc'
|
|
'etc/logrotate.d/libvirtd.qemu'
|
|
'etc/sasl2/libvirt.conf'
|
|
)
|
|
# options=(debug) # enable this if you want the debug package made
|
|
source=(
|
|
"https://libvirt.org/sources/$pkgname-$pkgver.tar.xz"{,.asc}
|
|
libvirt.sysusers
|
|
libvirt.tmpfiles)
|
|
|
|
prepare() {
|
|
cd "$pkgname-$pkgver"
|
|
|
|
sed -i 's|/sysconfig/|/conf.d/|g' \
|
|
src/remote/libvirtd.service.in \
|
|
tools/{libvirt-guests.service,libvirt-guests.sh,virt-pki-validate}.in \
|
|
docs/manpages/libvirt-guests.rst \
|
|
src/locking/virtlockd.service.in \
|
|
src/logging/virtlogd.service.in
|
|
sed -i 's|/usr/libexec/qemu-bridge-helper|/usr/lib/qemu/qemu-bridge-helper|g' \
|
|
src/qemu/qemu.conf.in \
|
|
src/qemu/test_libvirtd_qemu.aug.in
|
|
}
|
|
|
|
build() {
|
|
cd "$pkgname-$pkgver"
|
|
|
|
arch-meson build \
|
|
--libexecdir=lib/libvirt \
|
|
-Drunstatedir=/run \
|
|
-Dqemu_user=libvirt-qemu \
|
|
-Dqemu_group=libvirt-qemu \
|
|
-Dnetcf=disabled \
|
|
-Dopenwsman=disabled \
|
|
-Dapparmor=disabled \
|
|
-Dapparmor_profiles=disabled \
|
|
-Dselinux=disabled \
|
|
-Dwireshark_dissector=disabled \
|
|
-Ddriver_bhyve=disabled \
|
|
-Ddriver_hyperv=disabled \
|
|
-Ddriver_libxl=disabled \
|
|
-Ddriver_vz=disabled \
|
|
-Ddriver_vmware=disabled \
|
|
-Ddriver_vz=disabled \
|
|
-Dsanlock=disabled \
|
|
-Dsecdriver_apparmor=disabled \
|
|
-Dsecdriver_selinux=disabled \
|
|
-Dstorage_vstorage=disabled \
|
|
-Ddtrace=disabled \
|
|
-Dnumad=disabled \
|
|
-Dstorage_zfs=disabled \
|
|
-Dstorage_rbd=disabled \
|
|
-Dglusterfs=disabled \
|
|
-Dstorage_gluster=disabled \
|
|
-Dstorage_iscsi=disabled \
|
|
-Dstorage_iscsi_direct=disabled \
|
|
-Dstorage_scsi=disabled \
|
|
-Dlibiscsi=disabled \
|
|
-Dinit_script=none
|
|
# ninja -C build
|
|
meson compile -C build
|
|
}
|
|
# -Dparallels_sdk=disabled \ # this option is invalid
|
|
|
|
check() {
|
|
cd "$pkgname-$pkgver"
|
|
|
|
meson test -C build --print-errorlogs
|
|
}
|
|
|
|
#package_libvirt() {
|
|
package() {
|
|
provides=("libvirt=$pkgver" 'libvirt.so' 'libvirt-admin.so' 'libvirt-lxc.so' 'libvirt-qemu.so')
|
|
cd "$pkgname-$pkgver"
|
|
# DESTDIR="$pkgdir" ninja -C build install
|
|
meson install -C build --destdir "$pkgdir"
|
|
|
|
mkdir -p "$pkgdir"/usr/lib/{sysusers,tmpfiles}.d
|
|
echo 'g libvirt - -' > "$pkgdir/usr/lib/sysusers.d/libvirt-qemu.conf"
|
|
echo 'u libvirt-qemu /var/lib/libvirt "Libvirt QEMU user"' >> "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
|
|
echo 'm libvirt-qemu kvm' >> "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
|
|
echo 'z /var/lib/libvirt/qemu 0751' > "$pkgdir/usr/lib/tmpfiles.d/libvirt.conf"
|
|
|
|
## sysusers
|
|
install -D -m0644 "$srcdir/libvirt.sysusers" "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
|
|
|
|
## tmpfiles
|
|
install -D -m0644 "$srcdir/libvirt.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/libvirt.conf"
|
|
|
|
# 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"
|
|
chmod 700 "$pkgdir"/etc/libvirt/secrets
|
|
|
|
rm -rf \
|
|
"$pkgdir/run" \
|
|
"$pkgdir/var/lib/libvirt/qemu" \
|
|
"$pkgdir/var/cache/libvirt/qemu" \
|
|
"$pkgdir/etc/logrotate.d/libvirtd.libxl"
|
|
|
|
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"
|
|
#}
|
|
|
|
#package_libvirt-storage-iscsi-direct() {
|
|
# pkgdesc="Libvirt iSCSI-direct storage backend"
|
|
# depends=("libvirt=$pkgver" 'libiscsi')
|
|
# optdepends=()
|
|
# backup=()
|
|
#
|
|
# install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_iscsi-direct.so"
|
|
#}
|
|
#
|
|
#package_libvirt-storage-rbd() {
|
|
# pkgdesc="Libvirt RBD storage backend"
|
|
# depends=("libvirt=$pkgver" 'ceph-libs')
|
|
# optdepends=()
|
|
# backup=()
|
|
#
|
|
# install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_rbd.so"
|
|
#}
|
|
|
|
#---- arch license gpg-key & sha256sums ----
|
|
|
|
arch=(x86_64)
|
|
|
|
license=('LGPL-2.1-or-later' 'GPL-3.0-or-later') # libvirt_parthelper links to libparted
|
|
|
|
validpgpkeys=('453B65310595562855471199CA68BE8010084C9C') # Jiří Denemark <jdenemar@redhat.com>
|
|
|
|
sha256sums=(36d9077e2b0ef6b0c6df3b42e42a67411b6ce3b1564b427b55e65019dde60eed # libvirt-10.1.0.tar.xz
|
|
024da80baf95aec52241f53474ee9b86ef9fee9ac103f5a714a5e336547f9704 # libvirt-10.1.0.tar.xz.asc
|
|
6dc7907d6d4d883ac5ea15c195af673c97cff13f4c0493d23196e94bc87f04db # libvirt.sysusers
|
|
465a3e535cdc5549beaf82b41f53b27d5352aab1313277fd0c2f33004d0d59ba) # libvirt.tmpfiles
|
|
|
|
## b348c4ae469d8a2a2d16a6fb3fd34531cf5dba0b6ecf2787b5623d122fb01418 libvirt-1_10.1.0-01-x86_64.pkg.tar.lz
|
|
|