add rpm packaging (#83)

This commit is contained in:
Kevin Yue 2021-08-31 20:52:08 +08:00 committed by GitHub
parent fa8b5c1528
commit 3175855122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 0 deletions

5
.gitignore vendored
View File

@ -2,6 +2,11 @@
gpclient gpclient
gpservice gpservice
*.rpm
*.gz
.DS_Store
build-debian
# Auto generated DBus files # Auto generated DBus files
*_adaptor.cpp *_adaptor.cpp
*_adaptor.h *_adaptor.h

5
packaging/rpm/README.md Normal file
View File

@ -0,0 +1,5 @@
## Command
```sh
docker run --rm -it -v ${PWD}:/rpm --workdir=/rpm --entrypoint ./entrypoint.sh centos:8
```

21
packaging/rpm/entrypoint.sh Executable file
View File

@ -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 .

View File

@ -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