Skip to content

Instantly share code, notes, and snippets.

@yan12125
Created August 13, 2017 02:18
Show Gist options
  • Save yan12125/40244a64b7f2d396692e2f104fe733a8 to your computer and use it in GitHub Desktop.
Save yan12125/40244a64b7f2d396692e2f104fe733a8 to your computer and use it in GitHub Desktop.
pulsesecureclient
# Maintainer: Yen Chi Hsuan
pkgname=pulsesecureclient
pkgver=8.2R5
pkgrel=1
pkgdesc="Pulse Secure Client"
arch=('x86_64')
license=('custom')
url="http://www.python.org/"
depends=('')
source=(https://secure.nis.vt.edu/resources/downloads/pulse-8.2R5.i386.deb
pulseUi-wrapper.sh
pulseUi-wrapper-inner.sh)
sha256sums=('b2eda0436a15336b2999772bd4e03ea97651b80a245f07699869b88033a5f350'
'734b5bf225c1df0e9c20fb9a5c1151b704127af5940d0a5a0765f22ea3e2feb7'
'99caf69cbf4e297a9bdd2e586a860190f4a1cc11c9709172f967c1149db7d338')
optdepends=('lib32-webkitgtk: for pulseUi frontend')
prepare() {
tar -zxvf data.tar.gz
mkdir -p pulse && pushd pulse
tar -zxvf ../usr/local/pulse/pulse.tgz
}
package() {
cd "${srcdir}/"
install -Ddm755 "${pkgdir}"/usr/bin
install -Ddm755 "${pkgdir}"/usr/lib32/$pkgname
install -Ddm755 "${pkgdir}"/usr/share/applications
install -Ddm755 "${pkgdir}"/usr/share/$pkgname
# Skip PulseClient.sh - seems it's not useful here
install -Dm755 pulse/{pulsesvc,pulsediag} "${pkgdir}"/usr/bin/
install -Dm755 pulse/pulseUi_centos_7 "${pkgdir}"/usr/lib32/$pkgname/pulseUi
install -Dm755 pulse/libpulseui.so_centos_7 "${pkgdir}"/usr/lib32/libpulseui.so
install -Dm755 pulse/pulseUi.desktop "${pkgdir}"/usr/share/applications/
cp -dr --no-preserve=ownership pulse/html "${pkgdir}"/usr/share/$pkgname/html
# HACK: use overlayfs to cheat pulseUi
install -Ddm755 "${pkgdir}"/var/lib/$pkgname/overlayfs-{lower,upper,work,merged}
install -Ddm755 "${pkgdir}"/var/lib/$pkgname/overlayfs-lower/usr/local/pulse
ln -s /usr/share/$pkgname/html "${pkgdir}"/var/lib/$pkgname/overlayfs-lower/usr/local/pulse/
ln -s /usr/bin/pulsesvc "${pkgdir}"/var/lib/$pkgname/overlayfs-lower/usr/local/pulse/
install -Dm755 pulseUi-wrapper.sh "${pkgdir}"/usr/bin/pulseUi
install -Dm755 pulseUi-wrapper-inner.sh "${pkgdir}"/usr/lib32/$pkgname/
}
#!/bin/sh
set -xe
export XAUTHORITY=/root/.Xauthority
xauth add $XAUTH_COOKIE
exec /usr/lib32/pulsesecureclient/pulseUi
#!/bin/sh
set -xe
SUDO=sudo
overlayfs_top=/var/lib/pulsesecureclient
overlayfs_merged=$overlayfs_top/overlayfs-merged
if [ ! -e $overlayfs_merged/dev ] ; then
$SUDO mount -t overlay overlay -o lowerdir=/:$overlayfs_top/overlayfs-lower,upperdir=$overlayfs_top/overlayfs-upper,workdir=$overlayfs_top/overlayfs-work $overlayfs_merged
fi
if [ ! -e $overlayfs_merged/dev/null ] ; then
$SUDO mount --bind /dev $overlayfs_merged/dev
fi
if [ ! -e $overlayfs_merged/proc/cmdline ] ; then
$SUDO mount --bind /proc $overlayfs_merged/proc
fi
$SUDO env XAUTH_COOKIE="$(xauth list)" chroot $overlayfs_merged /usr/lib32/pulsesecureclient/pulseUi-wrapper-inner.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment