otherwise spec file cannot be parsed and users are getting this odd
error:
python-ogr.spec: E: specfile-error rpm: /usr/bin/rpmspec: No such file
or directory
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Linters and test coverage makes sense in upstream CI, but not that much in Fedora.
This makes testing rpmlint with newer Python releases easier.
It also partially unblocks the Python 3.10 rebuild.
Before:
$ rpmlint python-setuptools.spec
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58: %endif # with tests
python-setuptools.spec: E: specfile-error
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67: %endif # without bootstrap
python-setuptools.spec: E: specfile-error
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181: %endif # with tests
0 packages and 1 specfiles checked; 5 errors, 0 warnings.
After:
$ rpmlint python-setuptools.spec
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58: %endif # with tests
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67: %endif # without bootstrap
python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181: %endif # with tests
0 packages and 1 specfiles checked; 3 errors, 0 warnings.
The rpmlint build process byte compiles these, so no manual byte
compilation is needed. (The make definition COMPILE_PYC has been used
since 83a9a35 (2009-11-02). Prior to that a patch was applied to byte
compile in %build.)
On installs where documentation or additional languages are not
installed, rpmlint fails while attempting to iterate over the file list.
The files are only opened for their 'magic numbers' which is used in a
few tests in BinariesCheck and SourceCheck.
Fedora container images sets nodocs and '%_install_langs en_US' (which
causes locale files not to be installed). Running rpmlint in such a
container results in a traceback when rpmlint attempts to check the
packages files.
Backport patch from upstream to fix the issue.
Resolves: https://bugzilla.redhat.com/1574509
Source: https://github.com/rpm-software-management/rpmlint/commit/d59bc2a