# Install jackdmp and owerwrite jack installation

# Plug-ins
sudo cp -r Panda.framework /Library/Frameworks
sudo cp -r JackRouter.plugin /Library/Audio/Plug-Ins/HAL/

# Copy libraries and exe
sudo cp -r Jackmp.framework /Library/Frameworks/  
sudo cp -r Jackservermp.framework /Library/Frameworks/   
sudo install -d /usr/local/bin 
sudo cp jackdmp /usr/local/bin  

# Copy drivers
sudo install -d  /usr/local/lib/jackmp 
sudo cp  jack_coreaudio.so  /usr/local/lib/jackmp 
sudo cp  jack_dummy.so  /usr/local/lib/jackmp

# Create links to jackmp ressources
cd /usr/local/lib && [ -f libjack.0.dylib ] && sudo mv -f libjack.0.dylib tmp_libjack.0.dylib 
cd /usr/local/lib && [ -f jackd ] && sudo mv -f jackd tmp_jackd 
cd /usr/local/lib && [ -f libjack.dylib ] && sudo rm libjack.dylib
cd /usr/local/bin && [ -f jackd ] && sudo rm jackd
cd /usr/local/lib && sudo ln -s /Library/Frameworks/Jackmp.framework/Jackmp libjack.dylib
cd /usr/local/lib && sudo ln -s /Library/Frameworks/Jackmp.framework/Jackmp libjack.0.dylib
cd /usr/local/bin && sudo ln -s jackdmp jackd


