summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31cf74f4753ef2ed48b27cc55d354efcce075c14 (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
# Maintainer: Daniel Lublin <daniel@lublin.se>

_pkgname=hd
pkgname=$_pkgname-git
pkgver=1.0.0.r5.g4bc9165
pkgrel=1
pkgdesc='Small hex dumper utility (with optional HexII output)'
arch=('i686' 'x86_64')
url="https://github.com/kastelo/$_pkgname"
license=('MIT')
makedepends=('git' 'go-pie')
provides=($_pkgname)
conflicts=($_pkgname)
source=("$_pkgname::git+$url")
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname
  go build \
    -trimpath \
    -buildmode=pie \
    -modcacherw \
    -ldflags "-extldflags \"${LDFLAGS}\"" \
    -o $_pkgname \
    .
}

package() {
  cd $_pkgname
  install -Dm755 $_pkgname "$pkgdir"/usr/bin/$_pkgname
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}