File: libproxy_proxy_and_lib.test

package info (click to toggle)
libproxy 0.3.1-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,212 kB
  • ctags: 455
  • sloc: sh: 10,487; ansic: 2,826; makefile: 185; cpp: 88; python: 24
file content (29 lines) | stat: -rwxr-xr-x 928 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# $Id: libproxy_proxy_and_lib.test 386 2009-06-07 20:15:13Z dominique.leuenberger $

lib=$(/sbin/ldconfig -p 2>/dev/null | awk '/libproxy.so /{print $NF}')
proxy=$(which proxy 2>/dev/null)
build=src/bin/proxy

# Make sure libproxy is built and a valid dynamic library
if ! nm $lib 2>/dev/null | grep -qs _DYNAMIC; then
    nm src/lib/.libs/libproxy.so 2>/dev/null | grep -qs _DYNAMIC
    if [ $? -eq 0 ]; then
        # Try to be intelligent and use the library in the build dir
        # before we start running the rest of the tests
        export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:src/lib/.libs"
        lib=src/lib/.libs/libproxy.so
    fi
fi  

# Prefer the freshly built version over the installed version
if [ ! -x "$proxy" -a -x $build ]; then
    proxy=$build
fi  

if [ "$proxy" -a "$lib" ]; then
    echo pass=True
else
    echo pass=False
    echo 'reason="unable to access the library, try: make"'
fi