Last active
December 23, 2017 00:19
-
-
Save pd5rm/fad6d3800bdf1848d66040e47547db14 to your computer and use it in GitHub Desktop.
Pulse-Secure AUR Patch 12/22/2017
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/PKGBUILD b/PKGBUILD | |
index fdd2160..12b4c8a 100644 | |
--- a/PKGBUILD | |
+++ b/PKGBUILD | |
@@ -2,26 +2,59 @@ | |
pkgname=pulse-secure | |
pkgver=5.3r3.0 | |
-pkgrel=3 | |
+pkgrel=7 | |
pkgdesc='Pulse Connect Secure (PCS) Client' | |
arch=(x86_64) | |
license=(custom) | |
url='https://www.pulsesecure.net/' | |
depends=(gcc-libs libgnome-keyring) | |
+# XXX There has to be a better way to deal with lib deps that are archived. | |
source=("https://trial.pulsesecure.net/clients/ps-pulse-linux-$pkgver-b1021-centos-rhel-64-bit-installer.rpm" | |
+ "https://archive.archlinux.org/packages/i/icu/icu-59.1-2-x86_64.pkg.tar.xz" | |
+ "https://archive.archlinux.org/packages/e/enchant/enchant-1.6.1-2-x86_64.pkg.tar.xz" | |
+ "https://archive.archlinux.org/packages/w/webkitgtk2/webkitgtk2-2.4.11-6-x86_64.pkg.tar.xz" | |
pulseUi.sh | |
EULA.txt) | |
md5sums=('4cbe64953952d9ffdeaa4ffe2fc92a20' | |
- 'd81155461e2666c2b9d669c1b76f85fe' | |
+ '049ca9bf777280536b3b75861e1512eb' | |
+ '86e077caa2ae24831184ce33e02849e5' | |
+ 'cbb90c37d965bf5a07b90998d60d448e' | |
+ 'bff26f910bb10c98a7dc662420a3f85f' | |
'261848a28201e5386ec4bf587473a48b') | |
-optdepends=('webkitgtk: for pulseUi frontend' | |
- 'psmisc: for pulsesvc -K') | |
+optdepends=('psmisc: for pulsesvc -K') | |
conflicts=(pulse-connect-secure) | |
prepare() { | |
mkdir -p pulse && pushd pulse | |
tar -zxvf ../usr/local/pulse/pulse.tgz | |
popd | |
+ | |
+ # Remove non-lib crud | |
+ find usr/lib -type f -not -name "*so*" -delete | |
+ # Now remove any empty dirs | |
+ find usr/lib -type d -empty -delete | |
+} | |
+ | |
+# adapted from ConfigurePulse_x86_64.sh | |
+update_build_info() { | |
+ pkgdir=$1 | |
+ | |
+ INSTALLDIR="$pkgdir"/usr/local/pulse | |
+ | |
+ #We expect the version text in format example "Version: 5.3R3 comment" | |
+ BUILD_VERSION=`grep "Version: " ${INSTALLDIR}/version.txt | awk '{print $2}'` | |
+ #Fetch the last Number from the version text | |
+ | |
+ #Fetch Build Number. | |
+ BUILD_NUMBER=`grep "Build Number: " ${INSTALLDIR}/version.txt | awk '{print $3}'` | |
+ | |
+ if [ "X$BUILD_VERSION" != "X" ]; then | |
+ sed -i "s/BUILD_VERSION/${BUILD_VERSION}/g" ${INSTALLDIR}/html/about.html | |
+ fi | |
+ | |
+ if [ "X$BUILD_NUMBER" != "X" ]; then | |
+ sed -i "s/BUILD_NUMBER/${BUILD_NUMBER}/g" ${INSTALLDIR}/html/about.html | |
+ fi | |
} | |
package() { | |
@@ -30,11 +63,19 @@ package() { | |
install -Ddm755 "${pkgdir}"/usr/share/applications | |
install -Ddm755 "${pkgdir}"/usr/share/licenses/$pkgname | |
- # Skip PulseClient.sh - seems it's not useful here | |
+ install -Dm755 usr/local/pulse/PulseClient_x86_64.sh "${pkgdir}"/usr/local/pulse/ | |
+ install -Dm644 usr/local/pulse/{README,version.txt} "${pkgdir}"/usr/local/pulse/ | |
install -Dm755 pulse/{pulsediag,pulseutil} "${pkgdir}"/usr/local/pulse/ | |
install -Dm4755 pulse/pulsesvc "${pkgdir}"/usr/local/pulse/ | |
- install -Dm755 pulse/pulseUi_centos_7_x86_64 "${pkgdir}"/usr/local/pulse/pulseUi | |
- install -Dm755 pulse/libpulseui.so_centos_7_x86_64 "${pkgdir}"/usr/local/pulse/libpulseui.so | |
+ # The Ubuntu version has depedency on WebGTK 2 which is easier to deal with than CentOS build. | |
+ install -Dm755 pulse/pulseUi_Ubuntu_16_x86_64 "${pkgdir}"/usr/local/pulse/pulseUi | |
+ install -Dm755 pulse/libpulseui.so_Ubuntu_16_x86_64 "${pkgdir}"/usr/local/pulse/libpulseui.so | |
+ | |
+ # Patch LD lookup to use archived libs | |
+ sed -i 's|$LD_LIBRARY_PATH|/usr/local/pulse/lib:$LD_LIBRARY_PATH|' pulse/pulseUi.desktop | |
+ # Fix desktop file version (desktop-file-validate complains about it) | |
+ sed -i 's|^version|Version|' pulse/pulseUi.desktop | |
+ | |
install -Dm644 pulse/pulseUi.desktop "${pkgdir}"/usr/share/applications/ | |
# Wrappers & symlinks | |
@@ -43,5 +84,10 @@ package() { | |
cp -dr --no-preserve=ownership pulse/html "${pkgdir}"/usr/local/pulse/html | |
+ # Copy archived libs to local package | |
+ cp -dr --no-preserve=ownership usr/lib "${pkgdir}"/usr/local/pulse | |
+ | |
install -Dm644 EULA.txt "${pkgdir}"/usr/share/licenses/$pkgname/ | |
+ | |
+ update_build_info "$pkgdir" | |
} | |
diff --git a/pulseUi.sh b/pulseUi.sh | |
index ed7eced..d443243 100644 | |
--- a/pulseUi.sh | |
+++ b/pulseUi.sh | |
@@ -1,4 +1,4 @@ | |
#!/bin/sh | |
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pulse | |
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pulse/lib:/usr/local/pulse | |
exec /usr/local/pulse/pulseUi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment