[Pcsclite-cvs-commit] r7027 - trunk/PCSC/src/spy
ludovic.rousseau at free.fr
ludovic.rousseau at free.fr
Thu Nov 6 13:56:10 UTC 2014
Author: rousseau
Date: 2014-11-06 13:56:10 +0000 (Thu, 06 Nov 2014)
New Revision: 7027
Modified:
trunk/PCSC/src/spy/install_spy.sh
trunk/PCSC/src/spy/uninstall_spy.sh
Log:
Use ldconfig(8) to find the directory containing libpcsclite.so.1
On a Debian system (using multiarch) the directory is no more /usr/lib
but /usr/lib/x86_64-linux-gnu on a 64-bits Intel system.
Modified: trunk/PCSC/src/spy/install_spy.sh
===================================================================
--- trunk/PCSC/src/spy/install_spy.sh 2014-11-06 09:08:07 UTC (rev 7026)
+++ trunk/PCSC/src/spy/install_spy.sh 2014-11-06 13:56:10 UTC (rev 7027)
@@ -3,8 +3,20 @@
# exit on the first error
set -e
-cd /usr/lib
+# ldconfig --print-cache will return something like
+# libpcsclite.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
+DIR=$(ldconfig --print-cache | grep libpcsclite.so.1)
+# get the right part only: /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
+DIR=$(echo $DIR | cut -d'=' -f2 | cut -d' ' -f2)
+
+# get the directory part only: /usr/lib/x86_64-linux-gnu
+DIR=$(dirname $DIR)
+
+echo "Using directory:" $DIR
+
+cd $DIR
+
NOSPY=libpcsclite_nospy.so.1
if [ -f $NOSPY ]
Modified: trunk/PCSC/src/spy/uninstall_spy.sh
===================================================================
--- trunk/PCSC/src/spy/uninstall_spy.sh 2014-11-06 09:08:07 UTC (rev 7026)
+++ trunk/PCSC/src/spy/uninstall_spy.sh 2014-11-06 13:56:10 UTC (rev 7027)
@@ -3,7 +3,19 @@
# exit on the first error
set -e
-cd /usr/lib
+# ldconfig --print-cache will return something like
+# libpcsclite.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
+DIR=$(ldconfig --print-cache | grep libpcsclite.so.1)
+# get the right part only: /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
+DIR=$(echo $DIR | cut -d'=' -f2 | cut -d' ' -f2)
+
+# get the directory part only: /usr/lib/x86_64-linux-gnu
+DIR=$(dirname $DIR)
+
+echo "Using directory:" $DIR
+
+cd $DIR
+
# Use the real library again
mv libpcsclite_nospy.so.1 libpcsclite.so.1.0.0
More information about the Pcsclite-cvs-commit
mailing list