summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5d7f65f516a60702d9b2fe6e20c598f6f702168c (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
# Maintainer: DuckSoft <realducksoft at gmail dot com>
pkgname=trojan-r-git
pkgver=0.1.0.r15
pkgrel=2
pkgdesc="Lightweight and blazing fast Trojan-GFW/Trojan-Go implementation"
arch=(aarch64 x86_64)
url=https://github.com/p4gefau1t/trojan-r
license=(GPL)
depends=(gcc-libs)
makedepends=(cargo git)
provides=(trojan-r)
conflicts=(trojan-r)
source=("${pkgname%-git}::git+$url" trojan-r@.service)
b2sums=('SKIP'
        '7ca5980b41e4b69b883a58197c43e0106f8a17f74783a1e8316e7ecdd6442a562a948065d0a476e29aaba44ec07a7f3c9321e292d807df16a985ef9ddd9a4e64')

pkgver() {
    cd "$srcdir"/"${pkgname%-git}"
    printf "%s.r%s" $(cargo pkgid | cut -d# -f2 | cut -d: -f2) $(git rev-list --count HEAD)
}

build() {
    cd "$srcdir"/"${pkgname%-git}"
    cargo build --release --locked --all-features --target-dir=.
}

package() {
    cd "$srcdir"/"${pkgname%-git}"
    install -Dm755 release/trojan-r -t "$pkgdir"/usr/bin/
    install -Dm644 config/*.toml -t "$pkgdir"/etc/trojan-r/examples
    install -Dm644 ../trojan-r@.service -t "$pkgdir"/usr/lib/systemd/system/
}