# Copyright 1999-2005 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header$ inherit eutils DESCRIPTION="This library provides a driver for using REINER SCT cyberJack smartcard readers under UNIX environment." HOMEPAGE="http://www.reiner-sct.de/" SRC_URI="http://support.reiner-sct.de/downloads/LINUX/V${PV}/ctapi-${P}.tar.bz2" LICENSE="LGPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="pcsc-lite usb" RDEPEND="virtual/linux-sources pcsc-lite? ( sys-apps/pcsc-lite )" DEPEND="${RDEPEND}" S="${WORKDIR}/ctapi-${P}" pkg_setup() { if use usb; then enewgroup ${PN} fi } src_compile() { cd ${S}/ctapi emake || die "Could not compile libraries" cd ${S}/tools emake || die "Could not compile tools" if use pcsc-lite; then cd ${S}/pcsc emake || die "Could not compile package" fi } src_install() { cd ${S} insinto /usr/lib/readers insopts -m 0755 newins ctapi/libctapi-${PN}.so libctapi-${PN}.so.${PV} doins ctapi/libctapi-${PN}.a dosym /usr/lib/readers/libctapi-${PN}.so.${PV} /usr/lib/readers/libctapi-${PN}.so dosym /usr/lib/readers/libctapi-${PN}.so /usr/lib/readers/libctapi.so dosym /usr/lib/readers/libctapi.so /usr/lib/libctapi.so dosym /usr/lib/readers/libctapi-${PN}.a /usr/lib/libctapi-${PN}.a insinto /usr/include insopts -m 0644 doins ctapi/include/ctapi.h dobin tools/cjgeldkarte tools/ctsh if use usb; then insinto /etc/hotplug/usb insopts -m 0644 doins etc/hotplug/${PN}.usermap insopts -m 0755 doins etc/hotplug/usb${PN} dodir /etc/udev/rules.d echo 'SYSFS{idVendor}=="0c4b", KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", SYMLINK="ttyUSB%n", GROUP="cyberjack", MODE="0660"' \ >${D}/etc/udev/rules.d/30-${PN}.rules fi if use pcsc-lite; then insinto /usr/lib/readers insopts -m 0755 newins pcsc/ifd-${PN}.bundle/Contents/Linux/ifd-${PN}.so lib${PN}_ifd.so.${PV} insinto /usr/lib/pcsc/drivers/ifd-${PN}.bundle/Contents insopts -m 0444 doins pcsc/ifd-${PN}.bundle/Contents/Info.plist pcsc/ifd-${PN}.bundle/Contents/PkgInfo dosym /usr/lib/readers/lib${PN}_ifd.so.${PV} /usr/lib/readers/lib${PN}_ifd.so dodir /usr/lib/pcsc/drivers/ifd-${PN}.bundle/Contents/Linux dosym /usr/lib/readers/lib${PN}_ifd.so /usr/lib/pcsc/drivers/ifd-${PN}.bundle/Contents/Linux/ifd-${PN}.so insinto /etc insopts -m 0644 doins ${FILESDIR}/reader.conf newins etc/reader.conf reader.conf.${PN} fi dodir /etc/env.d cat <${D}/etc/env.d/30${PN} LDPATH="/usr/lib/readers" # Uncomment the following line to disable the key beeps. #CJCTAPI_NO_KEYBEEP="" EOF dodoc COPYRIGHT.GPL COPYRIGHT.LGPL doc/README.pdf doc/README.html doc/README.txt MAKEUSBDEV tools/ctshrc.example } pkg_postinst() { echo einfo "Starting with Version 2.0.5 of ${PN}, the host PC" einfo "will emit a beep sound at every key press. The driver tries to" einfo "detect the best mechanism for beeping by itself, i.e. xBell" einfo "when you run under X11, or sending a BEL ASCII character to" einfo "STDOUT when running as a console application." einfo "" einfo "If you want to disable the beep, you can set the" einfo "CJCTAPI_NO_KEYBEEP environment variable before starting your" einfo "application (i.e. export CJCTAPI_NO_KEYBEEP)." einfo "" einfo "Furthermore you could uncomment the CJCTAPI_NO_KEYBEEP line" einfo "in /etc/env.d/30${PN}." echo if use usb; then einfo "To use hotplugging (REINER SCT cyberJack USB smartcard readers) your kernel has to be compiled" einfo "with CONFIG_HOTPLUG enabled and sys-apps/hotplug must be emerged." echo fi if use pcsc-lite; then einfo "To use PC/SC you maybe have to change the content of /etc/reader.conf file." einfo "Please read the information in the /etc/reader.conf.${PN} file first." echo fi }