diff options
-rw-r--r-- | system/pcsc-lite/README | 26 | ||||
-rw-r--r-- | system/pcsc-lite/docs-DRIVERS.diff | 23 | ||||
-rw-r--r-- | system/pcsc-lite/doinst.sh | 24 | ||||
-rw-r--r-- | system/pcsc-lite/pcsc-lite.SlackBuild | 131 | ||||
-rw-r--r-- | system/pcsc-lite/pcsc-lite.info | 8 | ||||
-rw-r--r-- | system/pcsc-lite/rc.pcscd | 55 | ||||
-rw-r--r-- | system/pcsc-lite/slack-desc | 19 |
7 files changed, 286 insertions, 0 deletions
diff --git a/system/pcsc-lite/README b/system/pcsc-lite/README new file mode 100644 index 0000000000000..f1487907c4701 --- /dev/null +++ b/system/pcsc-lite/README @@ -0,0 +1,26 @@ +PC/SC-lite (Personal Computer/Smart Card interface) + +This is middleware to access a smart card using SCard API (PC/SC) Its purpose +is to provide a Windows(R) SCard interface in a very small form factor for +communicating to smart cards and readers. It is released under BSD license. + +It is compiled with --enable-usbdropdir=/usr/lib/pcsc/drivers +This will be the destination directory for usb readers' drivers (ccid, cardman, +others). + +NOTE: drivers are not included and must be compiled and installed separately. +See /usr/doc/pcsc-lite-1.4.99/DRIVERS for more information on getting and +installing specifc drivers. + +For serial and pcmcia readers only, it is necessary to edit files in +/etc/reader.conf.d/ and run "/usr/sbin/update-reader.conf". + +Compiling with "DEBUGATR=1 ./pcsc-lite.SlackBuild" enables ATR parsing debug +output messages. + +To start PC/SC-lite daemon, run "/etc/rc.d/rc.pcscd start". +For pcmcia readers, this daemon should be started after rc.pcmcia - this is +most easily accomplished by adding the following to /etc/rc.d/rc.local: + if [ -x /etc/rc.d/rc.pcscd ]; then + /etc/rc.d/rc.pcscd start + fi diff --git a/system/pcsc-lite/docs-DRIVERS.diff b/system/pcsc-lite/docs-DRIVERS.diff new file mode 100644 index 0000000000000..86d4f8163edc1 --- /dev/null +++ b/system/pcsc-lite/docs-DRIVERS.diff @@ -0,0 +1,23 @@ + +diff -Nur pcsc-lite-1.4.99.orig/DRIVERS pcsc-lite-1.4.99/DRIVERS +--- DRIVERS.bak 2007-10-13 16:21:11.000000000 -0500 ++++ DRIVERS 2008-03-06 00:21:53.119195118 -0600 +@@ -2,8 +2,8 @@ + + To install USB drivers, download the driver from http://www.linuxnet.com/ + and copy it to a temporary location. After you have unarchived the files +-copy the directory to /usr/local/pcsc/drivers/. If the directory +-/usr/local/pcsc/drivers/ does not exist create it before copying the driver ++copy the directory to /usr/lib/pcsc/drivers/. If the directory ++/usr/lib/pcsc/drivers/ does not exist create it before copying the driver + directory to it. + + Example Mac OS X, Linux 2.4: +@@ -28,3 +28,7 @@ + Refer to the driver README for more information. + + $Id: DRIVERS 867 2004-05-13 13:25:06Z rousseau $ ++ ++# Edited by Robby Workman <rworkman@slackbuilds.org> to reflect correct ++# information when installed from SlackBuilds.org -- 20080305 ++ diff --git a/system/pcsc-lite/doinst.sh b/system/pcsc-lite/doinst.sh new file mode 100644 index 0000000000000..7669b280aaa56 --- /dev/null +++ b/system/pcsc-lite/doinst.sh @@ -0,0 +1,24 @@ +#!/bin/sh +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.pcscd.new: +if [ -e etc/rc.d/rc.pcscd ]; then + cp -a etc/rc.d/rc.pcscd etc/rc.d/rc.pcscd.new.incoming + cat etc/rc.d/rc.pcscd.new > etc/rc.d/rc.pcscd.new.incoming + mv etc/rc.d/rc.pcscd.new.incoming etc/rc.d/rc.pcscd.new +fi + +config etc/rc.d/rc.pcscd.new +config etc/reader.conf.d/reader.conf.new + diff --git a/system/pcsc-lite/pcsc-lite.SlackBuild b/system/pcsc-lite/pcsc-lite.SlackBuild new file mode 100644 index 0000000000000..17c378a23f2b9 --- /dev/null +++ b/system/pcsc-lite/pcsc-lite.SlackBuild @@ -0,0 +1,131 @@ +#!/bin/sh + +# Slackware build script for pcsc-lite + +# Copyright 2007 LukenShiro <lukenshiro@ngi.it> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=pcsc-lite +VERSION=1.4.99 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +DEBUGATR=${DEBUGATR:-0} # Debug is off by default +DOCFILES="DRIVERS SECURITY ChangeLog COPYING ChangeLog.svn HELP NEWS TODO AUTHORS INSTALL README" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +# Fix the DRIVERS file to reflect the correct drivers directory as built +# with this script +patch -p0 < $CWD/docs-DRIVERS.diff || exit 1 + +# ATR (answer to reset) debug parsing output +case "$DEBUGATR" in + 0) DEBUGATR_FLAG="disable-debugatr" + ;; + *) DEBUGATR_FLAG="enable-debugatr" + ;; +esac + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --enable-confdir=/etc \ + --localstatedir=/var \ + --enable-ipcdir=/var/run \ + --enable-runpid=/var/run/pcscd.pid \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --enable-usbdropdir="/usr/lib/pcsc/drivers" \ + --enable-muscledropdir="/usr/lib/pcsc/services" \ + --${DEBUGATR_FLAG} + +make +make install DESTDIR=$PKG + +# formaticc manpage is not automatically installed +mkdir -p $PKG/usr/man/man1 +install -m 0644 doc/formaticc.1 $PKG/usr/man/man1/ + +# PC/SC-lite slackware-compliant daemon +mkdir -p $PKG/etc/rc.d +install -m 0755 $CWD/rc.pcscd $PKG/etc/rc.d/rc.pcscd.new + +# Don't clobber the config file +mv $PKG/etc/reader.conf.d/reader.conf $PKG/etc/reader.conf.d/reader.conf.new + +# Create the directory for drivers and such (not included with this package) +mkdir -p $PKG/usr/lib/pcsc/{drivers,services} + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/ +cp -a $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo +## .pdf api documentation files seem not to be built from .tex sources during make +## Most people don't need/want api docs anyway, so uncomment below if you do +#( cd $PKG/usr/doc/$PRGNAM-$VERSION/ +# if [ -x /usr/share/texmf/bin/pdflatex ]; then +# pdflatex ifdhandler-3.tex >/dev/null +# pdflatex pcsc-lite.tex >/dev/null +# for oldfiles in *.aux *.tex *.toc *.log *.bib *.out ; +# do rm -f $oldfiles ; +# done +# fi +#) + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/system/pcsc-lite/pcsc-lite.info b/system/pcsc-lite/pcsc-lite.info new file mode 100644 index 0000000000000..7f1b7b8d8a077 --- /dev/null +++ b/system/pcsc-lite/pcsc-lite.info @@ -0,0 +1,8 @@ +PRGNAM="pcsc-lite" +VERSION="1.4.99" +HOMEPAGE="http://pcsclite.alioth.debian.org" +DOWNLOAD="http://alioth.debian.org/frs/download.php/2257/pcsc-lite-1.4.99.tar.gz" +MD5SUM="16c59b54edde9fa466c0e1f0eb86fd61" +MAINTAINER="LukenShiro" +EMAIL="lukenshiro@ngi.it" +APPROVED="rworkman" diff --git a/system/pcsc-lite/rc.pcscd b/system/pcsc-lite/rc.pcscd new file mode 100644 index 0000000000000..480414de621b5 --- /dev/null +++ b/system/pcsc-lite/rc.pcscd @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Start/Stop/Restart the PC/SC-lite smart card daemon. +# +# pcscd should be started after pcmcia and shut down +# before it for smooth experience with PCMCIA readers. +# + +PIDFILE=/var/run/pcscd.pid +PCSCD_OPTS="" + +# Start +pcscd_start() { + if [ -x /usr/sbin/pcscd ]; then + if [ -e "$PIDFILE" ]; then + echo "PC/SC-lite daemon already started!" + else + echo "Starting PC/SC-lite smart card daemon..." + /usr/sbin/update-reader.conf + /usr/sbin/pcscd $PCSCD_OPTS + fi + fi +} + +# Stop +pcscd_stop() { + echo "Stopping PC/SC-lite smart card daemon..." + if [ -e "$PIDFILE" ]; then + kill $(cat $PIDFILE) + rm -f $PIDFILE + fi + # Just in case: + killall pcscd 1>&2 >/dev/null +} + +# Restart +pcscd_restart() { + pcscd_stop + sleep 3 + pcscd_start +} + +case "$1" in +'start') + pcscd_start + ;; +'stop') + pcscd_stop + ;; +'restart') + pcscd_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/system/pcsc-lite/slack-desc b/system/pcsc-lite/slack-desc new file mode 100644 index 0000000000000..283099c5f798d --- /dev/null +++ b/system/pcsc-lite/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler---------------------------------------------------| +pcsc-lite: pcsc-lite (Middleware to access a smart card using SCard API) +pcsc-lite: +pcsc-lite: Middleware to access a smart card using SCard API (PC/SC) +pcsc-lite: Its purpose is to provide a Windows(R) SCard interface in a +pcsc-lite: very small form factor for communicating to smart cards and +pcsc-lite: readers. +pcsc-lite: +pcsc-lite: https://alioth.debian.org/projects/pcsclite/ +pcsc-lite: +pcsc-lite: +pcsc-lite: |