RHEL does not include dash or checkbashisms, which are only used for one
specific linter, nor pytest-xdist used in the tests. Also, limit
Fedora-specific configuration to Fedora builds.
Apply upstream commit 7d707f7f (TagsCheck: handle license exception in
grouping, 2023-03-03)¹.
Use git to apply patches in %autosetup, it handles binary diffs, such as
the one we're adding here which adds an rpm file to the test suite.
¹ https://github.com/rpm-software-management/rpmlint/commit/7d707f7f
Upstream glibc removed the .hash section after a long deprecation
period. Unfortunately, the deprecation was not widely known and caused
issues for some proprietary software. This has led to the .hash section
being added to glibc again (at least temporarily), but many/most of the
packages in Fedora have been built with only the .gnu.hash section.
Producing an error for all of these packages is counter-productive, as
the packagers building them have little control over this area. Ignore
the error by default.
Resolves: #2132969
Apply upstream patch to fix regression in no-manual-page-for-binary
check.
Convert to %autosetup as well; adding %patch lines manually is a hassle.
Resolves: #2132936
Several filter expressions for `*-debuginfo` and `*-debugsource`
packages had leading space which prevented them from matching as
intended. Remove those spaces.
Ignore no-binary error for `*-debugsource` and `*-devel` packages.
Neither should be required to contain binaries or be noarch.
Remove unnecessary `no-cleaning-of-buildroot` and `files-attr-not-set`
filters. These are no longer present upstream. The buildroot check was
removed in b1a8a422 (Remove obsolete check no-cleaning-of-buildroot,
2022-06-22), released in rpmlint-2.4.0. The file attr check was removed
in 221ce4b2 (remove files-attr-not-set check, 2015-05-19), released in
rpmlint-1.9.
Replace manual BuildRequires with automatic python build-dependency
generator. This also requires replacing %py3_build/%py3_install with
the more modern %pyproject_wheel/%pyproject_install macros.
Make use of %pyproject_save_files and %pyproject_files in the process,
to ensure we keep up with any future changes in the python deployment
process.
Note that %pyproject_save_files includes `%license COPYING` so we don't
need to list it separately.
Make test dependencies conditional on `--with tests` (which is the
default).
While here, re-order the BuildRequires and Requires sections.
The spec file has seen tabs versus spaces fixes a number of times now.
In 096bf89 (2.0.0, 2021-06-03), the spec file was rewritten and all
spaces were replaced with tabs in the tags. Previous fixes included:
- dbfdbf0 (Fix mixed-use-of-spaces-and-tabs warning (in this spec
file), 2018-06-17)
- c74c9bf (Fix mixed-use-of-spaces-and-tabs warning, 2018-05-03)
- 85118ac (... Keep consistent between spaces and tabs, 2005-03-04)
Replace tabs once again as they are not commonly used in spec files and
lead to rpmlint warnings. If we cannot avoid such warnings here, it's a
bit silly to expect others to do so.
We BR the test dependencies unconditionally. Run the tests as well.
Avoid warnings about pytest.mark.no_cover marker; we disable disable
coverage entirely.
Sync the fedora.toml and users-groups.toml configs from upstream.
Change the zstd dependency to zstandard, following upstream 463bef3f
(Use different Python package for ZStandard, 2022-01-03).
Adjust python-magic dependency to file-magic. We already BR file-magic for
the test suite. This ensures we install what we tested and avoids the
problem of python3-file-magic conflicting and obsoleting python3-magic
without providing the same python-dist values¹.
¹ https://bugzilla.redhat.com/1899279
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.