diff --git a/MacOSX/opensc-uninstall b/MacOSX/opensc-uninstall index 62b5b0fd..390d6ed2 100755 --- a/MacOSX/opensc-uninstall +++ b/MacOSX/opensc-uninstall @@ -6,9 +6,17 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi -# Remove symlinks to commands -for file in /Library/OpenSC/bin/*; do - test -L "/usr/local/bin/$(basename $file)" && rm -f "/usr/local/bin/$(basename $file)" +for f in \ + /Library/OpenSC/bin/* \ + /Library/OpenSC/etc/bash_completion.d/* \ + /Library/OpenSC/share/doc/opensc \ + /Library/OpenSC/share/man/man1/* \ + /Library/OpenSC/share/man/man5/* +do + a=/Library/OpenSC + b=/usr/local + l="${f/$a/$b}" + test -L "$l" && rm -f "$l" done # Remove pkcs11 libraries diff --git a/MacOSX/scripts/postinstall b/MacOSX/scripts/postinstall index 8293c2c3..ff11f831 100755 --- a/MacOSX/scripts/postinstall +++ b/MacOSX/scripts/postinstall @@ -16,12 +16,23 @@ else md5 -r /Library/OpenSC/etc/opensc.conf > /Library/OpenSC/etc/opensc.conf.md5 fi -for f in /Library/OpenSC/bin/* +for f in \ + /Library/OpenSC/bin/* \ + /Library/OpenSC/etc/bash_completion.d/* \ + /Library/OpenSC/share/doc/opensc \ + /Library/OpenSC/share/man/man1/* \ + /Library/OpenSC/share/man/man5/* do - ln -sf $f /usr/local/bin + a=/Library/OpenSC + b=/usr/local + l="$(dirname ${f/$a/$b})" + mkdir -p $l + ln -sf $f $l done -for f in /Library/LaunchAgents/pkcs11-register.plist /Library/LaunchAgents/opensc-notify.plist +for f in \ + /Library/LaunchAgents/pkcs11-register.plist \ + /Library/LaunchAgents/opensc-notify.plist do if [ -e "$f" ] then