macOS: install man, doc, completion to /usr/local

This commit is contained in:
Frank Morgner 2019-04-25 14:48:42 +02:00
parent 13429baed0
commit b06398c1af
2 changed files with 25 additions and 6 deletions

View File

@ -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

View File

@ -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