diff options
author | dallo | 2024-02-15 00:28:04 +0000 |
---|---|---|
committer | dallo | 2024-02-15 00:28:04 +0000 |
commit | 8e0b9c091660c9f6c1b672b90de8dd4f48c11ee3 (patch) | |
tree | bb2d972f6503b3d9b81f72da8b74a5f85e35a407 | |
download | aur-8e0b9c091660c9f6c1b672b90de8dd4f48c11ee3.tar.gz |
Update PKGBUILD and .SRCINFO with GitHub Actions
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 23 | ||||
-rw-r--r-- | surfshark-yac.install | 123 |
4 files changed, 173 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..64e1a00a675e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = surfshark-yac + pkgdesc = Yet another Surfshark VPN GUI Client for the AUR. + pkgver = 2.2.0.2835 + pkgrel = 1 + url = https://surfshark.com + install = surfshark-yac.install + arch = x86_64 + license = custom:surfshark + depends = alsa-lib + depends = at-spi2-core + depends = gjs + depends = nss + depends = org.freedesktop.secrets + depends = wireguard-tools + provides = surfshark-yac + conflicts = surfshark-yac + options = !strip + options = !emptydirs + source = https://ocean.surfshark.com/debian/pool/main/s/surfshark_2.2.0_amd64.deb + sha256sums = c9dc96dbcf7a970e4fe2b4de71e3fb6655f75446ef1dbfc02856ff5de40efb64 + +pkgname = surfshark-yac diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..85351f6940e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/*.deb +/*.tar.xz +/*.tar.zst +/pkg/ +/src/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6782653bec6e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Dallo <dallo@tutanota.com> + +pkgname=surfshark-yac +pkgver=2.2.0.2835 +pkgrel=1 +pkgdesc="Yet another Surfshark VPN GUI Client for the AUR." +arch=('x86_64') +url="https://surfshark.com" +license=('custom:surfshark') +depends=('alsa-lib' 'at-spi2-core' 'gjs' 'nss' 'org.freedesktop.secrets' 'wireguard-tools') +options=('!strip' '!emptydirs') +provides=("surfshark-yac") +conflicts=("surfshark-yac") +install=surfshark-yac.install +source=("https://ocean.surfshark.com/debian/pool/main/s/surfshark_2.2.0_amd64.deb") +sha256sums=('c9dc96dbcf7a970e4fe2b4de71e3fb6655f75446ef1dbfc02856ff5de40efb64') + +package() { + # Extract package data + tar -xJ -f data.tar.xz -C "${pkgdir}" + + install -D -m644 "${pkgdir}/opt/Surfshark/resources/dist/resources/surfsharkd.js.LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/surfshark-yac.install b/surfshark-yac.install new file mode 100644 index 000000000000..af0469606ffb --- /dev/null +++ b/surfshark-yac.install @@ -0,0 +1,123 @@ +post_install() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + PATH="/sbin:/usr/sbin:/bin:/usr/bin" + + ln -sf '/opt/Surfshark/surfshark' '/usr/bin/surfshark' + + chmod 4755 '/opt/Surfshark/chrome-sandbox' || true + + update-mime-database /usr/share/mime || true + update-desktop-database /usr/share/applications || true + + mkdir -p /usr/lib/systemd/user || true + echo " + [Unit] + Description=Surfshark Daemon + + [Service] + ExecStart=/opt/Surfshark/resources/dist/resources/surfsharkd.js + Restart=on-failure + RestartSec=5 + IPAddressDeny=any + RestrictRealtime=true + ProtectKernelTunables=true + ProtectSystem=full + RestrictSUIDSGID=true + + [Install] + WantedBy=default.target + " > /usr/lib/systemd/user/surfsharkd.service || true + + mkdir -p /usr/lib/systemd/system || true + echo " + [Unit] + Description=Surfshark Daemon2 + + [Service] + ExecStart=/opt/Surfshark/resources/dist/resources/surfsharkd2.js + Restart=on-failure + RestartSec=5 + IPAddressDeny=any + RestrictRealtime=true + ProtectKernelTunables=true + ProtectSystem=full + RestrictSUIDSGID=true + + [Install] + WantedBy=default.target + " > /usr/lib/systemd/system/surfsharkd2.service || true + + chmod 644 /usr/lib/systemd/user/surfsharkd.service || true + chmod 644 /usr/lib/systemd/system/surfsharkd2.service || true + + chmod 755 '/opt/Surfshark/resources/dist/resources/surfsharkd.js' || true + + chmod 755 '/opt/Surfshark/resources/dist/resources/surfsharkd2.js' || true + + chmod 755 '/opt/Surfshark/resources/dist/resources/update' || true + chmod 755 '/opt/Surfshark/resources/dist/resources/diagnostics' || true + + chmod 755 '/etc/init.d/surfshark' || true + chmod 755 '/etc/init.d/surfshark2' || true + + case "$(ps -p 1 --no-headers -o '%c' | tr -d '\n')" in + systemd) + systemctl daemon-reload || true + systemctl enable --global surfsharkd.service || true + ;; + init) + update-rc.d surfshark defaults || true + update-rc.d surfshark2 defaults || true + /etc/init.d/surfshark restart || true + /etc/init.d/surfshark2 restart || true + ;; + *) + echo "Unsupported service manager" + ;; + esac + update-desktop-database -q +} + +post_upgrade() { + post_install +} + +post_remove() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + PATH="/sbin:/usr/sbin:/bin:/usr/bin" + + systemctl disable --global surfsharkd.service || true + systemctl disable surfsharkd2.service || true + + systemctl stop surfsharkd2.service || true + + /etc/init.d/surfshark stop || true + /etc/init.d/surfshark2 stop || true + + kill -15 $(pidof surfshark) || : + kill -15 $(pgrep surfsharkd) || : + + rm -rf /run/surfshark || : + rm -f /tmp/surfsharkd.sock || : + rm -f /tmp/surfshark-electron.sock || : + rm -f $XDG_RUNTIME_DIR/surfsharkd.sock || : + rm -f $XDG_RUNTIME_DIR/surfshark-electron.sock || : + + rm -f '/usr/bin/surfshark' || : + + # Surfshark post-remove + nmcli connection delete surfshark_ipv6 || true + nmcli connection delete surfshark_wg || true + nmcli connection delete surfshark_openvpn || true + + shopt -s globstar + if [ "$1" = purge ]; then + rm -rf /home/**/.config/Surfshark || true + fi + + rm -rf /home/**/.cache/Surfshark || true + + iptables -S | grep surfshark_ks | sed -r '/.*comment.*surfshark_ks*/s/-A/iptables -D/e' || true + ip6tables -S | grep surfshark_ks | sed -r '/.*comment.*surfshark_ks*/s/-A/ip6tables -D/e' || true + update-desktop-database -q +} |