Blame SOURCES/python.attr

5cdac4
%__python_provides() %{lua:
5cdac4
    -- Match buildroot/payload paths of the form
5cdac4
    --    /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
5cdac4
    -- generating a line of the form
5cdac4
    --    python(abi) = MAJOR.MINOR
5cdac4
    -- (Don't match against -config tools e.g. /usr/bin/python2.6-config)
5cdac4
    local path = rpm.expand('%1')
5cdac4
    if path:match('/usr/bin/python%d+%.%d+$') then
5cdac4
        local provides = path:gsub('.*/usr/bin/python(%d+%.%d+)', 'python(abi) = %1')
5cdac4
        print(provides)
5cdac4
    end
5cdac4
}
5cdac4
5cdac4
%__python_requires() %{lua:
5cdac4
    -- Match buildroot paths of the form
5cdac4
    --    /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/  and
5cdac4
    --    /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
5cdac4
    -- generating a line of the form:
5cdac4
    --    python(abi) = MAJOR.MINOR
5cdac4
    local path = rpm.expand('%1')
5cdac4
    if path:match('/usr/lib%d*/python%d+%.%d+/.*') then
5cdac4
        local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1')
5cdac4
        print(requires)
5cdac4
    end
5cdac4
}
5cdac4
5cdac4
%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$