summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2022-05-04 13:51:56 +1200
committerGeorge Rawlinson2022-05-04 13:51:56 +1200
commit64856465500994ab5217127803c20bdbd3335a18 (patch)
treeb2c61f9ff1de68c5eef82e268de97b75e138cade
downloadaur-64856465500994ab5217127803c20bdbd3335a18.tar.gz
addpkg: gosniff r38-1
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD59
2 files changed, 75 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..bea7348367a2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = gosniff
+ pkgdesc = A fancy-schmancy tcpdump-esque TUI, programmed in Go
+ pkgver = r38.17ac522
+ pkgrel = 1
+ url = https://github.com/c-grimshaw/gosniff
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ depends = libpcap
+ options = !lto
+ source = gosniff::git+https://github.com/c-grimshaw/gosniff#commit=17ac522a8bb0c0ea3545e06f864f8db476fa5f8e
+ md5sums = SKIP
+
+pkgname = gosniff
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a52a79f10eed
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,59 @@
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
+
+pkgname=gosniff
+pkgver=r38.17ac522
+pkgrel=1
+pkgdesc='A fancy-schmancy tcpdump-esque TUI, programmed in Go'
+arch=('x86_64')
+url='https://github.com/c-grimshaw/gosniff'
+license=('MIT')
+depends=('glibc' 'libpcap')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='17ac522a8bb0c0ea3545e06f864f8db476fa5f8e'
+source=("$pkgname::git+$url#commit=$_commit")
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$pkgname"
+
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$pkgname"
+
+ # download dependencies
+ go mod download
+}
+
+build() {
+ cd "$pkgname"
+
+ # set Go flags
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+
+ go build -v \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags ${LDFLAGS}" \
+ .
+}
+
+check() {
+ cd "$pkgname"
+
+ go test -v ./...
+}
+
+package() {
+ cd "$pkgname"
+
+ install -vDm755 -t "$pkgdir/usr/bin" gosniff
+
+ install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}