summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonard König2021-02-02 16:58:03 +0100
committerLeonard König2021-02-02 16:58:03 +0100
commit15c3e0f19d6d6a44aad6da7b9348145547d389c0 (patch)
treed022b2853bacfdf8b58563e9f384e9bd1060be2e
downloadaur-15c3e0f19d6d6a44aad6da7b9348145547d389c0.tar.gz
initial import from upstream PR
https://github.com/LeonardKoenig/hide.client.linux/tree/prq_archlinux
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD62
-rw-r--r--config_sysdirs.patch22
-rw-r--r--service_sysdirs.patch24
4 files changed, 124 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5e86dd4b11e6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = hide-client
+ pkgdesc = Hide.me CLI VPN client for Linux
+ pkgver = 0.9.1
+ pkgrel = 1
+ url = hide.me
+ arch = any
+ license = GPL2
+ source = https://github.com/eventure/hide.client.linux/archive/0.9.1.zip
+ source = config_sysdirs.patch
+ source = service_sysdirs.patch
+ md5sums = 9346e79e8e1c98b5457a03e02febca9c
+ md5sums = 07d59ac194c4aa8ee0de284283796461
+ md5sums = b2cee66ea77a0d76460131144d0a16b0
+
+pkgname = hide-client
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..09f011b52643
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Leonard Janis Robert König <ljrk at ljrk dot org>
+pkgname=hide-client
+_pkgname=hide.client.linux
+pkgver=0.9.1
+pkgrel=1
+epoch=
+pkgdesc="Hide.me CLI VPN client for Linux"
+arch=('any')
+url="hide.me"
+license=('GPL2')
+groups=()
+depends=()
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=("https://github.com/eventure/$_pkgname/archive/$pkgver.zip"
+ "config_sysdirs.patch"
+ "service_sysdirs.patch")
+noextract=()
+md5sums=('9346e79e8e1c98b5457a03e02febca9c'
+ '07d59ac194c4aa8ee0de284283796461'
+ 'b2cee66ea77a0d76460131144d0a16b0')
+validpgpkeys=()
+
+prepare() {
+ cd "$_pkgname-$pkgver"
+ patch -p1 -i "$srcdir/config_sysdirs.patch"
+ patch -p1 -i "$srcdir/service_sysdirs.patch"
+}
+
+build() {
+ cd "$_pkgname-$pkgver"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ # readonly breaks build
+# export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -modcacherw"
+ go build -o hide.me .
+}
+
+#check() {
+# cd "$_pkgname-$pkgver"
+# go test .
+#}
+
+package() {
+ cd "$_pkgname-$pkgver"
+ install -Dm755 -t "$pkgdir"/usr/bin/ hide.me
+ install -Dm644 -t "$pkgdir"/usr/share/hide.me/ CA.pem
+ # For (system-wide) accessToken.txt
+ install -dm750 "$pkgdir"/etc/hide.me/
+ install -Dm644 -t "$pkgdir"/usr/lib/systemd/system/ hide.me@.service
+}
diff --git a/config_sysdirs.patch b/config_sysdirs.patch
new file mode 100644
index 000000000000..4abdecdcf358
--- /dev/null
+++ b/config_sysdirs.patch
@@ -0,0 +1,22 @@
+diff --git a/configuration/configuration.go b/configuration/configuration.go
+index ac3947c..d65da20 100644
+--- a/configuration/configuration.go
++++ b/configuration/configuration.go
+@@ -40,8 +40,8 @@ func NewHideGuardConfiguration() *HideGuardConfiguration {
+ Host: "", // command line option "-n"
+ Port: 432, // command line option "-p"
+ Domain: "hide.me", // Not configurable
+- CA: "CA.pem", // command line option "-ca"
+- AccessTokenFile: "accessToken.txt", // command line option "-t"
++ CA: "/usr/share/hide.me/CA.pem", // command line option "-ca"
++ AccessTokenFile: "/etc/hide.me/accessToken.txt", // command line option "-t"
+ Username: "", // command line option "-u"
+ Password: "", // Only configurable through the config file
+ ConnectTimeout: 10 * time.Second, // Only configurable through the config file
+@@ -120,4 +120,4 @@ func ( c *HideGuardConfiguration ) InteractiveCredentials() ( err error ) {
+ func ( c *HideGuardConfiguration ) Print() {
+ if out, err := yaml.Marshal( c ); err != nil { fmt.Println( err ) } else { fmt.Print( string( out ) ) }
+ return
+-}
+\ No newline at end of file
++}
diff --git a/service_sysdirs.patch b/service_sysdirs.patch
new file mode 100644
index 000000000000..4d82f7b52018
--- /dev/null
+++ b/service_sysdirs.patch
@@ -0,0 +1,24 @@
+diff --git a/hide.me@.service b/hide.me@.service
+index b32902f..641241d 100644
+--- a/hide.me@.service
++++ b/hide.me@.service
+@@ -6,9 +6,9 @@ DefaultDependencies=yes
+
+ [Service]
+ Type=notify
+-ExecStart=/opt/hide.me/hide.me connect %i
+-WorkingDirectory=/opt/hide.me
+-ReadWritePaths=/opt/hide.me /etc
++ExecStart=/usr/bin/hide.me/hide.me connect %i
++WorkingDirectory=/usr/bin/hide.me
++ReadWritePaths=/usr/bin/hide.me /etc
+ TimeoutStopSec=30
+ Restart=always
+ RestartSec=5s
+@@ -30,4 +30,4 @@ Group=root
+ LimitNOFILE=64
+
+ [Install]
+-WantedBy=multi-user.target
+\ No newline at end of file
++WantedBy=multi-user.target