summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 430d27081bf02a8b097cd418ef3b1cc75b025e94 (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: fzerorubigd <fzero@rubi.gd>

pkgname=gomodifytags-git
pkgver=40.20180122
pkgrel=1
pkgdesc="Go tool to modify struct field tags"
arch=('i686' 'x86_64')
url="https://github.com/fatih/gomodifytags"
license=('BSD')
depends=('glibc')
makedepends=('go' 'git')
source=('git+https://github.com/fatih/gomodifytags')
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/gomodifytags"
    printf "%s.%s" "$(git rev-list --count HEAD)" "$(git log -1 --format=%cd --date=short | tr -d -)"
}

prepare() {
    mkdir -p "${srcdir}/src/github.com/fatih/"
    ln -sf "${srcdir}/gomodifytags" "${srcdir}/src/github.com/fatih/"
}

build() {
    export GOPATH="${srcdir}"
    cd "${srcdir}/src/github.com/fatih/gomodifytags"
    go get -v
    go build -o gomodifytags
}

package() {
    cd "${srcdir}/src/github.com/fatih/gomodifytags"
    install -Dm755 gomodifytags "${pkgdir}/usr/bin/gomodifytags"
}