summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD45
2 files changed, 64 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1a0258b56283
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = protonvpn-cli
+ pkgdesc = ProtonVPN CLI tool for protonvpn.com
+ pkgver = 20180607
+ pkgrel = 1
+ url = https://github.com/ProtonVPN/protonvpn-cli
+ arch = any
+ license = MIT
+ makedepends = git
+ depends = openresolv
+ depends = openvpn
+ depends = python
+ depends = dialog
+ depends = wget
+ depends = procps-ng
+ source = git+https://github.com/ProtonVPN/protonvpn-cli.git
+ md5sums = SKIP
+
+pkgname = protonvpn-cli
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..be4ad63b3725
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: ddnomad <dd at ddworks dot io>
+
+pkgname=protonvpn-cli
+pkgver=20180607
+pkgrel=1
+pkgdesc="ProtonVPN CLI tool for protonvpn.com"
+arch=("any")
+url="https://github.com/ProtonVPN/protonvpn-cli"
+license=("MIT")
+depends=("openresolv" "openvpn" "python" "dialog" "wget" "procps-ng")
+makedepends=("git")
+source=("git+https://github.com/ProtonVPN/protonvpn-cli.git")
+md5sums=("SKIP")
+
+_update_resolv_conf_src_dir="openvpn-update-resolv-conf"
+_protonvpn_src_dir="protonvpn-cli"
+
+package() {
+ # Define paths
+ _update_resolv_conf_src_dir="${srcdir}/${_update_resolv_conf_src_dir}"
+ _protonvpn_src_dir="${srcdir}/${_protonvpn_src_dir}"
+
+ # Install update-resolv-conf dependency if needed
+ if ! test -f /etc/openvpn/update-resolv-conf; then
+ mkdir -p "${_update_resolv_conf_src_dir}"
+
+ git clone \
+ https://github.com/masterkorp/openvpn-update-resolv-conf.git \
+ "${_update_resolv_conf_src_dir}"
+
+ _oldpath="$(pwd)"
+ cd "${_update_resolv_conf_src_dir}"
+ install -D -m655 update-resolv-conf.sh \
+ "${pkgdir}/etc/openvpn/update-resolv-conf"
+ cd "${_oldpath}"
+ fi
+
+ # Install protonvpn-cli package
+ cd "${_protonvpn_src_dir}"
+ install -Dm755 ./protonvpn-cli.sh "${pkgdir}/usr/bin/${pkgname}"
+ ln -s "${pkgdir}/usr/bin/${pkgname}" "${pkgdir}/usr/bin/pvpn"
+
+ # Install the license
+ install -Dm644 ./license.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}