libvirt: add 9.10.0
This commit is contained in:
154
libvirt/libvirt.SlackBuild
Executable file
154
libvirt/libvirt.SlackBuild
Executable file
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# Copyright 2024 Sergei Fedosoff <s.fedosov@gmail.com>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=libvirt
|
||||
VERSION=${VERSION:-9.10.0}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_EXs}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
TMP=${TMP:-/tmp/EXs}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i586" ]; then
|
||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
VIRTUSER=${VIRTUSER:-root}
|
||||
VIRTGROUP=${VIRTGROUP:-users}
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xf $CWD/$PRGNAM-$VERSION.tar.xz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
|
||||
sed -i "s|prefix / 'lib' / 'sysctl.d'|sysconfdir / 'sysctl.d'|" src/remote/meson.build
|
||||
|
||||
patch -p1 -i $CWD/use-virtgroup-in-polkit-rules.diff
|
||||
sed -i -e "s,@VIRTGROUP@,$VIRTGROUP,g" src/remote/libvirtd.rules
|
||||
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
meson setup build \
|
||||
--buildtype=release \
|
||||
--infodir=/usr/info \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
-Dqemu_group=$VIRTGROUP \
|
||||
-Dqemu_user=$VIRTUSER \
|
||||
-Dbash_completion=enabled \
|
||||
-Dbash_completion_dir=/usr/share/bash-completion/completions \
|
||||
-Daudit=disabled \
|
||||
-Dlibiscsi=disabled \
|
||||
-Dopenwsman=disabled \
|
||||
-Dapparmor=disabled \
|
||||
-Dselinux=disabled \
|
||||
-Dwireshark_dissector=disabled \
|
||||
-Ddriver_bhyve=disabled \
|
||||
-Ddriver_hyperv=disabled \
|
||||
-Ddriver_libxl=disabled \
|
||||
-Ddriver_vz=disabled \
|
||||
-Dsecdriver_apparmor=disabled \
|
||||
-Dsecdriver_selinux=disabled \
|
||||
-Dstorage_vstorage=disabled \
|
||||
-Ddtrace=disabled \
|
||||
-Dstrip=true \
|
||||
-Dinit_script=none
|
||||
meson install -C build --destdir $PKG
|
||||
|
||||
rm -rf $PKG/usr/share/augeas
|
||||
rm -Rf $PKG/var/run
|
||||
|
||||
# add an rc.libvirt to start/stop/restart the daemon
|
||||
install -Dpm 0755 $CWD/rc.libvirt $PKG/etc/rc.d/rc.libvirt.new
|
||||
|
||||
sed -i \
|
||||
-e "s|^\#unix_sock_group\ =\ \"libvirt\"|unix_sock_group = \"$VIRTGROUP\"|" \
|
||||
-e "s|^\#unix_sock_rw_perms\ =\ \"0770\"|unix_sock_rw_perms = \"0770\"|" \
|
||||
-e "s|^\#auth_unix_ro.*|auth_unix_ro = \"none\"|" \
|
||||
-e "s|^\#auth_unix_rw.*|auth_unix_rw = \"none\"|" \
|
||||
-e "s|^\#listen_tls|listen_tls|" \
|
||||
$PKG/etc/libvirt/libvirtd.conf
|
||||
|
||||
sed -i -e "s|^\#group\ =\ \"root\"|group = \"$VIRTGROUP\"|" $PKG/etc/libvirt/qemu.conf
|
||||
|
||||
if [ -e $PKG/etc/libvirt/qemu.conf ]; then
|
||||
sed -i "s|^\#seccomp_sandbox = 1|seccomp_sandbox = 0|" \
|
||||
$PKG/etc/libvirt/qemu.conf
|
||||
fi
|
||||
|
||||
gzip -9 $PKG/usr/man/man*/*
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION/
|
||||
rm -Rf $PKG/usr/share/doc
|
||||
cp -a \
|
||||
*.rst COPYING* examples/polkit/* \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
|
||||
install -Dpm 0644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
install -Dpm 0644 $CWD/slack-desc $PKG/install/slack-desc
|
||||
install -Dpm 0644 $CWD/slack-required $PKG/install/slack-required
|
||||
install -Dpm 0644 $CWD/doinst.sh $PKG/install/doinst.sh
|
||||
|
||||
# Don't clobber existing configuration files
|
||||
for i in etc/libvirt etc/libvirt/nwfilter etc/libvirt/qemu/networks etc/logrotate.d etc/sasl2 etc/sysctl.d; do
|
||||
for j in $(ls -1 $PKG/$i); do
|
||||
if [ ! -d $PKG/$i/$j ]; then
|
||||
mv $PKG/$i/$j $PKG/$i/$j.new
|
||||
echo "config $i/$j.new" >> $PKG/install/doinst.sh
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|
||||
Reference in New Issue
Block a user