File: soname.sh

package info (click to toggle)
patchelf 0.9%2B52.20180509-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 636 kB
  • sloc: cpp: 3,763; sh: 254; makefile: 92; ansic: 37
file content (30 lines) | stat: -rwxr-xr-x 987 bytes parent folder | download | duplicates (4)
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
30
#! /bin/sh -e
SCRATCH=scratch/$(basename $0 .sh)

rm -rf ${SCRATCH}
mkdir -p ${SCRATCH}

cp libsimple.so ${SCRATCH}/

# set an initial DT_SONAME entry
../src/patchelf --set-soname libsimple.so.1.0 ${SCRATCH}/libsimple.so
newSoname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so)
if test "$newSoname" != libsimple.so.1.0; then
    echo "failed --set-soname test. Expected newSoname: libsimple.so.1.0, got: $newSoname"
    exit 1
fi

# print DT_SONAME
soname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so)
if test "$soname" != libsimple.so.1.0; then
    echo "failed --print-soname test. Expected soname: libsimple.so.1.0, got: $soname"
    exit 1
fi

# replace DT_SONAME entry
../src/patchelf --set-soname libsimple.so.1.1 ${SCRATCH}/libsimple.so
newSoname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so)
if test "$newSoname" != libsimple.so.1.1; then
    echo "failed --set-soname test. Expected newSoname: libsimple.so.1.1, got: $newSoname"
    exit 1
fi