-
-
Save abner/2e0cf34236478a759913 to your computer and use it in GitHub Desktop.
SAC package
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
#!/bin/bash | |
#/usr/bin/eTSrv | |
DAEMON=$(type -p eTSrv) | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
[ -f /etc/conf.d/eTSrv ] && . /etc/conf.d/eTSrv | |
PID=$(pidof -xo %PPID $DAEMON) | |
case "$1" in | |
start) | |
stat_busy "Starting eTSrv Daemon" | |
if [ -z "$PID" ]; then | |
[ -f /var/run/eTSrv.pid ] && rm -f /var/run/eTSrv.pid | |
$DAEMON $PUPPETD_ARGS | |
fi | |
if [ ! -z "$PID" -o $? -gt 0 ]; then | |
stat_fail | |
else | |
PID=$(pidof -xo %PPID $DAEMON) | |
echo $PID > /var/run/eTSrv.pid | |
add_daemon eTSrv | |
stat_done | |
fi | |
;; | |
stop) | |
stat_busy "Stopping eTSrv Daemon" | |
[ ! -z "$PID" ] && kill $PID &> /dev/null | |
if [ $? -gt 0 ]; then | |
stat_fail | |
else | |
rm_daemon eTSrv | |
rm -f /var/run/eTSrv.pid | |
stat_done | |
fi | |
;; | |
restart) | |
$0 stop | |
if [ ! -z $PID ]; then | |
while ps -p $PID > /dev/null; do sleep 1; done | |
fi | |
$0 start | |
;; | |
*) | |
echo "usage: $0 {start|stop|restart}" | |
esac |
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
# Maintainer: Jakub Bittner | |
pkgname=SAC | |
pkgver=8.1 | |
pkgrel=2 | |
pkgdesc="eToken PKI client" | |
arch=('i686') | |
url="http://www.safenet.com" | |
license=('custom') | |
depends=('pcsclite') | |
makedepends=('libarchive>=2.4.12' 'unzip') | |
provides=() | |
conflicts=() | |
source=('SafenetAuthenticationClient-8.1.0-4_i386.deb' | |
'http://ie.archive.ubuntu.com/ubuntu/pool/main/h/hal/libhal1_0.5.14-0ubuntu5_i386.deb' | |
'eTSrv') | |
md5sums=('4bca049f024cd947da73f96234b2789f' | |
'632428dcb64b21770c63ec14a8091e04' | |
'9608b34254bb2fcb441c8d41b92cf1f9') | |
build() { | |
cd "${srcdir}" | |
##SAC | |
ar xv SafenetAuthenticationClient-8.1.0-4_i386.deb data.tar.gz | |
mv data.tar.gz sac_data.tar.gz | |
##libhal1 | |
ar xv libhal1_0.5.14-0ubuntu5_i386.deb data.tar.gz | |
mv data.tar.gz libhal_data.tar.gz | |
} | |
package() { | |
cd "${pkgdir}" | |
tar -zxf "${srcdir}"/sac_data.tar.gz | |
tar -zxf "${srcdir}"/libhal_data.tar.gz | |
##use rc.d instead of init.d | |
rm -rf "${pkgdir}"/etc/init.d | |
mkdir "${pkgdir}"/etc/rc.d/ | |
##rc.d daemon | |
cp "${srcdir}"/eTSrv "${pkgdir}"/etc/rc.d/eTSrv | |
##remove /lib directory | |
mv "${pkgdir}"/lib/* "${pkgdir}"/usr/lib/ | |
rmdir "${pkgdir}"/lib | |
##remove old symlinks | |
rm "${pkgdir}"/usr/lib/libeTFS.so | |
rm "${pkgdir}"/usr/lib/libeToken.so | |
rm "${pkgdir}"/usr/lib/libeTokenUI.so | |
rm "${pkgdir}"/usr/lib/libeTPkcs11.so | |
rm "${pkgdir}"/usr/lib/libeTSapi.so | |
##create new symlinks | |
ln -s /usr/lib/libeToken.so.8.1 "${pkgdir}"/usr/lib/libeTFS.so | |
ln -s /usr/lib/libeToken.so.8.1 "${pkgdir}"/usr/lib/libeToken.so | |
ln -s /usr/lib/libeTokenUI.so.8.1 "${pkgdir}"/usr/lib/libeTokenUI.so | |
ln -s /usr/lib/libeToken.so.8.1 "${pkgdir}"/usr/lib/libeTPkcs11.so | |
ln -s /usr/lib/libeToken.so.8.1 "${pkgdir}"/usr/lib/libeTSapi.so | |
##create driver symlink | |
mkdir -p "${pkgdir}"/usr/lib/pcsc/drivers/ | |
ln -s /usr/share/eToken/drivers/aks-ifdh.bundle "${pkgdir}"/usr/lib/pcsc/drivers/aks-ifdh.bundle | |
ln -s /usr/share/eToken/drivers/aks-ifdh.bundle/Contents/Linux/libAksIfdh.so.8.1 "${pkgdir}"/usr/share/eToken/drivers/aks-ifdh.bundle/Contents/Linux/libAksIfdh.so | |
##remove unneeded stuffs | |
rm "${pkgdir}"/usr/lib/eToken/libQt* | |
rm "${pkgdir}"/usr/bin/PKIMonitor | |
rm "${pkgdir}"/usr/bin/etProps | |
rm -rf "${pkgdir}"/usr/share/doc/eToken/help/* | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment