summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46208c60f4555a405abf75bc9e775900c98fca7d (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
# Maintainer: Galen Guyer <galen@galenguyer.com>
pkgname='hancock-git'
_gitname=hancock
pkgver=2022.02.02_40
pkgrel=1
description='A simple x509 certificate manager (git version)'
arch=('any')
url='https://github.com/galenguyer/hancock'
license=('MIT')
makedepends=('git' 'go')
source=('git+https://github.com/galenguyer/hancock-go')
sha256sums=('SKIP')

pkgver() {
    cd ${_gitname}
    _commits=$(git rev-list --count HEAD) # total commits is the most sane way of getting incremental pkgver
    _date=$(git log -1 --date=short --pretty=format:%cd)
    printf "%s_%s\n" "${_date}" "${_commits}" | sed 's/-/./g'
}


prepare() {
    cd "$_gitname"
    mkdir -p build/
}

build () {
    cd "$_gitname"
    go build -o build/
}

package () {
    cd "$_gitname"
    install -Dm755 build/$_gitname "$pkgdir"/usr/bin/$_gitname
}