Blame SOURCES/pythondeps-scl-33.sh

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