summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1872780137dfed57f7d39b86cdd65132c721b720 (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
# Maintainer: Dct Mei <dctxmei at yandex dot com>
# Co-Maintainer: RogueGirl <3a33oxx40 at mozmail dot com>

pkgname=geph4-client
pkgver=4.99.20
pkgrel=1
pkgdesc="The command-line Geph client"
arch=('x86_64')
url="https://github.com/geph-official/geph4-client"
license=('GPL-3.0-only')
depends=('gcc-libs' 'glibc')
makedepends=('cargo')
backup=('etc/default/geph4-client')
options=('!lto')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
        "geph4-client.default"
        "geph4-client.service")
sha256sums=('e30d0f3d03851b502eb200d1fa62b74b91a8695a5079769cd04cb6d0543c0c19'
            '214d884807236b9d4d82ba01d8cd468afc62071e9c352cca642037426b2da661'
            '317191b59af3d7c674069268738f4734237f12da01b31814d871a9df669f4927')

prepare() {
    cd "${pkgname}-${pkgver}"
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

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

package() {
    cd "${pkgname}-${pkgver}"
    install -Dm755 "target/release/${pkgname}" -t "${pkgdir}/usr/bin/"
    install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 "${srcdir}/geph4-client.default" "${pkgdir}/etc/default/geph4-client"
    install -Dm644 "${srcdir}/geph4-client.service" -t "${pkgdir}/usr/lib/systemd/system/"
}