Blame SOURCES/pythondeps-scl-27.sh

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