Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
bc98f14c5d | |
|
82dab56696 | |
|
a299eaadad | |
|
910a7dfd4d |
|
@ -71,3 +71,7 @@
|
||||||
print(" not recognized.")
|
print(" not recognized.")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%python_enable_dependency_generator() \
|
||||||
|
%global __python_requires %{_rpmconfigdir}/pythondistdeps.py --requires \
|
||||||
|
%{nil}
|
||||||
|
|
|
@ -61,3 +61,47 @@
|
||||||
end\
|
end\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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' then
|
||||||
|
src = rpm.expand('%srcname')
|
||||||
|
end
|
||||||
|
if src == '%srcname' then
|
||||||
|
src = rpm.expand('%pypi_name')
|
||||||
|
end
|
||||||
|
if src == '%pypi_name' then
|
||||||
|
src = rpm.expand('%name')
|
||||||
|
end
|
||||||
|
\
|
||||||
|
-- If no second argument, use %version
|
||||||
|
if ver == '%2' then
|
||||||
|
ver = rpm.expand('%version')
|
||||||
|
end
|
||||||
|
\
|
||||||
|
-- If no third argument, use the preset default extension
|
||||||
|
if ext == '%3' then
|
||||||
|
ext = rpm.expand('%__pypi_default_extension')
|
||||||
|
end
|
||||||
|
\
|
||||||
|
local first = string.sub(src, 1, 1)
|
||||||
|
\
|
||||||
|
print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
||||||
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
|
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
|
||||||
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
|
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
|
||||||
|
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
|
||||||
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
|
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
|
||||||
|
|
||||||
%py3_shbang_opts -s
|
%py3_shbang_opts -s
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Name: python-rpm-macros
|
Name: python-rpm-macros
|
||||||
Version: 3
|
Version: 3
|
||||||
Release: 23%{?dist}
|
Release: 26%{?dist}
|
||||||
Summary: The unversioned Python RPM macros
|
Summary: The unversioned Python RPM macros
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
|
@ -77,8 +77,16 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \
|
||||||
%files -n platform-python-rpm-macros
|
%files -n platform-python-rpm-macros
|
||||||
%{rpmmacrodir}/macros.platform-python
|
%{rpmmacrodir}/macros.platform-python
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jul 09 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3-26
|
||||||
|
- Backport %%python3_platform macro.
|
||||||
|
|
||||||
|
* Mon Jun 18 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3-25
|
||||||
|
- Add %%pypi_source macro.
|
||||||
|
|
||||||
|
* Fri Jan 19 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-24
|
||||||
|
- Add %%python_enable_dependency_generator
|
||||||
|
|
||||||
* Thu Oct 26 2017 Ville Skyttä <ville.skytta@iki.fi> - 3-23
|
* Thu Oct 26 2017 Ville Skyttä <ville.skytta@iki.fi> - 3-23
|
||||||
- Use -Es/-I to invoke macro scriptlets (#1506355)
|
- Use -Es/-I to invoke macro scriptlets (#1506355)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue