summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16520a60ddf19f82163cd1a5b6fbef9cab369395 (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
pkgname=tcping-go-git
_pkgname=tcping
pkgver=1.12.1.r29.g3a1dc3a
pkgrel=1
pkgdesc="Ping TCP ports. Inspired by Linux's ping utility. Written in Go"
provides=('tcping' 'tcping-go')
conflicts=('tcping' 'tcping-go')
arch=('x86_64')
url="https://github.com/pouriyajamshidi/tcping"
license=('MIT')
makedepends=('go' 'git')
source=("git+https://github.com/pouriyajamshidi/$_pkgname.git")
sha256sums=('SKIP')

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

build() {
  cd "$srcdir/tcping"
  go build \
      -trimpath \
      -buildmode=pie \
      -mod=readonly \
      -modcacherw \
      -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
      .
}

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