add etoken-sac for me to use

This commit is contained in:
microcai 2014-06-13 12:30:05 +08:00
parent 4a2855df63
commit 17eb4f90dc
10 changed files with 218 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST 610-011815-002_SAC_Linux_v8.1.zip 44289310 SHA256 3316abea7b4091736038834cc8db68f11639b8aa774b7596edb27195d3a9f58e

View File

@ -0,0 +1,114 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: This ebuild is from mva overlay $
EAPI="5"
inherit eutils multilib rpm
DESCRIPTION="SafeNet (Aladdin) eToken Middleware for eTokenPRO, eTokenNG OTP, eTokenNG Flash, eToken Pro (Java)"
MY_PN="SafenetAuthenticationClient"
MY_PV="${PV/_p/-}"
MY_P_86="${MY_PN}-${MY_PV}.i386.rpm"
MY_P_64="${MY_PN}-${MY_PV}.x86_64.rpm"
MY_COMPAT_P="SAC-32-CompatibilityPack-${MY_PV}.x86_64.rpm"
SRC_URI="http://www.sadvisor.com/etoken/610-011815-002_SAC_Linux_v8.1.zip"
HOMEPAGE="http://www.etokenonlinux.org"
LICENSE="EULA"
SLOT="0"
KEYWORDS="-* ~x86 ~amd64"
IUSE="ssl multilib"
REQUIRED_USE="amd64? ( multilib )"
# TODO: minimal useflag (I can't do it now, since
# it seems like I brake my token and it is uninitialized now)
RDEPEND="
>=sys-apps/pcsc-lite-1.4.99
|| (
dev-libs/libusb-compat
dev-libs/libusb:0
)
sys-apps/dbus
media-libs/libpng:1.2
media-libs/fontconfig
ssl? ( dev-libs/engine_pkcs11 )
"
DEPEND="
app-arch/unzip
app-arch/rpm2targz
app-arch/tar
${RDEPEND}
"
QA_PREBUILT="*"
QA_SONAME_NO_SYMLINK="usr/lib32/.* usr/lib64/.*"
S="${WORKDIR}/SAC 8.1 Linux/rpmcontent"
src_unpack() {
unpack "${A}"
cd "${WORKDIR}/SAC 8.1 Linux/"
mkdir rpmcontent
if use amd64 ; then
unzip "x86_64/SAC_8_1_0_4_Linux_RPM_64.zip"
unzip "x86_64/SAC_8_1_0_4_Linux_32_Compatibilty_Pack_RPM.zip"
rpm2tar -O "SAC_8_1_0_4_Linux_RPM_64/RPM/SafenetAuthenticationClient-8.1.0-4.x86_64.rpm" | tar -xf - -C rpmcontent
rpm2tar -O "SAC_8_1_0_4_Linux_32_Compatibilty_Pack_RPM/SAC-32-CompatibilityPack-8.1.0-4.x86_64.rpm" | tar -xf - -C rpmcontent
tar -xf "${FILESDIR}/dist/libhal_amd64_lib32.txz" -C rpmcontent
tar -xf "${FILESDIR}/dist/libhal_amd64_lib64.txz" -C rpmcontent
tar -xf "${FILESDIR}/dist/pcsc_amd64.txz" -C rpmcontent
fi
if use x86 ; then
unzip "x32/SAC_8_1_0_4_Linux_RPM_32.zip"
rpm2tar -O "SAC_8_1_0_4_Linux_RPM_32/RPM/SafenetAuthenticationClient-8.1.0-4.i386.rpm" | tar -xf - -C rpmcontent
tar -xf ${FILESDIR}/dist/libhal_x86.txz -C rpmcontent
fi
cd "${S}"
}
src_prepare() {
default
EPATCH_SOURCE="${FILESDIR}/patches" \
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
epatch_user
cp "${FILESDIR}/eTSrv.init-r3" etc/init.d/eTSrv
cp "${FILESDIR}/dist/Makefile" "${S}"
}
pkg_postinst() {
ewarn "!!!!!!!"
ewarn "Currently, Gentoo Dev Team has removed libusb:0 from the portage tree"
ewarn "(although, it is still in multilib overlay)"
ewarn "For now, I added libusb-compat (wrapper) as a dependency,"
ewarn "but it can either work or doesn't work for you."
echo
ewarn "If it'll not — try to emerge libusb:0 from multilib overlay."
ewarn "!!!!!!!"
echo
einfo "Run"
einfo "rc-update add pcscd default"
einfo "rc-update add eTSrv default"
einfo "to add eToken support daemon to autostart"
einfo ""
einfo "In some cases the eToken will not work after rebooting your system."
einfo "This can be due to the fact, that your pcscd is not running."
einfo "This may happen if you forgot to add pcscd to default runlevel"
einfo "(or because of crash)."
echo
einfo "If you need some help, you can ask the help in that article:"
einfo "http://www.it-lines.ru/blogs/linux/nastrojka-etoken-v-gentoo-linux"
}

View File

@ -0,0 +1,53 @@
# Some functions for candiness-looking
err = \
@echo -e " \e[1;31m*\e[0m $(1)\e[0m"; \
@exit 1;
inf = \
@echo -e " \e[1;32m*\e[0m $(1)\e[0m";
wrn = \
@echo -e " \e[1;33m*\e[0m $(1)\e[0m";
ext = \
@echo -e " \e[1;35m*\e[0m $(1)\e[0m";
# LibVersion
PV := 8.1
PN := etoken-sac-$(PV)
ARCH := $(shell uname -m)
DESTDIR := /
ifeq ($(ARCH), x86_64)
LIBDIR := lib64
else ifeq ($(ARCH),i386)
LIBDIR := lib
else ifeq ($(ARCH),i486)
LIBDIR := lib
else ifeq ($(ARCH),i586)
LIBDIR := lib
else ifeq ($(ARCH),i686)
LIBDIR := lib
endif
#LIBDIR := $(if $(shell [[ $(ARCH) =~ i.86 ]] && echo x86),lib,lib64)
# @ mv usr/share/doc/eToken usr/share/doc/$(PN)
prepare:
@ $(call inf,"Preparing image...")
ifeq ($(ARCH),x86_64)
@ mv lib lib32
@ mv usr/lib usr/lib32
@ sh -c 'find usr/lib32 -type l | while read lib; do nlib=$$(readlink $${lib}); ln -sf $${nlib/\/lib\//\/lib32\/} $${lib}; done'
endif
@ rm -r etc/rc.d
@ mv etc/ld.so.conf.d/wwwwetoken-ld.conf etc/ld.so.conf.d/90etoken
@ mkdir -p usr/$(LIBDIR)/readers/usb
@ ln -s ../../../share/eToken/drivers/aks-ifdh.bundle usr/$(LIBDIR)/readers/usb/aks-ifdh.bundle
@ mkdir -p etc/conf.d/ && touch etc/conf.d/eTSrv
@ mkdir -p image; mv etc lib* usr image/; rm -r var
@ $(call inf,"Done!")
install:
@ $(call inf,"Installing...")
@ cp -a image/* $(DESTDIR)
@ $(call inf,"Done!")
clean:
@ $(call inf,"Nothing to do...")
uninstall: clean

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,36 @@
#!/sbin/runscript
# Distributed under the terms of the GNU General Purpose License v2
# $Header: $
# Description: eTSrv This starts, stops, and reloads the eToken eTSrv NAME
NAME=eTSrv
name="eToken eTSrv NAME"
command="/usr/bin/${NAME}"
command_args="${EXTRA_OPTS}"
pidfile="/var/run/${NAME}.pid"
start_stop_NAME_args="-q -u pcscd:pcscd -n ${NAME}"
start_stop_NAME_start_args="-k 000"
start_stop_NAME_stop_args="-R TERM/2/KILL/5"
depend() {
need pcscd
}
checkconfig() {
"${command}" --test > /dev/null || return 1
}
start_pre() {
if [ "${RC_CMD}" != "restart" ] ; then
checkconfig || return 1
fi
mkdir -p "/var/cache/eToken"
}
stop_pre() {
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return 1
fi
}

View File

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>mva@mva.name</email>
<description>
If you have any issues, please contact me, or try to find me in IRC on Freenode, OFTC or RusNet.
</description>
<name>Vadim A. Misbakh-Soloviov</name>
</maintainer>
<longdescription>FIXME</longdescription>
<use>
</use>
</pkgmetadata>