summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d7d73c394bc0dbfa6eec60cc0c21a389c38f963 (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
pkgname=ght-git
pkgver=r49.bdc427f
pkgrel=2
pkgdesc="CLI to fetch and print HTML page titles"
arch=('x86_64')
url="https://github.com/haturatu/ght"
license=('BSD-3-Clause')
depends=('glibc')
makedepends=('git' 'go')
optdepends=('xclip: clipboard support on X11' 'wl-clipboard: clipboard support on Wayland')
provides=('ght')
conflicts=('ght')
source=('git+https://github.com/haturatu/ght.git')
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/ght"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  cd "$srcdir/ght"
  go build -trimpath -ldflags="-s -w" -o ght .
}

check() {
  cd "$srcdir/ght"
  go test ./...
}

package() {
  install -Dm755 "$srcdir/ght/ght" "$pkgdir/usr/bin/ght"
  install -Dm644 "$srcdir/ght/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 "$srcdir/ght/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
}