]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/install-default-backend.in
Use RestoreObject type in Catalog
[bacula/bacula] / bacula / src / cats / install-default-backend.in
1 #!/bin/sh
2
3 LIBTOOL="@BUILD_DIR@/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 eval `${LIBTOOL} --config | grep shrext_cmds`
18 eval SHLIB_EXT=$shrext_cmds
19
20 if [ -z "${SHLIB_EXT}" ]; then
21    echo "Failed to determine default shared library extension"
22    exit 1
23 fi
24
25 if [ -f ${install_dir}/libbaccats-${default_backend}-${library_version}${SHLIB_EXT} ]; then
26    #
27    # Create a default catalog library pointing to one of the shared libs.
28    #
29    rm -f ${install_dir}/libbaccats-${library_version}${SHLIB_EXT}
30
31    #
32    # Create a relative symlink to the default backend
33    # As all backends are in the same directory anyhow this should
34    # always work.
35    #
36    ln -s libbaccats-${default_backend}-${library_version}${SHLIB_EXT} \
37          ${install_dir}/libbaccats-${library_version}${SHLIB_EXT}
38 fi
39
40 exit 0