summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD23
-rw-r--r--forticlient-vpn.changelog8
-rw-r--r--forticlient-vpn.install119
4 files changed, 165 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index dbcdf2d44918..54563b10de74 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,29 @@
pkgbase = forticlient-vpn
pkgdesc = Build through the official package of FortiClient VPN
- pkgver = 6.4.0.0851
- pkgrel = 8
+ pkgver = 6.4.3.0959
+ pkgrel = 1
url = https://forticlient.com/
+ install = forticlient-vpn.install
arch = x86_64
license = custom:fortinet
+ depends = nss
+ depends = gtk3
+ depends = libxss
+ depends = polkit
+ depends = openssl
+ depends = libnotify
+ depends = org.freedesktop.secrets
+ optdepends = libappindicator-gtk2: for show trayicon
+ optdepends = mate-polkit: for polkit authentication
+ optdepends = polkit-gnome: for polkit authentication
+ optdepends = polkit-kde-agent: for polkit authentication
+ optdepends = deepin-polkit-agent: for polkit authentication
+ optdepends = patheon-polkit-agent: for polkit authentication
+ optdepends = lxqt-policykit: for polkit authentication
provides = fortivpn
provides = FortiClient
- source = https://filestore.fortinet.com/forticlient/downloads/FortiClientFullVPNInstaller_6.4.0.0851.deb
- sha256sums = d229a2f3f13378244058b5b678d25976ba85e5d4c1b247ed2c3c242f6604ed2b
+ source = https://filestore.fortinet.com/forticlient/downloads/FortiClientFullVPNInstaller_6.4.3.0959.deb
+ sha256sums = 728a416b93ff4944b9c1d5974ac29eefad2d5fca33efd48a2967db23fd7450ea
pkgname = forticlient-vpn
diff --git a/PKGBUILD b/PKGBUILD
index af5c9ecfaade..dbd5b3e477b1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,25 @@
# Maintainer: Douglas Iuri Medeiros Cabral <diurimc at gmail dot com>
pkgname=forticlient-vpn
-pkgver=6.4.0.0851
-pkgrel=8
+pkgver=6.4.3.0959
+pkgrel=1
pkgdesc="Build through the official package of FortiClient VPN"
arch=("x86_64")
url="https://forticlient.com/"
license=('custom:fortinet')
+depends=('nss' 'gtk3' 'libxss' 'polkit' 'openssl' 'libnotify' 'org.freedesktop.secrets')
+optdepends=(
+ 'libappindicator-gtk2: for show trayicon'
+ 'mate-polkit: for polkit authentication'
+ 'polkit-gnome: for polkit authentication'
+ 'polkit-kde-agent: for polkit authentication'
+ 'deepin-polkit-agent: for polkit authentication'
+ 'patheon-polkit-agent: for polkit authentication'
+ 'lxqt-policykit: for polkit authentication'
+)
provides=('fortivpn' 'FortiClient')
+install='forticlient-vpn.install'
source=("https://filestore.fortinet.com/forticlient/downloads/FortiClientFullVPNInstaller_${pkgver}.deb")
-sha256sums=('d229a2f3f13378244058b5b678d25976ba85e5d4c1b247ed2c3c242f6604ed2b')
+sha256sums=('728a416b93ff4944b9c1d5974ac29eefad2d5fca33efd48a2967db23fd7450ea')
package() {
@@ -25,7 +36,11 @@ package() {
# Symbolic binaries which are located in /opt
mkdir -p ${pkgdir}/usr/bin
ln -sf '/opt/forticlient/fortivpn' "${pkgdir}/usr/bin/fortivpn"
- ln -sf '/opt/forticlient/gui/FortiClient-linux-x64/FortiClient' "${pkgdir}/usr/bin/FortiClient"
+ ln -sf '/opt/forticlient/gui/FortiClient-linux-x64/FortiClient' "${pkgdir}/usr/bin/forticlient"
+
+ # Symbolic launchers
+ ln -sf '/opt/forticlient/Fortitray.desktop' "${pkgdir}/etc/xdg/autostart/Fortitray.desktop"
+ ln -sf '/opt/forticlient/Fortivpn.desktop' "${pkgdir}/etc/xdg/autostart/Fortivpn.desktop"
}
diff --git a/forticlient-vpn.changelog b/forticlient-vpn.changelog
new file mode 100644
index 000000000000..23307a314b79
--- /dev/null
+++ b/forticlient-vpn.changelog
@@ -0,0 +1,8 @@
+## forticlient-vpn - 6.4.3.0959 - 2021-04-07
+
+* `release 1`
+ + add `depends`, `optdepends`, `install` and `changelog` to PKGBUILD
+ + included symbolyc launchers to /etc/xdg/autostart
+ + alter symbolyc binary to lowercase
+ + add `forticlient-vpn.install` to tree
+ + add `forticlient-vpn.changelog` to tree
diff --git a/forticlient-vpn.install b/forticlient-vpn.install
new file mode 100644
index 000000000000..3764525ae89f
--- /dev/null
+++ b/forticlient-vpn.install
@@ -0,0 +1,119 @@
+pre_install () {
+ BACKUP_DIR=/etc/forticlient/.old
+ FCT_CONFIG=/etc/forticlient/config.xml
+ EC_CONFIG=/opt/forticlient/XMLs/ecdata.xml
+
+ # Backup old XML configurations if they exist so they can
+ # be imported on start up if upgrading from an older FCT version
+ if [ -f $FCT_CONFIG ] || [ -f $EC_CONFIG ]; then
+ mkdir $BACKUP_DIR && chmod 0600 $BACKUP_DIR
+ else
+ exit 0
+ fi
+
+ if [ -d $BACKUP_DIR ] && [ $(stat -c "%a" $BACKUP_DIR) -eq 600 ] && [ -f $FCT_CONFIG ]; then
+ cp $FCT_CONFIG $BACKUP_DIR
+ fi
+
+ if [ -d $BACKUP_DIR ] && [ $(stat -c "%a" $BACKUP_DIR) -eq 600 ] && [ -f $EC_CONFIG ]; then
+ cp $EC_CONFIG $BACKUP_DIR
+ fi
+ exit 0
+}
+
+pre_upgrade () {
+# Remove old symlink when upgrading from older versions
+if [ -f /usr/bin/FortiClient ]; then
+ pkill -f /usr/bin/FortiClient
+ rm -rf /usr/bin/FortiClient
+fi
+}
+
+post_install() {
+ # Remove older version directories and files when upgrading
+ if [ -d /usr/bin/forticlient ]; then
+ pkill -f /usr/bin/forticlient
+ rm -rf /usr/bin/forticlient
+ fi
+
+ # Remove old configuration files when upgrading from older versions
+ if [ -f /etc/forticlient/config.xml ]; then
+ rm -rf /etc/forticlient/config.xml
+ fi
+
+ if [ -f /etc/forticlient/config_backup.xml ]; then
+ rm -rf /etc/forticlient/config_backup.xml
+ fi
+
+ # Remove old pid lock
+ if [ -f /tmp/.forticlient/fortivpn.pid ]; then
+ rm -rf /tmp/.forticlient/fortivpn.pid
+ fi
+
+ if [ -f /etc/forticlient/servers.conf ]; then
+ chmod 600 /etc/forticlient/servers.conf
+ fi
+
+ # Create GUI symlink to launch from terminal
+ if [ -f /opt/forticlient/gui/FortiClient-linux-x64/FortiClient ]; then
+ ln -sf /opt/forticlient/gui/FortiClient-linux-x64/FortiClient /usr/bin/forticlient
+ fi
+
+ # Launch fortitray
+ if [ -f /opt/forticlient/fortitraylauncher ]; then
+ if [ ! -z "$(logname 2>/dev/null)" ]; then
+ user="$(logname 2>/dev/null)"
+ elif [ ! -z "$SUDO_USER" ]; then
+ user="$SUDO_USER"
+ else
+ user=$(users 2>/dev/null | cut -d ' ' -f1)
+ fi
+
+ # Need to find the user DBUS address, otherwise Fortitray icon won't show
+ DBUS_SESSION_BUS_ADDRESS=$(ps -u $(id -u $user) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n' 2>/dev/null | grep -m1 '^DBUS_SESSION_BUS_ADDRESS=')
+ DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS#*=}
+
+ # XAUTHORITY and DISPLAY needed by Fortitray to run
+ XAUTHORITY=$(ps -u $(id -u $user) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n' 2>/dev/null | grep -m1 '^XAUTHORITY=')
+ XAUTHORITY=${XAUTHORITY#*=}
+
+ DISPLAY=$(ps -u $(id -u $user) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n' 2>/dev/null | grep -m1 '^DISPLAY=')
+ DISPLAY=${DISPLAY#*=}
+
+ XDG_RUNTIME_DIR=$(ps -u $(id -u $user) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n' 2>/dev/null | grep -m1 '^XDG_RUNTIME_DIR=')
+ XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR#*=}
+
+ # Start fortitraylauncher while forwarding environment variables needed by Fortitray
+ su ${user} -c "env XAUTHORITY=$XAUTHORITY \
+ DISPLAY=$DISPLAY \
+ DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
+ XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
+ setsid /opt/forticlient/fortitraylauncher &>/dev/null &"
+ fi
+
+ # Update icons cache so icon will show correctly
+ if [ -f /usr/share/icons/hicolor/48x48/apps/forticlient.png ]; then
+ gtk-update-icon-cache -f /usr/share/icons/hicolor || true
+ fi
+}
+
+pre_remove() {
+ # Check if forticlient is registered to EMS if it's an uninstall
+ if [ -f /opt/forticlient/.fct_ec_registered ] && [ "$action" != "upgrade" ]; then
+ echo "Error: Unable to uninstall forticlient while connected to EMS"
+ exit 1
+ fi
+
+ # Stop fortitray
+ if [ -f /tmp/.forticlient/fortitraylauncher ]; then
+ echo "terminate" > /tmp/.forticlient/fortitraylauncher || true
+ fi
+
+ pkill -f /opt/forticlient
+ exit 0
+}
+
+post_remove() {
+ # Remove fortitraylauncher fifo
+ rm -rf /tmp/.forticlient/fortitraylauncher || true
+}