]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/install-default-backend.in
Use a helper script to link the correct database backend.
[bacula/bacula] / bacula / src / cats / install-default-backend.in
1 #!/bin/sh
2
3 LIBTOOL=@LIBTOOL@
4
5 if [ $# -lt 3 ]; then
6    echo "Usage: $0 <default_backend> <library_version> <install_dir>"
7    exit 1
8 fi
9
10 default_backend=$1
11 library_version=$2
12 install_dir=$3
13
14 #
15 # Find out what the shared lib extension is for this platform.
16 #
17 shrext_cmds="`${LIBTOOL} --config | grep shrext_cmds`"
18 eval $shrext_cmds
19 if [ -z "${shrext_cmds}" ]; then
20    echo "Failed to determine default shared library extension"
21    exit 1
22 fi
23
24 if [ -f ${install_dir}/libbaccats-${default_backend}-${library_version}${shrext_cmds} ]; then
25    #
26    # Create a default catalog library pointing to one of the shared libs.
27    #
28    rm -f ${install_dir}/libbaccats-${library_version}${shrext_cmds}
29    ln -s ${install_dir}/libbaccats-${default_backend}-${library_version}${shrext_cmds} \
30          ${install_dir}/libbaccats-${library_version}${shrext_cmds}
31 fi
32
33 exit 0