# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=asfa
pkgver=0.10.0
pkgrel=0
pkgdesc="Share files by uploading via SSH and generating a non-guessable link"
url="https://github.com/obreitwi/asfa"
arch="all"
license="MIT OR Apache-2.0"
makedepends="
	cargo
	cargo-auditable
	libssh2-dev
	openssl-dev
	"
source="https://github.com/obreitwi/asfa/archive/v$pkgver/asfa-$pkgver.tar.gz"
options="!check net"  # tests use docker, cargo fetch

export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"

export LIBSSH2_SYS_USE_PKG_CONFIG=1  # use system libssh2

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
bbbdab8d9c719637f75e6100cd6a8176a78bad7ae25530f550ec0aba8dd4edfc94862dddbf10a17cdacc06a5e634bb36d7142f84353a4dc2ae2778526180200d  asfa-0.10.0.tar.gz
"
