summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles DELFLY2020-06-24 17:44:57 +0700
committerCharles DELFLY2020-06-24 17:44:57 +0700
commitc8e7df665f8ae9a086365f6502f0b07d39d4d216 (patch)
tree1e8b9f4a7621b979b9f55368a5c041880af15061
parentdcfa942a506fb9b065381487ced68f6ea170a5e8 (diff)
downloadaur-c8e7df665f8ae9a086365f6502f0b07d39d4d216.tar.gz
Fix sudoer issue raised by @aborigines and improve package with feedback from @aminvakil
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD9
-rw-r--r--user-env.patch30
3 files changed, 22 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6b5b8ef5b899..6c464f3d1337 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openfortigui
pkgdesc = OpenFortiGUI is an open-source VPN-Client to connect to Fortigate VPN-Hardware. It is based on openfortivpn and adds an easy to use and nice GUI on top of it, written in Qt5.
pkgver = 0.9.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/theinvisible/openfortigui.git
arch = i686
arch = x86_64
@@ -16,7 +16,7 @@ pkgbase = openfortigui
source = git+https://github.com/theinvisible/openfortigui.git#tag=v0.9.0-3
source = user-env.patch
md5sums = SKIP
- md5sums = be12ed116cb5a39c69e8f0da7ff67db7
+ md5sums = e240e160ab4400ad78498dcf78540ef2
pkgname = openfortigui
diff --git a/PKGBUILD b/PKGBUILD
index a99fde29fbf2..99fc51623ea8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Charles Delfly <charles@delfly.fr>
pkgname=openfortigui
pkgver=0.9.0
-pkgrel=1
+pkgrel=2
pkgdesc="OpenFortiGUI is an open-source VPN-Client to connect to Fortigate VPN-Hardware. It is based on openfortivpn and adds an easy to use and nice GUI on top of it, written in Qt5."
arch=('i686' 'x86_64')
url="https://github.com/theinvisible/openfortigui.git"
@@ -16,21 +16,21 @@ options=()
install=
source=("git+https://github.com/theinvisible/$pkgname.git#tag=v$pkgver-3" "user-env.patch")
noextract=()
-md5sums=('SKIP' 'be12ed116cb5a39c69e8f0da7ff67db7')
+md5sums=('SKIP' 'e240e160ab4400ad78498dcf78540ef2')
prepare() {
cd "$srcdir/$pkgname"
- ls -la
cd openfortigui
git submodule init
git submodule update
cd ..
+ patch -p1 < ../../user-env.patch
}
build() {
cd "$srcdir/$pkgname"
qmake
- make -j4
+ make
}
check() {
@@ -42,6 +42,7 @@ package() {
cd "$srcdir/$pkgname/openfortigui"
mkdir -p $pkgdir/usr/bin $pkgdir/usr/share/pixmaps $pkgdir/usr/share/applications $pkgdir/etc/sudoers.d $pkgdir/etc/openfortigui/vpnprofiles
install -m 755 openfortigui $pkgdir/usr/bin/
+ chmod 640 $pkgdir/etc/sudoers.d
install -m 440 sudo/openfortigui $pkgdir/etc/sudoers.d
install -m 644 app-entry/openfortigui.png $pkgdir/usr/share/pixmaps/
install -m 644 app-entry/openfortigui.desktop $pkgdir/usr/share/applications/
diff --git a/user-env.patch b/user-env.patch
index 1216f02ebf7a..f20673f10768 100644
--- a/user-env.patch
+++ b/user-env.patch
@@ -1,19 +1,19 @@
+diff --git a/openfortigui/app-entry/openfortigui.desktop b/openfortigui/app-entry/openfortigui.desktop
+index 41b98d4..16a07a8 100644
+--- a/openfortigui/app-entry/openfortigui.desktop
++++ b/openfortigui/app-entry/openfortigui.desktop
+@@ -3,6 +3,6 @@ Type=Application
+ Name=openFortiGUI
+ Comment=GUI for openfortivpn
+ Icon=/usr/share/pixmaps/openfortigui.png
+-Exec=/usr/bin/openfortigui
++Exec=/usr/bin/sudo /usr/bin/openfortigui
+ Terminal=false
+ Categories=Network;Application;
diff --git a/openfortigui/sudo/openfortigui b/openfortigui/sudo/openfortigui
-index 7b2fb8e..80062e6 100644
+index dd594aa..714360b 100644
--- a/openfortigui/sudo/openfortigui
+++ b/openfortigui/sudo/openfortigui
@@ -1 +1 @@
--%sudo ALL=NOPASSWD: /usr/bin/openfortigui
-+%wheel ALL=NOPASSWD:SETENV: /usr/bin/openfortigui
-diff --git a/openfortigui/vpnmanager.cpp b/openfortigui/vpnmanager.cpp
-index baede6b..2f5fd1e 100644
---- a/openfortigui/vpnmanager.cpp
-+++ b/openfortigui/vpnmanager.cpp
-@@ -74,6 +74,7 @@ void vpnManager::startVPN(const QString &name)
- return;
-
- QStringList arguments;
-+ arguments << "-E";
- arguments << QCoreApplication::applicationFilePath();
- arguments << "--start-vpn";
- arguments << "--vpn-name";
+-%sudo ALL=NOPASSWD:SETENV: /usr/bin/openfortigui --start-vpn *
++%wheel ALL=NOPASSWD:SETENV: /usr/bin/openfortigui --start-vpn *