summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 84e36d7d76eb70f4c82379807f82649a7a5c7e37 (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: Matthieu LAURENT <matthieu.laurent69 [at] proton.me>
# Contributor: Aaron Gross <aaron.gross.codes [at] gmail.com>
# Contributor: Marcel Robitaille <mail [at] marcelrobitaille.me>

pkgname=rust-motd
pkgver=1.0.1
pkgrel=2
pkgdesc='Beautiful, useful, configurable MOTD generation with zero runtime dependencies'
arch=(x86_64)
url=https://github.com/rust-motd/rust-motd
license=(MIT)

provides=($pkgname)
conflicts=($pkgname-bin)
depends=()
makedepends=(cargo)
source=($pkgname-$pkgver.tar.gz::https://github.com/rust-motd/$pkgname/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('f72516241a7b9649c70f905bfae5fb40fc2c900d895a7fcaec66c8a5187da8ee')
options=()

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

build() {
    cd "$srcdir"/$pkgname-$pkgver
    cargo build --frozen --release
}

check() {
    cd "$srcdir"/$pkgname-$pkgver
    export RUSTUP_TOOLCHAIN=stable
    cargo test --frozen
}

package() {
    cd "$srcdir"/$pkgname-$pkgver
    install -Dm755 -t "$pkgdir"/usr/bin target/release/$pkgname
    install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
    install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname example_config.toml
}