File: libtooldeps.sh

package info (click to toggle)
rpm 4.16.1.2%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,972 kB
  • sloc: ansic: 71,682; sh: 42,342; makefile: 893; python: 582; cpp: 571; perl: 231; sed: 16
file content (42 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (5)
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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

[ $# -ge 2 ] || {
    cat > /dev/null
    exit 0
}

case $1 in
-P|--provides)
    shift
    RPM_BUILD_ROOT="$1"
    while read possible
    do
	case "$possible" in
	*.la)
	    if grep -Eiq '^# Generated by (libtool|ltmain.sh)' "$possible" 2> /dev/null ; then
		possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
		echo "libtool($possible)"
	    fi
	    ;;
	esac
    done
    ;;
-R|--requires)
    while read possible ; do
	case "$possible" in
	*.la)
	    for dep in `grep '^dependency_libs='"$possible" 2> /dev/null | \
			sed -e "s,^dependency_libs='\(.*\)',\1,g"`
	    do
		case "$dep" in
		/*.la)
		    echo "libtool($dep)"
		    ;;
		esac
	    done
	    ;;
	esac
    done
    ;;
esac
exit 0