# Give all binaries in the package realtime capabilities when they
# link to Jack2 (thanks to SBO's Johannes Schoepfer and Arik Miller):
if [ -x /sbin/setcap ]; then
  LSBINS=( "ls_instr_script"
"linuxsampler"
"lscp-linuxsampler" )
  for EXE in "${LSBINS[@]}" ; do
    if [ -n "$(readelf -d usr/bin/$EXE | grep libjack.so)" ]; then
      /sbin/setcap cap_ipc_lock,cap_sys_nice=ep "usr/bin/$EXE"
    fi
  done
fi
( cd usr/lib ; rm -rf liblinuxsampler.so )
( cd usr/lib ; ln -sf liblinuxsampler.so.7.0.0 liblinuxsampler.so )
( cd usr/lib ; rm -rf liblinuxsampler.so.7 )
( cd usr/lib ; ln -sf liblinuxsampler.so.7.0.0 liblinuxsampler.so.7 )
