upgpkg: hide-client 0.9.9-2

switch to patch instead of sed
This commit is contained in:
Giovanni Harting 2024-05-19 13:43:14 +02:00
parent d6f17ea108
commit 1b847bcf83
3 changed files with 59 additions and 14 deletions

View File

@ -1,7 +1,7 @@
pkgbase = hide-client
pkgdesc = Hide.me CLI VPN client for Linux
pkgver = 0.9.9
pkgrel = 1
pkgrel = 2
url = https://github.com/eventure/hide.client.linux
arch = x86_64
arch = aarch64
@ -11,6 +11,8 @@ pkgbase = hide-client
depends = glibc
backup = etc/hide.me/config
source = hide-client-0.9.9.zip::https://github.com/eventure/hide.client.linux/archive/0.9.9.zip
source = arch-config.patch
b2sums = ca30b3442d9cee438c69719725f33d6702e82c252d5ee2130e984bc57f221edfa2dc943b07c6564f347cb4c618d0d5b0ab98851da31f8da0fe37e803f837c84b
b2sums = bcb78baaf6682803cddd29a770a229bf9baf79c26244759db7176b65ff3b0c82fc1561066fbd81a68dcd77911bad654827ac2fba19d1ced0d33718b8a9831ed3
pkgname = hide-client

View File

@ -4,7 +4,7 @@
pkgname=hide-client
_name=hide.client.linux
pkgver=0.9.9
pkgrel=1
pkgrel=2
pkgdesc='Hide.me CLI VPN client for Linux'
arch=(x86_64 aarch64 armv7h)
url='https://github.com/eventure/hide.client.linux'
@ -12,21 +12,16 @@ license=(GPL-2.0-only)
depends=(glibc)
makedepends=(go)
backup=('etc/hide.me/config')
source=("$pkgname-$pkgver.zip::$url/archive/$pkgver.zip")
b2sums=('ca30b3442d9cee438c69719725f33d6702e82c252d5ee2130e984bc57f221edfa2dc943b07c6564f347cb4c618d0d5b0ab98851da31f8da0fe37e803f837c84b')
source=("$pkgname-$pkgver.zip::$url/archive/$pkgver.zip"
arch-config.patch)
b2sums=('ca30b3442d9cee438c69719725f33d6702e82c252d5ee2130e984bc57f221edfa2dc943b07c6564f347cb4c618d0d5b0ab98851da31f8da0fe37e803f837c84b'
'bcb78baaf6682803cddd29a770a229bf9baf79c26244759db7176b65ff3b0c82fc1561066fbd81a68dcd77911bad654827ac2fba19d1ced0d33718b8a9831ed3')
prepare() {
cd $_name-$pkgver
sed -e "s|CA.pem|/usr/share/hide.me/CA.pem|" \
-e "s|accessToken.txt|/etc/hide.me/accessToken.txt|" \
-i configuration.go
sed -e "s|/opt/hide.me/hide.me|/usr/bin/hide.me|" \
-e "s|WorkingDirectory=/opt/hide.me|WorkingDirectory=/etc/hide.me|" \
-e "s|ReadWritePaths=/opt/hide.me /etc|ReadWritePaths=/etc/hide.me|" \
-e "s|/opt/hide.me/config|/etc/hide.me/config|" \
-i 'hide.me@.service'
# patch config to arch-specific defaults
patch -p1 < ../arch-config.patch
}
build() {
@ -42,7 +37,7 @@ build() {
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-ldflags "-linkmode external" \
-o hide.me \
.
}

View File

@ -0,0 +1,48 @@
diff --git a/configuration.go b/configuration.go
index 06f170a..bd80daa 100644
--- a/configuration.go
+++ b/configuration.go
@@ -41,8 +41,8 @@ func NewConfiguration() *Configuration {
Host: "", // command line option "-n"
Port: 432, // command line option "-p"
Domain: "hide.me", // Not configurable
- CA: "CA.pem", // command line option "-ca"
- AccessTokenPath: "accessToken.txt", // command line option "-t"
+ CA: "/usr/share/hide.me/CA.pem", // command line option "-ca"
+ AccessTokenPath: "/etc/hide.me/accessToken.txt", // command line option "-t"
Username: "", // command line option "-u"
Password: "", // Only configurable through the config file
RestTimeout: 10 * time.Second, // Only configurable through the config file
@@ -188,4 +188,4 @@ func ( c *Configuration ) Parse() ( err error ) {
if err != nil { return }
})
return
-}
\ No newline at end of file
+}
diff --git a/hide.me@.service b/hide.me@.service
index 58cea7c..db02f09 100644
--- a/hide.me@.service
+++ b/hide.me@.service
@@ -6,10 +6,10 @@ DefaultDependencies=yes
[Service]
Type=notify
-ExecStart=/opt/hide.me/hide.me $OPTIONS connect %i
-WorkingDirectory=/opt/hide.me
-ReadWritePaths=/opt/hide.me /etc /run/systemd/resolve
-EnvironmentFile=/opt/hide.me/config
+ExecStart=/usr/bin/hide.me $OPTIONS connect %i
+WorkingDirectory=/etc/hide.me
+ReadWritePaths=/etc/hide.me -/run/systemd/resolve
+EnvironmentFile=/etc/hide.me/config
TimeoutStopSec=30
Restart=always
RestartSec=5s
@@ -31,4 +31,4 @@ Group=root
LimitNOFILE=64
[Install]
-WantedBy=multi-user.target
\ No newline at end of file
+WantedBy=multi-user.target