[4.0] Use strip (instead of eu-strip) to support --strip-debug of *.so at build time
[platform/upstream/rpm.git] / scripts / pythondeps.sh
1 #!/bin/bash
2
3 [ $# -ge 1 ] || {
4     cat > /dev/null
5     exit 0
6 }
7
8 case $1 in
9 -P|--provides)
10     shift
11     # Match buildroot/payload paths of the form
12     #    /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
13     # generating a line of the form
14     #    python(abi) = MAJOR.MINOR
15     # (Don't match against -config tools e.g. /usr/bin/python2.6-config)
16     grep "/usr/bin/python.\..$" \
17         | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
18     ;;
19 -R|--requires)
20     shift
21     # Match buildroot paths of the form
22     #    /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/  and
23     #    /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
24     # generating (uniqely) lines of the form:
25     #    python(abi) = MAJOR.MINOR
26     grep "/usr/lib[^/]*/python.\../.*" \
27         | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
28         | sort | uniq
29     ;;
30 esac
31
32 exit 0