summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5cb2fc4df5648d94de3642eefcbe97af831e5061 (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.1.2
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=('d01eb91f674054768eaa0680f7a38233823ab2b0964cb06f5bbd86691147d944'
            '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"
}