Blame SOURCES/pythondeps-scl-38.sh

70a2d8
#!/bin/bash
70a2d8
# Altered from pythondeps.sh
70a2d8
# The second parameter is %{scl_prefix}, which is used to prefix python(abi).
70a2d8
70a2d8
[ $# -ge 1 ] || {
70a2d8
    cat > /dev/null
70a2d8
    exit 0
70a2d8
}
70a2d8
70a2d8
case $1 in
70a2d8
-P|--provides)
70a2d8
    shift
70a2d8
    # Match buildroot/payload paths of the form
70a2d8
    #    /PATH/OF/BUILDROOT/%{_scl_root}/usr/bin/pythonMAJOR.MINOR
70a2d8
    # generating a line of the form
70a2d8
    #    %{scl_prefix}python(abi) = MAJOR.MINOR
70a2d8
    # (Don't match against -config tools e.g. /usr/bin/python2.6-config)
70a2d8
    if [ "x$1" = "x" ]; then
70a2d8
        grep "/usr/bin/python.\..$" \
70a2d8
            | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
70a2d8
    else
70a2d8
        grep "/opt/.*/usr/bin/python.\..$" \
70a2d8
            | sed -e "s|.*/usr/bin/python\(.\..\)|$1python(abi) = \1|"
70a2d8
    fi
70a2d8
70a2d8
    if [ "x$1" != "x" ]; then
70a2d8
        grep "pkgconfig(.*$" \
70a2d8
            | sed -e "s|pkgconfig(|$1pkgconfig(|"
70a2d8
    fi
70a2d8
   ;;
70a2d8
-R|--requires)
70a2d8
    shift
70a2d8
    # Match buildroot paths of the form
70a2d8
    #    /PATH/OF/BUILDROOT/%{scl_root}/usr/lib/pythonMAJOR.MINOR/  and
70a2d8
    #    /PATH/OF/BUILDROOT/%{scl_root}/usr/lib64/pythonMAJOR.MINOR/
70a2d8
    # generating (uniqely) lines of the form:
70a2d8
    #    %{scl_prefix}python(abi) = MAJOR.MINOR
70a2d8
    if [ "x$1" = "x" ]; then
70a2d8
        grep "/usr/lib[^/]*/python.\../.*" \
70a2d8
            | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
70a2d8
            | sort | uniq
70a2d8
    else
70a2d8
        grep "/opt/.*/usr/lib[^/]*/python.\../.*" \
70a2d8
            | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|$1python(abi) = \1|g" \
70a2d8
            | sort | uniq
70a2d8
    fi
70a2d8
    ;;
70a2d8
esac
70a2d8
70a2d8
exit 0