summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c36de00ef551c1b097891da1f091f3439e3f42ef (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
44
45
46
# Contributor: gilcu3
# Maintainer: gilcu3

pkgname=watch-your-lan
_pkgname=WatchYourLAN
pkgver=2.0.4
pkgrel=1
pkgdesc='Lightweight network IP scanner with web GUI.'
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/aceberg/WatchYourLAN"
license=('MIT')
depends=('arp-scan' 'tzdata')
makedepends=('go')
source=("$url/archive/refs/tags/$pkgver.tar.gz" "$_pkgname.install")
sha256sums=('2c561c73dc75a210ebdbc0deccf478bc36ec2c33972bc75a83624f90445ae207'
            'd632e52726e2de9217df8e8a5e6f73697cee38a2b40e2d1c502ff4a603937765')
install=$_pkgname.install


prepare() {
  cd "$_pkgname-$pkgver"
  rm go.mod
  go mod init "${url#https://}" # strip https:// from canonical URL
  go mod tidy
}

export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"

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

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