summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6330a3dbfa2248386140f2fcc427bcdcd67c371e (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
# Maintainer: DrRac27 <drrac27 at riseup dot net>
pkgname=guzuta-git
pkgver=v0.4.0.r10.48561de
pkgrel=1
pkgdesc="Custom repository manager for ArchLinux pacman"
arch=("x86_64")
url="https://github.com/eagletmt/guzuta"
license=("MIT")
provides=("guzuta")
makedepends=("cargo" "git")
conflicts=("guzuta")
source=("$pkgname::git+$url")
sha1sums=("SKIP")

build() {
    cd "$pkgname"
    cargo build --release --locked --all-features --target-dir=target
}

pkgver() {
    cd "$pkgname"
    local tag=$(git tag --sort=-v:refname | head -1)
    local commits_since=$(git rev-list $tag..HEAD --count)
    echo "$tag.r$commits_since.$(git log --pretty=format:'%h' -n 1)"
}

package() {
    cd "$pkgname"
    install -Dm 755 target/release/guzuta -t "${pkgdir}/usr/bin"

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