summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6680eb898fc229747163eaa4c73716f22c68e41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Maintainer: Kimiblock Moe

pkgname=anti-spam-matrix-git
pkgdesc="This is a simple Matrix spam banning bot."
url="https://github.com/poly000/anti-spam-matrix"
license=("MIT")
arch=("any")
pkgver=r9.a3997e5
pkgrel=1
makedepends=("rust" "cargo" "git")
depends=()
source=("git+https://github.com/poly000/anti-spam-matrix.git")
md5sums=("SKIP")
provides=("anti-spam-matrix")
conflicts=("anti-spam-matrix")

function pkgver() {
	cd "${srcdir}/anti-spam-matrix"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	#git describe --long --tags --abbrev=8 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

function prepare() {
	cd "${srcdir}/anti-spam-matrix"
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --target "$CARCH-unknown-linux-gnu"
}

function build() {
	cd "${srcdir}/anti-spam-matrix"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features --locked
}

function check() {
	cd "${srcdir}/anti-spam-matrix"
	export RUSTUP_TOOLCHAIN=stable
	cargo test --frozen --all-features
}

function package() {
	install -Dm755 "${srcdir}/anti-spam-matrix/target/release/anti-spam-matrix" "${pkgdir}/usr/bin/anti-spam-matrix"
}