update packaging

This commit is contained in:
Kevin Yue 2021-09-05 23:35:49 +08:00
parent 4843bac643
commit bb78aed8eb
4 changed files with 88 additions and 29 deletions

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.yuezk.qt.gpclient</id>
<name>globalprotect-openconnect</name>
<summary>A GlobalProtect VPN client powered by OpenConnect</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>AGPL-3.0-or-later</project_license>
<description>
<p>A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Qt5, supports the SAML auth mode.</p>
</description>
<categories>
<category>Network</category>
</categories>
<update_contact>k3vinyue_AT_gmail.com</update_contact>
<developer_name>Kevin Yue</developer_name>
<url type="homepage">https://github.com/yuezk/GlobalProtect-openconnect</url>
<url type="bugtracker">https://github.com/yuezk/GlobalProtect-openconnect/issues</url>
<url type="help">https://github.com/yuezk/GlobalProtect-openconnect/issues</url>
<keywords>
<keyword>globalprotect</keyword>
<keyword>openconnect</keyword>
<keyword>vpn</keyword>
<keyword>saml</keyword>
</keywords>
<launchable type="desktop-id">com.yuezk.qt.gpclient.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/yuezk/GlobalProtect-openconnect/master/screenshot.png</image>
</screenshot>
</screenshots>
<provides>
<binary>/usr/bin/gpclient</binary>
<dbus type="system">com.yuezk.qt.GPService</dbus>
</provides>
</component>

View File

@ -20,6 +20,7 @@ int main(int argc, char *argv[])
plog::init(plog::debug, logFile.toUtf8()).addAppender(&consoleAppender);
PLOGI << "GlobalProtect started, version: " << version;
PLOGI << "PATH: " << qgetenv("PATH");
QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT));

View File

@ -92,17 +92,24 @@ void GPService::quit()
void GPService::connect(QString server, QString username, QString passwd, QString extraArgs)
{
log("VPN status is: " + QVariant::fromValue(vpnStatus).toString());
if (vpnStatus != GPService::VpnNotConnected) {
log("VPN status is: " + QVariant::fromValue(vpnStatus).toString());
return;
}
QString bin = findBinary();
if (bin == nullptr) {
log("Could not find openconnect binary, make sure openconnect is installed, exiting.");
emit error("The OpenConect CLI was not found, make sure it has been installed!");
return;
}
log("Before findBinary");
// QString bin = findBinary();
// log("After findBinary");
// if (bin == nullptr) {
// log("Could not find openconnect binary, make sure openconnect is installed, exiting.");
// emit error("The OpenConect CLI was not found, make sure it has been installed!");
// return;
// }
QStringList args;
args << QCoreApplication::arguments().mid(1)
@ -114,7 +121,7 @@ void GPService::connect(QString server, QString username, QString passwd, QStrin
log("Start process with arugments: " + args.join(" "));
openconnect->start(bin, args);
openconnect->start("openconnect", args);
}
void GPService::disconnect()

View File

@ -11,32 +11,56 @@ confinement: devmode # use 'strict' once you have the right plugs and slots
package-repositories:
- type: apt
ppa: beineri/opt-qt-5.12.10-bionic
- type: apt
ppa: dominik-stadler/dsta-bionic-ppa
slots:
gpservice-slot:
interface: dbus
bus: system
name: com.yuezk.qt.GPService
plugs:
gpservice-plug:
interface: dbus
bus: system
name: com.yuezk.qt.GPService
apps:
gpservice:
daemon: simple
command: usr/bin/gpservice
environment:
LANG: en_US.utf8
plugs:
- network
# slots:
# - gpservice-slot
gpclient:
common-id: com.yuezk.qt.gpclient.desktop
command: desktop-launch gpclient
command: usr/bin/gpclient
desktop: usr/share/applications/com.yuezk.qt.gpclient.desktop
environment:
QT_DEBUG_PLUGINS: 1
QT_PLUGIN_PATH: $SNAP/opt/qt512/plugins
plugs:
- desktop
- desktop-legacy
- opengl
- wayland
- unity7
- x11
- network
# extensions:
# - kde-neon
- gpservice-plug
parts:
application:
plugin: nil
source: snap/local/globalprotect-openconnect.tar.gz
source: .
build-packages:
- g++
- make
- libgl1-mesa-dev
- qt512base
- qt512websockets
- qt512webengine
@ -46,22 +70,6 @@ parts:
- qt512websockets
- qt512webengine
# build-packages:
# - g++
# - make
# - qt5-qmake
# - qtwebengine5-dev
# - libqt5websockets5-dev
# build-snaps:
# - kde-frameworks-5-qt-5-14-core18-sdk
# stage-packages:
# - libqt5widgets5
# - libqt5webengine5
# - libqt5webenginewidgets5
# - libqt5websockets5
override-build: |
QT_BASE_DIR=/opt/qt512