summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80e325294ea4569010acc77bdb12e4d96b58369f (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: Kevin Kuehler <keur@ocf.berkeley.edu>

pkgname='dockfmt'
pkgver='v0.3.3'
pkgrel=1
pkgdesc='Dockerfile format and parser. Like `gofmt` but for Dockerfiles.'
arch=('x86_64')
url="https://github.com/jessfraz/$pkgname"
license=('MIT')
depends=()
makedepends=('go')
provides=('dockfmt')
conflicts=('dockfmt')
source=("$pkgname::git+$url#tag=$pkgver")
sha256sums=('SKIP')

prepare() {
  cd "$srcdir/$pkgname"
  go mod vendor
}

build() {
  cd "$srcdir/$pkgname"
  go build \
    -gcflags "all=-trimpath=${PWD}" \
    -asmflags "all=-trimpath=${PWD}" \
    -ldflags "-extldflags ${LDFLAGS}" \
    -o "$pkgname" .
}

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