summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 40490ebd0c8a263bb4579745e2f8d427895b331a (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
# Maintainer: Amirul Fitri <tounghacker@gmail.com>

# maintainer's variables
_commit=2d1c69c0ce4a0ac21565593d30fdf489dea4046e

pkgname=playit
pkgver=0.8.3+beta
pkgrel=1
pkgdesc="A tunneling tool to host a game server without port forwarding or sharing public IP"
arch=('x86_64')
url="https://playit.gg"
depends=('gcc-libs')
license=('BSD')
makedepends=('git' 'cargo')
source=("${pkgname}::git+https://github.com/playit-cloud/playit-agent.git#commit=${_commit}")
sha256sums=('SKIP')

prepare() {
	cd "${pkgname}"
	cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
}

pkgver() {
	cd "${pkgname}"
	grep -Po "^version\s*=\s*\"\K.*(?=\")" packages/agent/Cargo.toml | sed 's/-/+/g'
}

build() {
	cd "${pkgname}"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features
}

check() {
	cd "${pkgname}"
	export RUSTUP_TOOLCHAIN=stable
	cargo test --frozen --all-features
}

package() {
	cd "${pkgname}"
	install -Dm755 target/release/agent "${pkgdir}"/usr/bin/"${pkgname}"
	install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
}