Compare commits

...

8 Commits

Author SHA1 Message Date
Kevin Yue
3daad748ae Add rust dep for ppa 2024-02-25 13:33:53 +08:00
Kevin Yue
5bca84c9cf Set rust version 2024-02-25 12:42:25 +08:00
Kevin Yue
3a6eca2ed2 Add build dependencies 2024-02-25 11:50:24 +08:00
Kevin Yue
141d66cbde Fix rpm install 2024-02-25 10:57:02 +08:00
Kevin Yue
f44cd85971 Use .build folder 2024-02-25 10:37:52 +08:00
Kevin Yue
55b119d0f2 Install rpm 2024-02-25 10:32:47 +08:00
Kevin Yue
df1bcd6571 Install rpm 2024-02-25 09:59:21 +08:00
Kevin Yue
a19789f1e3 Update rpm packaging 2024-02-25 09:55:52 +08:00
7 changed files with 89 additions and 26 deletions

View File

@ -89,13 +89,20 @@ jobs:
- name: Install RPM package
run: |
cd globalprotect-openconnect-*/
ls -l .rpm
ls -l .build/rpm
sudo rpm -i ".build/rpm/globalprotect-openconnect*.$(uname -m).rpm"
gpclient --version
gpservice --version
gpauth --version
gpgui-helper --version
- name: Upload RPM package
uses: actions/upload-artifact@v3
with:
name: artifact-rpm
path: |
globalprotect-openconnect-*/.rpm/*.rpm
globalprotect-openconnect-*/.build/rpm/*.rpm
# Include arm64 if ref is a tag
# setup-matrix:

2
.gitignore vendored
View File

@ -6,4 +6,4 @@
*.tar.xz
.cargo
.rpm
.build

View File

@ -4,6 +4,7 @@ resolver = "2"
members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/gpgui-helper/src-tauri"]
[workspace.package]
rust-version = "1.70"
version = "2.0.0"
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"

View File

@ -38,7 +38,7 @@ tarball: clean clean-tarball build-fe cargo-vendor
extract-vendor:
if [ -f vendor.tar.xz ]; then tar -xJf vendor.tar.xz; fi
build: extract-vendor build-fe build-rs gpgui-helper
build: build-fe build-rs
# Install and build the frontend
# If OFFLINE is set to 1, skip it
@ -52,14 +52,13 @@ build-fe:
exit 1; \
fi
build-rs:
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpauth -p gpservice
gpgui-helper:
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpgui-helper --features "tauri/custom-protocol"
build-rs: extract-vendor
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpauth
# $(CARGO) build $(CARGO_BUILD_ARGS) -p gpgui-helper --features "tauri/custom-protocol"
clean:
$(CARGO) clean
rm -rf .build
rm -rf .vendor
rm -rf apps/gpgui-helper/node_modules
@ -99,17 +98,21 @@ init-debian:
debmake
cp -f packaging/deb/control debian/control
cp -f packaging/deb/control.in debian/control
cp -f packaging/deb/rules debian/rules
rm -f debian/changelog
deb: init-debian
sed -i "s/@RUST@//g" debian/control
dch --create --distribution unstable --package $(PKG_NAME) --newversion $(VERSION)-$(REVISION) "Bugfix and improvements."
debuild --preserve-env -e PATH -us -uc -b
# Usage: make ppa SERIES=focal
ppa: init-debian
sed -i "s/@RUST@/rust-all(>=1.70)/g" debian/control
$(eval SERIES_VER = $(shell distro-info --series $(SERIES) -r | cut -d' ' -f1))
@echo "Building for $(SERIES) $(SERIES_VER)"
@ -121,22 +124,22 @@ publish-ppa: ppa
dput ppa:yuezk/globalprotect-openconnect ../*.changes
# Generate RPM sepc file
rpm-spec:
rm -rf .rpm
mkdir -p .rpm
init-rpm:
rm -rf .build/rpm
mkdir -p .build/rpm
cp packaging/rpm/globalprotect-openconnect.spec.in .rpm/globalprotect-openconnect.spec
cp packaging/rpm/globalprotect-openconnect.changes.in .rpm/globalprotect-openconnect.changes
cp packaging/rpm/globalprotect-openconnect.spec.in .build/rpm/globalprotect-openconnect.spec
cp packaging/rpm/globalprotect-openconnect.changes.in .build/rpm/globalprotect-openconnect.changes
sed -i "s/@VERSION@/$(VERSION)/g" .rpm/globalprotect-openconnect.spec
sed -i "s/@REVISION@/$(REVISION)/g" .rpm/globalprotect-openconnect.spec
sed -i "s/@DATE@/$(shell date "+%a %b %d %Y")/g" .rpm/globalprotect-openconnect.spec
sed -i "s/@VERSION@/$(VERSION)/g" .build/rpm/globalprotect-openconnect.spec
sed -i "s/@REVISION@/$(REVISION)/g" .build/rpm/globalprotect-openconnect.spec
sed -i "s/@DATE@/$(shell date "+%a %b %d %Y")/g" .build/rpm/globalprotect-openconnect.spec
sed -i "s/@VERSION@/$(VERSION)/g" .rpm/globalprotect-openconnect.changes
sed -i "s/@DATE@/$(shell LC_ALL=en.US date -u "+%a %b %e %T %Z %Y")/g" .rpm/globalprotect-openconnect.changes
sed -i "s/@VERSION@/$(VERSION)/g" .build/rpm/globalprotect-openconnect.changes
sed -i "s/@DATE@/$(shell LC_ALL=en.US date -u "+%a %b %e %T %Z %Y")/g" .build/rpm/globalprotect-openconnect.changes
# Ensure ../globalprotect-openconnect-*.tar.gz exists.
rpm: rpm-spec
rpm: init-rpm
if [ ! -f ../$(PKG).tar.gz ]; then \
echo "Missing ../$(PKG).tar.gz"; \
exit 1; \
@ -147,12 +150,30 @@ rpm: rpm-spec
cp ../$(PKG).tar.gz $(HOME)/rpmbuild/SOURCES/$(PKG_NAME).tar.gz
rpmbuild -ba .rpm/globalprotect-openconnect.spec
rpmbuild -ba .build/rpm/globalprotect-openconnect.spec
# Copy RPM package
cp $(HOME)/rpmbuild/RPMS/$(shell uname -m)/$(PKG_NAME)*.rpm .rpm
cp $(HOME)/rpmbuild/RPMS/$(shell uname -m)/$(PKG_NAME)*.rpm .build/rpm
# Copy the SRPM only for x86_64.
if [ "$(shell uname -m)" = "x86_64" ]; then \
cp $(HOME)/rpmbuild/SRPMS/$(PKG_NAME)*.rpm .rpm \
cp $(HOME)/rpmbuild/SRPMS/$(PKG_NAME)*.rpm .build/rpm; \
fi
init-pkgbuild:
rm -rf .build/pkgbuild
mkdir -p .build/pkgbuild
if [ ! -f ../$(PKG).tar.gz ]; then \
echo "Missing ../$(PKG).tar.gz"; \
exit 1; \
fi
cp ../$(PKG).tar.gz .build/pkgbuild
cp packaging/pkgbuild/PKGBUILD.in .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/@REVISION@/$(REVISION)/g" .build/pkgbuild/PKGBUILD
pkgbuild: init-pkgbuild
cd .build/pkgbuild && makepkg -s --noconfirm

View File

@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Kevin Yue <k3vinyue@gmail.com>
Standards-Version: 4.1.4
Build-Depends: debhelper (>= 9), make (>= 4), openconnect (>= 8.20), libxml2, libsecret-1-0, libayatana-appindicator3-1, libwebkit2gtk-4.0-37, libgtk-3-0, gnome-keyring
Build-Depends: debhelper (>= 9), pkg-config, jq (>= 1), make (>= 4), openconnect (>= 8.20), libxml2, libsecret-1-0, libayatana-appindicator3-1, libwebkit2gtk-4.0-37, libgtk-3-0, gnome-keyring, @RUST@
Homepage: https://github.com/yuezk/GlobalProtect-openconnect
Package: globalprotect-openconnect

View File

@ -0,0 +1,30 @@
# Maintainer: Keinv Yue <k3vinyue@gmail.com>
_pkgname=@PKG_NAME@
pkgname=${_pkgname}
pkgver="@VERSION@"
pkgrel=@REVISION@
pkgdesc="A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method."
arch=('x86_64' 'aarch64')
url="https://github.com/yuezk/GlobalProtect-openconnect"
license=('GPL3')
makedepends=('make' 'pkg-config' 'rust' 'cargo' 'jq' 'webkit2gtk' 'curl' 'wget' 'file' 'openssl' 'appmenu-gtk-module' 'gtk3' 'libappindicator-gtk3' 'librsvg' 'libvips' 'libayatana-appindicator' 'openconnect' 'libsecret')
depends=('openconnect>=8.20' webkit2gtk libappindicator-gtk3 libayatana-appindicator libsecret libxml2)
optdepends=('wmctrl: for window management')
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
source=("${_pkgname}-${pkgver}.tar.gz")
sha256sums=('SKIP')
options=('!strip')
build() {
cd "$pkgname-$pkgver"
make build OFFLINE=1
}
package() {
cd "$pkgname-$pkgver"
make install DESTDIR="$pkgdir"
}

View File

@ -1,6 +1,6 @@
Name: globalprotect-openconnect
Version: @VERSION@
Release: @REVISION@%{?dist}
Release: @REVISION@
Summary: A GlobalProtect VPN client powered by OpenConnect
Group: Productivity/Networking/PPP
@ -9,6 +9,10 @@ URL: https://github.com/yuezk/GlobalProtect-openconnect
Source: %{name}.tar.gz
BuildRequires: make
BuildRequires: rust
BuildRequires: cargo
BuildRequires: jq
BuildRequires: pkg-config
BuildRequires: openconnect-devel
BuildRequires: openssl-devel
BuildRequires: curl