summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD32
3 files changed, 50 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e9a393d6dd87
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = opdt-go
+ pkgdesc = Discover the actual outgoing address and port when behind a NAT
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/database64128/opdt-go
+ arch = x86_64
+ arch = aarch64
+ license = AGPL3
+ makedepends = go
+ backup = etc/opdt-go/config.json
+ source = opdt-go-1.0.0.tar.gz::https://github.com/database64128/opdt-go/archive/refs/tags/v1.0.0.tar.gz
+ b2sums = 495ccbd73f2ffa29c9051d6a2a352f67e97a5da57876f519f77b92537c9c79d91837e05417d41da9facbd11ea94bc107fef1b4d3978bd6a5f91d13cd4c20d730
+
+pkgname = opdt-go
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..2e38d96a13c2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+*.tar.gz
+*.tar.zst
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e448745df507
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: database64128 <free122448@hotmail.com>
+
+pkgname=opdt-go
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Discover the actual outgoing address and port when behind a NAT"
+arch=('x86_64' 'aarch64')
+url="https://github.com/database64128/$pkgname"
+license=('AGPL3')
+makedepends=('go')
+backup=("etc/$pkgname/config.json")
+source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
+b2sums=('495ccbd73f2ffa29c9051d6a2a352f67e97a5da57876f519f77b92537c9c79d91837e05417d41da9facbd11ea94bc107fef1b4d3978bd6a5f91d13cd4c20d730')
+
+build() {
+ cd "$pkgname-$pkgver"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath"
+ go build -ldflags='-s -w -linkmode=external' ./cmd/$pkgname
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ install -Dm644 docs/$pkgname.service "$pkgdir"/usr/lib/systemd/system/$pkgname.service
+ install -Dm644 docs/$pkgname@.service "$pkgdir"/usr/lib/systemd/system/$pkgname@.service
+ install -d "$pkgdir"/etc/$pkgname
+ install -Dm644 docs/config.json "$pkgdir"/etc/$pkgname/config.json
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+}