Blame SOURCES/pythondeps-scl-36.sh

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