#!/bin/sh
#
# Copyright (c) 2012 Spotify AB

# This script makes symlinks from fedora's libs to
# the debian lib names that spotify expects.
#
# Since spotify looks for libs next to the executable,
# the symlinks can go there.

MACHINE_TYPE=`uname -m`
LIB_FOLDER="/usr/lib"
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
	LIB_FOLDER="/usr/lib64"
fi

# Since cef is built on debian, it excepts
# different lib names.
ln -sf ${LIB_FOLDER}/libnspr4.so libnspr4.so.0d
ln -sf ${LIB_FOLDER}/libnss3.so libnss3.so.1d
ln -sf ${LIB_FOLDER}/libnssutil3.so libnssutil3.so.1d
ln -sf ${LIB_FOLDER}/libplc4.so libplc4.so.0d
ln -sf ${LIB_FOLDER}/libplds4.so libplds4.so.0d
ln -sf ${LIB_FOLDER}/libsmime3.so libsmime3.so.1d
ln -sf ${LIB_FOLDER}/libssl3.so libssl3.so.1d

# This is a hack. In the future get rid of the dependency
# on openssl.
ln -sf ${LIB_FOLDER}/libssl.so.10 libssl.so.0.9.8
ln -sf ${LIB_FOLDER}/libcrypto.so.10 libcrypto.so.0.9.8
