From 3175855122b635ea8f055b0dc6347b1b4cd6fcd4 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Tue, 31 Aug 2021 20:52:08 +0800 Subject: [PATCH] add rpm packaging (#83) --- .gitignore | 5 +++ packaging/rpm/README.md | 5 +++ packaging/rpm/entrypoint.sh | 21 +++++++++++ packaging/rpm/globalprotect-openconnect.spec | 39 ++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 packaging/rpm/README.md create mode 100755 packaging/rpm/entrypoint.sh create mode 100644 packaging/rpm/globalprotect-openconnect.spec diff --git a/.gitignore b/.gitignore index 9db7613..6c77b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,11 @@ gpclient gpservice +*.rpm +*.gz +.DS_Store +build-debian + # Auto generated DBus files *_adaptor.cpp *_adaptor.h diff --git a/packaging/rpm/README.md b/packaging/rpm/README.md new file mode 100644 index 0000000..13ecbc6 --- /dev/null +++ b/packaging/rpm/README.md @@ -0,0 +1,5 @@ +## Command + +```sh +docker run --rm -it -v ${PWD}:/rpm --workdir=/rpm --entrypoint ./entrypoint.sh centos:8 +``` diff --git a/packaging/rpm/entrypoint.sh b/packaging/rpm/entrypoint.sh new file mode 100755 index 0000000..5261bd0 --- /dev/null +++ b/packaging/rpm/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e + +# Install the build tools +dnf install -y epel-release +rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 +dnf install -y make rpm-build rpm-devel rpmlint rpmdevtools + +# Install the build dependencies +dnf install -y qt5-qtbase-devel qt5-qtwebengine-devel qt5-qtwebsockets-devel + +# Prepare the RPM build environment +rpmdev-setuptree +cp *.spec $HOME/rpmbuild/SPECS/ +cp *.tar.gz $HOME/rpmbuild/SOURCES/ + +# Build +rpmbuild -ba $HOME/rpmbuild/SPECS/globalprotect-openconnect.spec + +# Copy the package to the current directory +cp $HOME/rpmbuild/RPMS/x86_64/globalprotect-openconnect-*.rpm . +cp $HOME/rpmbuild/SRPMS/globalprotect-openconnect-*.src.rpm . diff --git a/packaging/rpm/globalprotect-openconnect.spec b/packaging/rpm/globalprotect-openconnect.spec new file mode 100644 index 0000000..26f795f --- /dev/null +++ b/packaging/rpm/globalprotect-openconnect.spec @@ -0,0 +1,39 @@ +Name: globalprotect-openconnect +Version: 1.3.0+SNAPSHOT20210829120923 +Release: 1 +Summary: A GlobalProtect VPN client + +License: GPLv3 +URL: https://github.com/yuezk/GlobalProtect-openconnect +Source0: %{url}/releases/download/latest/globalprotect-openconnect_%{version}.full.tar.gz + +BuildRequires: qt5-qtbase-devel qt5-qtwebengine-devel qt5-qtwebsockets-devel +Requires: qt5-qtbase >= 5.12 qt5-qtwebengine >= 5.12 qt5-qtwebsockets >= 5.12 openconnect >= 8.0 + +%global debug_package %{nil} + +%description +A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Qt5, supports SAML auth mode. + + +%prep +%autosetup + + +%build +qmake-qt5 CONFIG+=release +%make_build + + +%install +INSTALL_ROOT=${RPM_BUILD_ROOT} %make_install + + +%files +/etc/systemd/system/gpservice.service +/usr/bin/gpclient +/usr/bin/gpservice +/usr/share/applications/com.yuezk.qt.gpclient.desktop +/usr/share/dbus-1/system-services/com.yuezk.qt.GPService.service +/usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf +/usr/share/pixmaps/com.yuezk.qt.GPClient.svg