summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8532692b0a3326a40aa576edb897ade2c4630bbf (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
46
47
48
49
# Maintainer: uttarayan21 <uttarayan21@disroot.org>

pkgname=macchina-git
_pkgname=macchina
pkgver=6.0.1.4dc463d
pkgrel=1
pkgdesc="Basic system information fetcher, written in Rust"

arch=('x86_64')
url="https://github.com/macchina-cli/macchina"
license=('MIT')

depends=('gcc-libs' 'glibc')
optdepends=('wmctrl: window manager support')
provides=("macchina=${pkgver}")
conflicts=("macchina")
makedepends=('rust' 'cargo' 'git')
source=("$pkgname::git+${url}.git")
md5sums=('SKIP')


pkgver() {
    cd "$pkgname"
    echo "$(grep ^version Cargo.toml | cut -d= -f2 | tr -d ' "').$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$pkgname"
}

build() {
    cd "$pkgname"
    cargo build --release
}


package() {
    cd "$pkgname"
    targetdir=${CARGO_TARGET_DIR:-target}

    install -Dm755 "$targetdir/release/macchina" "$pkgdir/usr/bin/$_pkgname"
    install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"

    install -Dm 644 "doc/man/${_pkgname}.1" -t "${pkgdir}/usr/share/man/man1"
    install -Dm 644 "doc/man/${_pkgname}.7" -t "${pkgdir}/usr/share/man/man7"

    install -d "${pkgdir}/usr/share/${_pkgname}/themes"
    install -m 644 contrib/themes/* "${pkgdir}/usr/share/${_pkgname}/themes"
}