Blame | Last modification | View Log | RSS feed
# python3_pkgversion specifies the version of Python 3 in the distro. It can be# a specific version (e.g. 34 in Fedora EPEL7)%python3_pkgversion 34#python3_other_pkgversion 35# Set to /bin/true when not active to avoid %ifdefs and %{? in specfiles%__python3_other /bin/true%py3_other_build /bin/true%py3_other_install /bin/true# Macro to replace overly complicated references to PyPI source files.# Expands to the pythonhosted URL for a package# Accepts zero to three arguments:# 1: The PyPI project name, defaulting to %srcname if it is defined, then# %pypi_name if it is defined, then just %name.# 2: The PYPI version, defaulting to %version.# 3: The file extension, defaulting to "tar.gz". (A period will be added# automatically.)# Requires %__pypi_url and %__pypi_default_extension to be defined.%__pypi_url https://files.pythonhosted.org/packages/source/%__pypi_default_extension tar.gz%pypi_source() %{lua:local src = rpm.expand('%1')local ver = rpm.expand('%2')local ext = rpm.expand('%3')local url = rpm.expand('%__pypi_url')\-- If no first argument, try %srcname, then %pypi_name, then %name-- Note that rpm leaves macros unchanged if they are not defined.if src == '%1' thensrc = rpm.expand('%srcname')endif src == '%srcname' thensrc = rpm.expand('%pypi_name')endif src == '%pypi_name' thensrc = rpm.expand('%name')end\-- If no second argument, use %versionif ver == '%2' thenver = rpm.expand('%version')end\-- If no third argument, use the preset default extensionif ext == '%3' thenext = rpm.expand('%__pypi_default_extension')end\local first = string.sub(src, 1, 1)\print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)}