diff options
Diffstat (limited to 'system/pcsc-lite/pcsc-lite.SlackBuild')
-rw-r--r-- | system/pcsc-lite/pcsc-lite.SlackBuild | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/system/pcsc-lite/pcsc-lite.SlackBuild b/system/pcsc-lite/pcsc-lite.SlackBuild index 7be660105f..57529c30e7 100644 --- a/system/pcsc-lite/pcsc-lite.SlackBuild +++ b/system/pcsc-lite/pcsc-lite.SlackBuild @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for pcsc-lite # Copyright 2007-2015 LukenShiro, Italy +# Copyright 2020-2023 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,20 +23,31 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20230801 bkw: Modified by SlackBuilds.org, BUILD=2: +# - handle user and group detection better. +# - get rid of generic GNU INSTALL from doc dir. + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=pcsc-lite -VERSION=${VERSION:-1.8.14} -BUILD=${BUILD:-1} +VERSION=${VERSION:-1.9.9} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -43,12 +55,12 @@ OUTPUT=${OUTPUT:-/tmp} # Bail out if user or group isn't valid on your system # For slackbuilds.org, assigned pcscd uid/gid are 257/257 # See http://slackbuilds.org/uid_gid.txt -if ! grep ^pcscd: /etc/group 2>&1 > /dev/null; then - echo " You must have a \"pcscd\" group to run this script." +# 20230801 bkw: grepping /etc/passwd and /etc/group may fail if e.g. NIS +# or LDAP is in use; always use getent. Also, print both messages (for user +# and group) if either doesn't exist. +if ! getent group pcscd &>/dev/null || ! getent passwd pcscd &>/dev/null; then + echo " You must have a \"pcscd\" user and group to run this script." echo " # groupadd -g 257 pcscd" - exit 1 -elif ! grep ^pcscd: /etc/passwd 2>&1 > /dev/null; then - echo " You must have a \"pcscd\" user to run this script." echo " # useradd -u 257 -g pcscd -d /var/run/pcscd -s /bin/false pcscd" exit 1 fi @@ -59,10 +71,10 @@ DEBUGATR=${DEBUGATR:-0} AUTOPOFF=${AUTOPOFF:-0} # disabled by default # README and README.DAEMON are not useful and partly outdated. -DOCFILES="DRIVERS SECURITY ChangeLog* COPYING HELP NEWS TODO AUTHORS INSTALL" +DOCFILES="SECURITY ChangeLog* COPYING HELP NEWS TODO AUTHORS" -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -86,13 +98,9 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} + -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -# Fix the DRIVERS file to reflect the correct drivers directory as built -# with this script -sed -i "s|\/usr\/local|<libdir>|g" DRIVERS + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} + # ATR (answer to reset) debug parsing output case "$DEBUGATR" in @@ -126,6 +134,7 @@ CXXFLAGS="$SLKCFLAGS" \ --enable-usbdropdir="/usr/lib${LIBDIRSUFFIX}/pcsc/drivers" \ --enable-confdir=/etc/reader.conf.d \ --${DEBUGATR_FLAG}able-debugatr \ + --disable-libsystemd \ --build=$ARCH-slackware-linux make @@ -140,9 +149,9 @@ mkdir -p $PKG/etc/rc.d install -m 0755 $CWD/rc.pcscd $PKG/etc/rc.d/rc.pcscd.new # Correct manpages in reader.conf.5 and pcscd.8 -sed -i "s|@confdir@|/etc/reader.conf.d|g" $PKG/usr/man/man5/reader.conf.5 -sed -i "s|@sysconfdir_exp@/init.d/pcscd|/etc/rc.d/rc.pcscd|g" $PKG/usr/man/man8/pcscd.8 -sed -i "s|@sysconfdir_exp@|/etc/reader.conf.d|g" $PKG/usr/man/man8/pcscd.8 +sed -i "s|@confdir@|/etc/reader.conf.d|g" $PKG/usr/man/man5/reader.conf.5 || exit 1 +sed -i "s|@sysconfdir_exp@/init.d/pcscd|/etc/rc.d/rc.pcscd|g" $PKG/usr/man/man8/pcscd.8 || exit 1 +sed -i "s|@sysconfdir_exp@|/etc/reader.conf.d|g" $PKG/usr/man/man8/pcscd.8 || exit 1 # Create the directory for drivers and such (not included with this package) mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pcsc/{drivers,services} @@ -160,9 +169,11 @@ cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE # remove README.DAEMON, automatically installed by doc/Makefile. rm -f $PKG/usr/doc/$PRGNAM-$VERSION/README.DAEMON +rm -f $PKG/usr/lib*/*.la + 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.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |