summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5d27b136318b9566f08dd89bdec20a51ebaabfa2 (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
38
39
40
41
42
43
# Maintainer: noraj <printf %s 'YWxleGFuZHJlLnphbm5pQGV1cm9wZS5jb20='|base64 -d>

pkgname=bcrypt-tool-git
_pkgname=bcrypt-tool
pkgver=v1.1.6.r0.g952d8e7
pkgrel=1
pkgdesc='A CLI tool for bcrypt - hash a password, determine if password matches a hash, compute cost of hash.'
arch=('x86_64' 'aarch64')
url='https://github.com/shoenig/bcrypt-tool'
license=('MIT')
depends=()
conflicts=('bcrypt-tool')
makedepends=('git' 'go')
source=("git+https://github.com/shoenig/$_pkgname")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname

  GOPATH="$srcdir" go mod download
  GOPATH="$srcdir" go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-s -w" \
    -o $_pkgname .
}

package() {
  cd $_pkgname

  install -Dm 755 $_pkgname "$pkgdir/usr/bin/$_pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}