summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e69ebedd9e59a80462440712d8392401eb0a06f8 (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
# Maintainer: Sir-Photch <sir-photch at posteo dot me>

pkgname=adguardian
_pkgname=AdGuardian-Term
pkgver=1.6.0
pkgrel=3
pkgdesc="Terminal-based, real-time traffic monitoring and statistics for your AdGuard Home instance"
arch=(x86_64)
url="https://github.com/Lissy93/AdGuardian-Term"
license=(MIT)
makedepends=(cargo)
optdepends=('gum: interactive prompt for generation of environment file for authentication')
source=("$_pkgname-$pkgver.tar.gz::https://github.com/Lissy93/$_pkgname/archive/refs/tags/$pkgver.tar.gz"
	adguardian.bash)

sha512sums=('385c61d7a48946df2da59f4fa95e96e72cdf80daf7da3b08d6190c79cc72fde6368439e9781fca9ebae97f3d0f07d3e4f82be9f9c3d8aa5675176d967139e31c'
            'e025063ba440cef8e5d6bd764e327397e513e8584a322e95e9805b31284a886c836b56531196d4d1185d8c2ccc8b550fbce03a480a21828c2a9221b3fe798cc4')

prepare() {
	cd "$_pkgname-$pkgver"

	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$_pkgname-$pkgver"

	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release
}

package() {
	install -Dm755 adguardian.bash "$pkgdir/usr/bin/$pkgname"
	
    	cd "$_pkgname-$pkgver"

    	install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/_$pkgname"

	install -Dm644 .github/README.md "$pkgdir/usr/share/doc/${pkgname}/README.md"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}