diff --git a/macros.pybytecompile b/macros.pybytecompile index 7bd555b..b58fff4 100644 --- a/macros.pybytecompile +++ b/macros.pybytecompile @@ -4,13 +4,13 @@ # Which unfortunately makes the definition more complicated than it should be # Usage: -# %py_byte_compile +# %%py_byte_compile # Example: -# %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/ +# %%py_byte_compile %%{__python3} %%{buildroot}%%{_datadir}/spam/plugins/ # This will terminate build on SyntaxErrors, if you want to avoid that, # use it in a subshell like this: -# (%{py_byte_compile }) || : +# (%%{py_byte_compile }) || : # Setting PYTHONHASHSEED=0 disables Python hash seed randomization # This should help with byte-compilation reproducibility: https://bugzilla.redhat.com/show_bug.cgi?id=1686078 diff --git a/macros.python-srpm b/macros.python-srpm index efe2bba..4957492 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -47,7 +47,7 @@ # a specific version (e.g. 34 in Fedora EPEL7) %python3_pkgversion 3 -# Set to /bin/true to avoid %ifdefs and %{? in specfiles +# Set to /bin/true to avoid %%ifdefs and %%{? in specfiles %__python3_other /bin/true %py3_other_build /bin/true %py3_other_install /bin/true @@ -68,7 +68,7 @@ # Creates Python 2 dist tag(s) after converting names to canonical format # Needs to first put all arguments into a list, because invoking a different -# macro (%py_dist_name) overwrites them +# macro (%%py_dist_name) overwrites them %py2_dist() %{lua:\ args = {}\ arg = 1\ @@ -88,7 +88,7 @@ # Creates Python 3 dist tag(s) after converting names to canonical format # Needs to first put all arguments into a list, because invoking a different -# macro (%py_dist_name) overwrites them +# macro (%%py_dist_name) overwrites them %py3_dist() %{lua:\ python3_pkgversion = rpm.expand("%python3_pkgversion");\ args = {}\ @@ -110,12 +110,12 @@ # 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 with tildes stripped. +# 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 with tildes stripped. # 3: The file extension, defaulting to "tar.gz". (A period will be added # automatically.) -# Requires %__pypi_url and %__pypi_default_extension to be defined. +# Requires %%__pypi_url and %%__pypi_default_extension to be defined. %__pypi_url https://files.pythonhosted.org/packages/source/ %__pypi_default_extension tar.gz diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 2a5f6fa..55681ec 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -29,7 +29,7 @@ elseif posix.stat('macros.python-srpm') then end } Version: %{__default_python3_version} -Release: 37%{?dist} +Release: 38%{?dist} BuildArch: noarch @@ -88,6 +88,11 @@ mkdir -p %{buildroot}%{_rpmconfigdir}/redhat install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ +%check +# no macros in comments +! grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* + + %files %{rpmmacrodir}/macros.python %{rpmmacrodir}/macros.pybytecompile @@ -102,6 +107,10 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ %changelog +* Tue Apr 27 2021 Miro HronĨok - 3.9-38 +- Escape %% symbols in macro files comments +- Fixes: rhbz#1953910 + * Wed Apr 07 2021 Karolina Surma - 3.9-37 - Use sysconfig.get_path() to get %%python3_sitelib and %%python3_sitearch - Fixes: rhbz#1946972