diff options
author | Matteo Bernardini | 2024-02-19 14:10:34 +0100 |
---|---|---|
committer | Matteo Bernardini | 2024-04-20 17:31:48 +0200 |
commit | 80e21dbb676690abefe55250d19cc4caef639721 (patch) | |
tree | 6b9e9fd0245e02fc92544e00cfdebcdb373ff991 | |
parent | 7348664936073e3ad54706addd43560c23807ed8 (diff) | |
download | slackbuilds-virtiofsd.tar.gz |
system/virtiofsd: Added (vhost-user virtio-fs device backend).virtiofsd
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r-- | system/virtiofsd/README | 19 | ||||
-rw-r--r-- | system/virtiofsd/slack-desc | 19 | ||||
-rw-r--r-- | system/virtiofsd/virtiofsd.SlackBuild | 104 | ||||
-rw-r--r-- | system/virtiofsd/virtiofsd.info | 12 |
4 files changed, 154 insertions, 0 deletions
diff --git a/system/virtiofsd/README b/system/virtiofsd/README new file mode 100644 index 0000000000..45d12f2526 --- /dev/null +++ b/system/virtiofsd/README @@ -0,0 +1,19 @@ +virtiofsd is a vhost-user virtio-fs device backend written in Rust. + +This won't work on a 32bit operating system. + +NOTE: if you wish to update virtiofsd yourself you need to create a +tarball first with the vendored versions of the rust dependencies: +to create the "vendor" source dir yourself unpack the virtiofsd +tarball, enter its directory and execute these three commands + + export LD_LIBRARY_PATH="/opt/rust16/lib64:$LD_LIBRARY_PATH" + export PATH="/opt/rust16/bin:$PATH" + cargo vendor + +then you can create a tarball with + + tar Jcf ../virtiofsd-vendor-$VERSION.tar.xz vendor + +this is necessary to avoid downloading stuff during execution of +the SlackBuild. diff --git a/system/virtiofsd/slack-desc b/system/virtiofsd/slack-desc new file mode 100644 index 0000000000..a1e87c22f0 --- /dev/null +++ b/system/virtiofsd/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +virtiofsd: virtiofsd (vhost-user virtio-fs device backend) +virtiofsd: +virtiofsd: virtiofsd is a vhost-user virtio-fs device backend written in Rust. +virtiofsd: +virtiofsd: homepage: https://virtio-fs.gitlab.io +virtiofsd: +virtiofsd: +virtiofsd: +virtiofsd: +virtiofsd: +virtiofsd: diff --git a/system/virtiofsd/virtiofsd.SlackBuild b/system/virtiofsd/virtiofsd.SlackBuild new file mode 100644 index 0000000000..fa42211bc3 --- /dev/null +++ b/system/virtiofsd/virtiofsd.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/bash + +# Slackware build script for virtiofsd + +# Copyright 2023-2024 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy +# 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=virtiofsd +VERSION=${VERSION:-1.10.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + x86_64) ARCH=x86_64 ;; +# arm*) ARCH=arm ;; + *) echo "ARCH $(uname -m) is unsupported."; exit 1 ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + LIBDIRSUFFIX="64" +else + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-v$VERSION +tar xvf $CWD/$PRGNAM-v$VERSION.tar.?z* +cd $PRGNAM-v$VERSION +tar xvf $CWD/$PRGNAM-$VERSION-vendor.tar.xz +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +export PATH="/opt/rust16/bin:$PATH" +if [ -z "$LD_LIBRARY_PATH" ]; then + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX" +else + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH" +fi + +mkdir .cargo +cat <<EOT >>.cargo/config.toml +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOT + +cargo build --release +install -D -p -s -m 0755 target/release/$PRGNAM $PKG/usr/libexec/$PRGNAM +install -D -p -m 0644 50-virtiofsd.json $PKG/usr/share/qemu/vhost-user/50-virtiofsd.json + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a *.md doc/*.md $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/virtiofsd/virtiofsd.info b/system/virtiofsd/virtiofsd.info new file mode 100644 index 0000000000..4f10e98319 --- /dev/null +++ b/system/virtiofsd/virtiofsd.info @@ -0,0 +1,12 @@ +PRGNAM="virtiofsd" +VERSION="1.10.1" +HOMEPAGE="https://virtio-fs.gitlab.io" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://gitlab.com/virtio-fs/virtiofsd/-/archive/v1.10.1/virtiofsd-v1.10.1.tar.bz2 \ + https://ponce.cc/slackware/sources/repo/virtiofsd-1.10.1-vendor.tar.xz" +MD5SUM_x86_64="c6fd3f5b7a83c908f9e08127ec92edc6 \ + d4538be9ccd5f48561e9dc5d98981eb6" +REQUIRES="rust16" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" |