mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Compare commits
4 Commits
e69de98884
...
latest
Author | SHA1 | Date | |
---|---|---|---|
|
b2ca82e105 | ||
|
5ba6b1d5fc | ||
|
a96e77c758 | ||
|
79e0f0c7c1 |
35
.github/workflows/build.yaml
vendored
35
.github/workflows/build.yaml
vendored
@@ -9,6 +9,9 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
- hotfix/*
|
||||||
|
- feature/*
|
||||||
|
- release/*
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- v*.*.*
|
- v*.*.*
|
||||||
@@ -42,6 +45,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
|
ref: ${{ github.ref }}
|
||||||
path: source/gp
|
path: source/gp
|
||||||
- name: Create tarball
|
- name: Create tarball
|
||||||
run: |
|
run: |
|
||||||
@@ -62,39 +66,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
||||||
package: [deb, rpm, pkg, binary]
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare workspace
|
- name: Prepare workspace
|
||||||
run: |
|
run: rm -rf build-gp && mkdir build-gp
|
||||||
rm -rf build-gp-${{ matrix.package }}
|
|
||||||
mkdir -p build-gp-${{ matrix.package }}
|
|
||||||
- name: Download tarball
|
- name: Download tarball
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: artifact-source
|
name: artifact-source
|
||||||
path: build-gp-${{ matrix.package }}
|
path: build-gp
|
||||||
- name: Docker Login
|
- name: Docker Login
|
||||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||||
- name: Build ${{ matrix.package }} package in Docker
|
- name: Build gp in Docker
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm -v $(pwd)/build-gp:/gp yuezk/gpdev:gp-builder
|
||||||
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
|
|
||||||
yuezk/gpdev:${{ matrix.package }}-builder
|
|
||||||
- name: Install ${{ matrix.package }} package in Docker
|
|
||||||
run: |
|
|
||||||
docker run --rm \
|
|
||||||
-e GPGUI_INSTALLED=0 \
|
|
||||||
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
|
|
||||||
yuezk/gpdev:${{ matrix.package }}-builder \
|
|
||||||
bash install.sh
|
|
||||||
- name: Upload ${{ matrix.package }} package
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact-gp-${{ matrix.os }}-${{ matrix.package }}
|
|
||||||
if-no-files-found: error
|
|
||||||
path: |
|
|
||||||
build-gp-${{ matrix.package }}/artifacts/*
|
|
||||||
|
|
||||||
build-gpgui:
|
build-gpgui:
|
||||||
needs:
|
needs:
|
||||||
@@ -114,12 +99,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
|
ref: ${{ github.ref }}
|
||||||
path: gpgui-source/gp
|
path: gpgui-source/gp
|
||||||
- name: Checkout gpgui
|
- name: Checkout gpgui@${{ github.ref_name }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/gpgui
|
repository: yuezk/gpgui
|
||||||
|
ref: ${{ github.ref_name }}
|
||||||
path: gpgui-source/gpgui
|
path: gpgui-source/gpgui
|
||||||
- name: Tarball
|
- name: Tarball
|
||||||
run: |
|
run: |
|
||||||
|
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
@@ -109,16 +109,11 @@ jobs:
|
|||||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||||
- name: Build ${{ matrix.package }} package in Docker
|
- name: Build ${{ matrix.package }} package in Docker
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm -v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} -e INCLUDE_GUI=1 yuezk/gpdev:${{ matrix.package }}-builder
|
||||||
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
|
|
||||||
-e INCLUDE_GUI=1 \
|
|
||||||
yuezk/gpdev:${{ matrix.package }}-builder
|
|
||||||
|
|
||||||
- name: Install ${{ matrix.package }} package in Docker
|
- name: Install ${{ matrix.package }} package in Docker
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm -v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} yuezk/gpdev:${{ matrix.package }}-builder \
|
||||||
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
|
|
||||||
yuezk/gpdev:${{ matrix.package }}-builder \
|
|
||||||
bash install.sh
|
bash install.sh
|
||||||
|
|
||||||
- name: Upload ${{ matrix.package }} package
|
- name: Upload ${{ matrix.package }} package
|
||||||
|
14
Cargo.lock
generated
14
Cargo.lock
generated
@@ -564,7 +564,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"is_executable",
|
"is_executable",
|
||||||
]
|
]
|
||||||
@@ -1430,7 +1430,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpapi"
|
name = "gpapi"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.21.5",
|
"base64 0.21.5",
|
||||||
@@ -1462,7 +1462,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpauth"
|
name = "gpauth"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -1482,7 +1482,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpclient"
|
name = "gpclient"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -1504,7 +1504,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpgui-helper"
|
name = "gpgui-helper"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -1522,7 +1522,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpservice"
|
name = "gpservice"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -2527,7 +2527,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openconnect"
|
name = "openconnect"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"common",
|
"common",
|
||||||
|
@@ -5,7 +5,7 @@ members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/g
|
|||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
rust-version = "1.70"
|
rust-version = "1.70"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
||||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
37
Makefile
37
Makefile
@@ -13,12 +13,6 @@ PKG = $(PKG_NAME)-$(VERSION)
|
|||||||
SERIES ?= $(shell lsb_release -cs)
|
SERIES ?= $(shell lsb_release -cs)
|
||||||
PUBLISH ?= 0
|
PUBLISH ?= 0
|
||||||
|
|
||||||
# Indicate if it is a Debian packaging
|
|
||||||
DEB_PACKAGING ?= 0
|
|
||||||
INCLUDE_SYSTEMD ?= $(shell [ -d /run/systemd/system ] && echo 1 || echo 0)
|
|
||||||
# Enable the systemd service after installation
|
|
||||||
ENABLE_SERVICE ?= 1
|
|
||||||
|
|
||||||
export DEBEMAIL = k3vinyue@gmail.com
|
export DEBEMAIL = k3vinyue@gmail.com
|
||||||
export DEBFULLNAME = Kevin Yue
|
export DEBFULLNAME = Kevin Yue
|
||||||
|
|
||||||
@@ -122,34 +116,9 @@ install:
|
|||||||
install -Dm644 packaging/files/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
install -Dm644 packaging/files/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||||
install -Dm644 packaging/files/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
install -Dm644 packaging/files/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||||
|
|
||||||
# Install the systemd service
|
|
||||||
if [ $(INCLUDE_SYSTEMD) -eq 1 ]; then \
|
|
||||||
if [ $(DEB_PACKAGING) -eq 1 ]; then \
|
|
||||||
install -Dm644 packaging/files/usr/lib/systemd/system/gp-suspend.service $(DESTDIR)/lib/systemd/system/gp-suspend.service; \
|
|
||||||
else \
|
|
||||||
install -Dm644 packaging/files/usr/lib/systemd/system/gp-suspend.service $(DESTDIR)/usr/lib/systemd/system/gp-suspend.service; \
|
|
||||||
fi; \
|
|
||||||
if [ $(ENABLE_SERVICE) -eq 1 ]; then \
|
|
||||||
systemctl --system daemon-reload \
|
|
||||||
systemctl enable gp-suspend.service || true; \
|
|
||||||
fi \
|
|
||||||
else \
|
|
||||||
echo "Skipping systemd service installation"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
@echo "Installation complete."
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@echo "Uninstalling $(PKG_NAME)..."
|
@echo "Uninstalling $(PKG_NAME)..."
|
||||||
|
|
||||||
# Disable the systemd service
|
|
||||||
if [ -d /run/systemd/system ]; then \
|
|
||||||
systemctl disable gp-suspend.service >/dev/null || true; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f $(DESTDIR)/lib/systemd/system/gp-suspend.service
|
|
||||||
rm -f $(DESTDIR)/usr/lib/systemd/system/gp-suspend.service
|
|
||||||
|
|
||||||
rm -f $(DESTDIR)/usr/bin/gpclient
|
rm -f $(DESTDIR)/usr/bin/gpclient
|
||||||
rm -f $(DESTDIR)/usr/bin/gpauth
|
rm -f $(DESTDIR)/usr/bin/gpauth
|
||||||
rm -f $(DESTDIR)/usr/bin/gpservice
|
rm -f $(DESTDIR)/usr/bin/gpservice
|
||||||
@@ -254,7 +223,6 @@ init-pkgbuild: clean-pkgbuild tarball
|
|||||||
|
|
||||||
cp .build/tarball/${PKG}.tar.gz .build/pkgbuild
|
cp .build/tarball/${PKG}.tar.gz .build/pkgbuild
|
||||||
cp packaging/pkgbuild/PKGBUILD.in .build/pkgbuild/PKGBUILD
|
cp packaging/pkgbuild/PKGBUILD.in .build/pkgbuild/PKGBUILD
|
||||||
cp packaging/pkgbuild/gp.install .build/pkgbuild
|
|
||||||
|
|
||||||
sed -i "s/@PKG_NAME@/$(PKG_NAME)/g" .build/pkgbuild/PKGBUILD
|
sed -i "s/@PKG_NAME@/$(PKG_NAME)/g" .build/pkgbuild/PKGBUILD
|
||||||
sed -i "s/@VERSION@/$(VERSION)/g" .build/pkgbuild/PKGBUILD
|
sed -i "s/@VERSION@/$(VERSION)/g" .build/pkgbuild/PKGBUILD
|
||||||
@@ -276,10 +244,7 @@ binary: clean-binary tarball
|
|||||||
mkdir -p .build/binary/$(PKG_NAME)_$(VERSION)/artifacts
|
mkdir -p .build/binary/$(PKG_NAME)_$(VERSION)/artifacts
|
||||||
|
|
||||||
make -C .build/binary/${PKG} build OFFLINE=$(OFFLINE) BUILD_FE=0 INCLUDE_GUI=$(INCLUDE_GUI)
|
make -C .build/binary/${PKG} build OFFLINE=$(OFFLINE) BUILD_FE=0 INCLUDE_GUI=$(INCLUDE_GUI)
|
||||||
make -C .build/binary/${PKG} install \
|
make -C .build/binary/${PKG} install DESTDIR=$(PWD)/.build/binary/$(PKG_NAME)_$(VERSION)/artifacts
|
||||||
DESTDIR=$(PWD)/.build/binary/$(PKG_NAME)_$(VERSION)/artifacts \
|
|
||||||
INCLUDE_SYSTEMD=1 \
|
|
||||||
ENABLE_SERVICE=0
|
|
||||||
|
|
||||||
cp packaging/binary/Makefile.in .build/binary/$(PKG_NAME)_$(VERSION)/Makefile
|
cp packaging/binary/Makefile.in .build/binary/$(PKG_NAME)_$(VERSION)/Makefile
|
||||||
|
|
||||||
|
@@ -153,7 +153,7 @@ impl<'a> ConnectHandler<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> {
|
async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> {
|
||||||
info!("Treat the portal as the gateway, connecting...");
|
info!("Performing the gateway authentication...");
|
||||||
|
|
||||||
let mut gp_params = self.build_gp_params();
|
let mut gp_params = self.build_gp_params();
|
||||||
gp_params.set_is_gateway(true);
|
gp_params.set_is_gateway(true);
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2.1.2 - 2024-03-29
|
||||||
|
|
||||||
|
- Treat portal as gateway when the gateway login is failed (fix #338)
|
||||||
|
|
||||||
## 2.1.1 - 2024-03-25
|
## 2.1.1 - 2024-03-25
|
||||||
|
|
||||||
- Add the `--hip` option to enable HIP report
|
- Add the `--hip` option to enable HIP report
|
||||||
|
@@ -6,6 +6,6 @@ pub enum PortalError {
|
|||||||
PreloginError(String),
|
PreloginError(String),
|
||||||
#[error("Portal config error: {0}")]
|
#[error("Portal config error: {0}")]
|
||||||
ConfigError(String),
|
ConfigError(String),
|
||||||
#[error("Gateway error: {0}")]
|
#[error("Network error: {0}")]
|
||||||
GatewayError(String),
|
NetworkError(String),
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ pub async fn gateway_login(gateway: &str, cred: &Credential, gp_params: &GpParam
|
|||||||
.form(¶ms)
|
.form(¶ms)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| anyhow::anyhow!(PortalError::GatewayError(e.to_string())))?;
|
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?;
|
||||||
|
|
||||||
let status = res.status();
|
let status = res.status();
|
||||||
|
|
||||||
|
@@ -102,7 +102,12 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara
|
|||||||
|
|
||||||
info!("Portal config, user_agent: {}", gp_params.user_agent());
|
info!("Portal config, user_agent: {}", gp_params.user_agent());
|
||||||
|
|
||||||
let res = client.post(&url).form(¶ms).send().await?;
|
let res = client
|
||||||
|
.post(&url)
|
||||||
|
.form(¶ms)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?;
|
||||||
let status = res.status();
|
let status = res.status();
|
||||||
|
|
||||||
if status == StatusCode::NOT_FOUND {
|
if status == StatusCode::NOT_FOUND {
|
||||||
|
@@ -118,7 +118,12 @@ pub async fn prelogin(portal: &str, gp_params: &GpParams) -> anyhow::Result<Prel
|
|||||||
.user_agent(user_agent)
|
.user_agent(user_agent)
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
let res = client.post(&prelogin_url).form(¶ms).send().await?;
|
let res = client
|
||||||
|
.post(&prelogin_url)
|
||||||
|
.form(¶ms)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?;
|
||||||
let status = res.status();
|
let status = res.status();
|
||||||
|
|
||||||
if status == StatusCode::NOT_FOUND {
|
if status == StatusCode::NOT_FOUND {
|
||||||
|
@@ -1,7 +1,3 @@
|
|||||||
INCLUDE_SYSTEMD ?= $(shell [ -d /run/systemd/system ] && echo 1 || echo 0)
|
|
||||||
# Enable the systemd service after installation
|
|
||||||
ENABLE_SERVICE ?= 1
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@echo "===> Installing..."
|
@echo "===> Installing..."
|
||||||
|
|
||||||
@@ -9,10 +5,7 @@ install:
|
|||||||
install -Dm755 artifacts/usr/bin/gpservice $(DESTDIR)/usr/bin/gpservice
|
install -Dm755 artifacts/usr/bin/gpservice $(DESTDIR)/usr/bin/gpservice
|
||||||
install -Dm755 artifacts/usr/bin/gpauth $(DESTDIR)/usr/bin/gpauth
|
install -Dm755 artifacts/usr/bin/gpauth $(DESTDIR)/usr/bin/gpauth
|
||||||
install -Dm755 artifacts/usr/bin/gpgui-helper $(DESTDIR)/usr/bin/gpgui-helper
|
install -Dm755 artifacts/usr/bin/gpgui-helper $(DESTDIR)/usr/bin/gpgui-helper
|
||||||
|
install -Dm755 artifacts/usr/bin/gpgui $(DESTDIR)/usr/bin/gpgui
|
||||||
if [ -f artifacts/usr/bin/gpgui ]; then \
|
|
||||||
install -Dm755 artifacts/usr/bin/gpgui $(DESTDIR)/usr/bin/gpgui; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
install -Dm644 artifacts/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop
|
install -Dm644 artifacts/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop
|
||||||
install -Dm644 artifacts/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
|
install -Dm644 artifacts/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
|
||||||
@@ -21,28 +14,9 @@ install:
|
|||||||
install -Dm644 artifacts/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
install -Dm644 artifacts/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||||
install -Dm644 artifacts/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
install -Dm644 artifacts/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||||
|
|
||||||
# Install the service
|
|
||||||
if [ $(INCLUDE_SYSTEMD) -eq 1 ]; then \
|
|
||||||
install -Dm644 artifacts/usr/lib/systemd/system/gp-suspend.service $(DESTDIR)/usr/lib/systemd/system/gp-suspend.service; \
|
|
||||||
if [ $(ENABLE_SERVICE) -eq 1 ]; then \
|
|
||||||
systemctl --system daemon-reload; \
|
|
||||||
systemctl enable gp-suspend.service; \
|
|
||||||
fi; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
@echo "===> Done."
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@echo "===> Uninstalling from $(DESTDIR)..."
|
@echo "===> Uninstalling from $(DESTDIR)..."
|
||||||
|
|
||||||
# Disable the systemd service
|
|
||||||
if [ -d /run/systemd/system ]; then \
|
|
||||||
systemctl disable gp-suspend.service >/dev/null || true; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f $(DESTDIR)/lib/systemd/system/gp-suspend.service
|
|
||||||
rm -f $(DESTDIR)/usr/lib/systemd/system/gp-suspend.service
|
|
||||||
|
|
||||||
rm -f $(DESTDIR)/usr/bin/gpclient
|
rm -f $(DESTDIR)/usr/bin/gpclient
|
||||||
rm -f $(DESTDIR)/usr/bin/gpservice
|
rm -f $(DESTDIR)/usr/bin/gpservice
|
||||||
rm -f $(DESTDIR)/usr/bin/gpauth
|
rm -f $(DESTDIR)/usr/bin/gpauth
|
||||||
@@ -55,5 +29,3 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png
|
rm -f $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png
|
||||||
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||||
rm -f $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
rm -f $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||||
|
|
||||||
@echo "===> Done."
|
|
||||||
|
@@ -11,6 +11,4 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -2,12 +2,6 @@
|
|||||||
|
|
||||||
export OFFLINE = @OFFLINE@
|
export OFFLINE = @OFFLINE@
|
||||||
export BUILD_FE = 0
|
export BUILD_FE = 0
|
||||||
export DEB_PACKAGING = 1
|
|
||||||
export INCLUDE_SYSTEMD = 1
|
|
||||||
export ENABLE_SERVICE = 0
|
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --no-parallel
|
dh $@ --no-parallel
|
||||||
|
|
||||||
override_dh_installsystemd:
|
|
||||||
dh_installsystemd gp-suspend.service --no-start
|
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Disconnect from the VPN when suspending
|
|
||||||
Before=sleep.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/bin/gpclient disconnect
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=sleep.target
|
|
@@ -14,8 +14,6 @@ optdepends=('wmctrl: for window management')
|
|||||||
|
|
||||||
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
|
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
|
||||||
|
|
||||||
install=gp.install
|
|
||||||
|
|
||||||
source=("${_pkgname}-${pkgver}.tar.gz")
|
source=("${_pkgname}-${pkgver}.tar.gz")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
@@ -33,5 +31,5 @@ build() {
|
|||||||
package() {
|
package() {
|
||||||
cd "$pkgname-$pkgver"
|
cd "$pkgname-$pkgver"
|
||||||
|
|
||||||
make install DESTDIR="$pkgdir" INCLUDE_SYSTEMD=1 ENABLE_SERVICE=0
|
make install DESTDIR="$pkgdir"
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
post_install() {
|
|
||||||
systemctl --system daemon-reload
|
|
||||||
systemctl enable gp-suspend.service
|
|
||||||
}
|
|
||||||
|
|
||||||
post_upgrade() {
|
|
||||||
post_install
|
|
||||||
}
|
|
||||||
|
|
||||||
post_remove() {
|
|
||||||
systemctl disable gp-suspend.service
|
|
||||||
}
|
|
@@ -22,7 +22,6 @@ BuildRequires: perl
|
|||||||
BuildRequires: (webkit2gtk4.0-devel or webkit2gtk3-soup2-devel)
|
BuildRequires: (webkit2gtk4.0-devel or webkit2gtk3-soup2-devel)
|
||||||
BuildRequires: (libappindicator-gtk3-devel or libappindicator3-1)
|
BuildRequires: (libappindicator-gtk3-devel or libappindicator3-1)
|
||||||
BuildRequires: (librsvg2-devel or librsvg-devel)
|
BuildRequires: (librsvg2-devel or librsvg-devel)
|
||||||
BuildRequires: systemd-rpm-macros
|
|
||||||
|
|
||||||
Requires: openconnect >= 8.20, (libayatana-appindicator or libappindicator-gtk3)
|
Requires: openconnect >= 8.20, (libayatana-appindicator or libappindicator-gtk3)
|
||||||
Conflicts: globalprotect-openconnect-snapshot
|
Conflicts: globalprotect-openconnect-snapshot
|
||||||
@@ -35,42 +34,16 @@ A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authenticati
|
|||||||
%prep
|
%prep
|
||||||
%setup
|
%setup
|
||||||
|
|
||||||
%pre
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%service_add_pre gp-suspend.service
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%post
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%service_add_post gp-suspend.service
|
|
||||||
%else
|
|
||||||
%systemd_post gp-suspend.service
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%preun
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%service_del_preun gp-suspend.service
|
|
||||||
%else
|
|
||||||
%systemd_preun gp-suspend.service
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
# Clean up the gpgui downloaded at runtime
|
|
||||||
rm -f %{_bindir}/gpgui
|
rm -f %{_bindir}/gpgui
|
||||||
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%service_del_postun_without_restart gp-suspend.service
|
|
||||||
%else
|
|
||||||
%systemd_postun gp-suspend.service
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# The injected RUSTFLAGS could fail the build
|
# The injected RUSTFLAGS could fail the build
|
||||||
unset RUSTFLAGS
|
unset RUSTFLAGS
|
||||||
make build OFFLINE=@OFFLINE@ BUILD_FE=0
|
make build OFFLINE=@OFFLINE@ BUILD_FE=0
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install INCLUDE_SYSTEMD=1 ENABLE_SERVICE=0
|
%make_install
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@@ -81,7 +54,6 @@ make build OFFLINE=@OFFLINE@ BUILD_FE=0
|
|||||||
%{_datadir}/icons/hicolor/256x256@2/apps/gpgui.png
|
%{_datadir}/icons/hicolor/256x256@2/apps/gpgui.png
|
||||||
%{_datadir}/icons/hicolor/scalable/apps/gpgui.svg
|
%{_datadir}/icons/hicolor/scalable/apps/gpgui.svg
|
||||||
%{_datadir}/polkit-1/actions/com.yuezk.gpgui.policy
|
%{_datadir}/polkit-1/actions/com.yuezk.gpgui.policy
|
||||||
%{_unitdir}/gp-suspend.service
|
|
||||||
|
|
||||||
%dir %{_datadir}/icons/hicolor
|
%dir %{_datadir}/icons/hicolor
|
||||||
%dir %{_datadir}/icons/hicolor/32x32
|
%dir %{_datadir}/icons/hicolor/32x32
|
||||||
|
Reference in New Issue
Block a user