summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD50
-rw-r--r--tcptunnel.conf4
-rw-r--r--tcptunnel.service15
5 files changed, 90 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..b38451dbde2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = tcptunnel-git
+ pkgver = v0.8
+ pkgrel = 1
+ url = https://github.com/vakuum/tcptunnel
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ backup = etc/tcptunnel/tcptunnel.conf
+ source = tcptunnel-git::git+https://github.com/vakuum/tcptunnel.git
+ source = tcptunnel.service
+ source = tcptunnel.conf
+ md5sums = SKIP
+ md5sums = 9f7f07e2d2c9ee580a469838661bb370
+ md5sums = 96479f7d6fb3beeec44c9c64342d6626
+
+pkgname = tcptunnel-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..3e6c3f4501e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.zst
+pkg/
+src/
+tcptunnel-git/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..1bb614121a9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: YuutaW <i@yuuta.moe>
+pkgname=tcptunnel-git
+pkgver=v0.8
+pkgrel=1
+pkgdesc=""
+arch=(x86_64)
+url="https://github.com/vakuum/tcptunnel"
+license=('GPL')
+groups=()
+depends=()
+makedepends=('git')
+provides=()
+conflicts=()
+replaces=()
+backup=('etc/tcptunnel/tcptunnel.conf')
+options=()
+install=
+source=("$pkgname::git+https://github.com/vakuum/tcptunnel.git"
+ "tcptunnel.service"
+ "tcptunnel.conf")
+noextract=()
+md5sums=('SKIP'
+ '9f7f07e2d2c9ee580a469838661bb370'
+ '96479f7d6fb3beeec44c9c64342d6626')
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
+}
+
+prepare() {
+ cd "$srcdir/$pkgname"
+}
+
+build() {
+ cd "$srcdir/$pkgname"
+ ./configure --prefix="/usr"
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname"
+ make BINDIR="$pkgdir/usr/bin" install
+
+ mkdir -p $pkgdir/usr/lib/systemd/system
+ install -Dm644 $srcdir/tcptunnel.service $pkgdir/usr/lib/systemd/system/tcptunnel.service
+
+ mkdir -p $pkgdir/etc/tcptunnel
+ install -Dm644 $srcdir/tcptunnel.conf $pkgdir/etc/tcptunnel/tcptunnel.conf
+}
diff --git a/tcptunnel.conf b/tcptunnel.conf
new file mode 100644
index 00000000000..968f4ba60c6
--- /dev/null
+++ b/tcptunnel.conf
@@ -0,0 +1,4 @@
+LOCAL_PORT=80
+REMOTE_PORT=80
+REMOTE_HOST=1.1.1.1
+ADDITIONAL_CMDLINE=--log --bind-address=0.0.0.0
diff --git a/tcptunnel.service b/tcptunnel.service
new file mode 100644
index 00000000000..87d5baf1e80
--- /dev/null
+++ b/tcptunnel.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=A simple TCP port forwarder.
+After=network.target network-online.target
+
+[Service]
+User=nobody
+Group=nobody
+EnvironmentFile=/etc/tcptunnel/tcptunnel.conf
+ExecStart=/usr/bin/tcptunnel --stay-alive --local-port=${LOCAL_PORT} --remote-port=${REMOTE_PORT} --remote-host=${REMOTE_HOST} '$ADDITIONAL_CMDLINE'
+KillMode=mixed
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+
+[Install]
+WantedBy=multi-user.target