summaryrefslogtreecommitdiffstats
path: root/system/pcsc-lite
diff options
context:
space:
mode:
author B. Watson <urchlay@slackware.uk>2023-08-01 15:27:46 -0400
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-08-12 08:29:50 +0700
commit035396b379c5890c0df1d7ddca737954bf1cd2ff (patch)
treeda2be73961f9bae103b6b6480fc21de8d3f63e71 /system/pcsc-lite
parentf4d5e0c6d65683686be32e05817356fa19e332fa (diff)
downloadslackbuilds-035396b379c5890c0df1d7ddca737954bf1cd2ff.tar.gz
slackbuilds-035396b379c5890c0df1d7ddca737954bf1cd2ff.tar.xz
system/pcsc-lite: Fix user/group detection.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/pcsc-lite')
-rw-r--r--system/pcsc-lite/pcsc-lite.SlackBuild25
1 files changed, 13 insertions, 12 deletions
diff --git a/system/pcsc-lite/pcsc-lite.SlackBuild b/system/pcsc-lite/pcsc-lite.SlackBuild
index 84808e724e..57529c30e7 100644
--- a/system/pcsc-lite/pcsc-lite.SlackBuild
+++ b/system/pcsc-lite/pcsc-lite.SlackBuild
@@ -23,11 +23,15 @@
# 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.9.9}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -39,9 +43,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -54,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
@@ -70,7 +71,7 @@ DEBUGATR=${DEBUGATR:-0}
AUTOPOFF=${AUTOPOFF:-0} # disabled by default
# README and README.DAEMON are not useful and partly outdated.
-DOCFILES="SECURITY ChangeLog* COPYING HELP NEWS TODO AUTHORS INSTALL"
+DOCFILES="SECURITY ChangeLog* COPYING HELP NEWS TODO AUTHORS"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
@@ -97,9 +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 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} +
# ATR (answer to reset) debug parsing output
case "$DEBUGATR" in