archrelease: copy trunk to extra-x86_64
[arch-packages.git] / virtiofsd / trunk / PKGBUILD
blobbe6e256c7aeae59e0a259ba92a1bc675a8535f54
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgname=virtiofsd
4 pkgver=1.6.1
5 pkgrel=1
6 pkgdesc="Vhost-user virtio-fs device backend written in Rust"
7 arch=(x86_64)
8 url="https://gitlab.com/virtio-fs/virtiofsd"
9 license=(Apache BSD)
10 depends=(
11   gcc-libs
12   glibc
13   libcap-ng
14   libseccomp
16 makedepends=(cargo)
17 replaces=(qemu-virtiofsd)
18 source=($url/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
19 sha512sums=('ed398c96f16ef520546052bbebe65ae5b4e6818692d4389aa6ace4eb0a9d3cd4b9f3c6b00790b99c4215ceac9eead36a20ae2e18cc8298defb901d9916c241df')
20 b2sums=('e1fad99baef1a6d2a399107422cfbeede365325d1f2e71e3944bc9db41578320a8c0272550597f05741a171ce4a6426338a3255adabcf948735704f3adc1156b')
22 prepare() {
23   cd $pkgname-v$pkgver
24   # use /usr/lib instead of /usr/libexec: https://gitlab.com/virtio-fs/virtiofsd/-/issues/86
25   sed 's/libexec/lib/' -i 50-qemu-$pkgname.json
27   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
30 build() {
31   cd $pkgname-v$pkgver
32   export RUSTUP_TOOLCHAIN=stable
33   export CARGO_TARGET_DIR=target
34   cargo build --frozen --release --all-features
37 check() {
38   cd $pkgname-v$pkgver
39   export RUSTUP_TOOLCHAIN=stable
40   cargo test --frozen --all-features
43 package() {
44   cd $pkgname-v$pkgver
45   install -vDm 755 target/release/$pkgname -t "$pkgdir/usr/lib/"
46   install -vDm 644 50-qemu-$pkgname.json -t "$pkgdir/usr/share/qemu/vhost-user/"
47   install -vDm 644 LICENSE* -t "$pkgdir/usr/share/licenses/$pkgname/"
48   install -vDm 644 README.md doc/*.md -t "$pkgdir/usr/share/doc/$pkgname/"