summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e357df4f9b641c85a32e3d8bd7c1ad60bce5fcdc (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
pkgname=correios-git
_pkgname=correios
pkgver=r18.0d75f6e
pkgrel=1
pkgdesc="Golang client for some Brazilian Post Office (Correios) services"
arch=('i686' 'x86_64')
url='https://github.com/paoloo/correios'
source=('git+https://github.com/paoloo/correios')
depends=()
makedepends=('go')
sha1sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$srcdir/$_pkgname"
  GO111MODULE=on go build -o "$srcdir/bin/correios"
}

package() {
  cd "$srcdir/bin"
  install -Dm755 'correios' "$pkgdir/usr/bin/correios"
}