# # spec file for package rpmlint-mini # # Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # # This works regardless of the primary python3 flavor. The stdlib.txt and # install section depend on the python 3.10 layout. %define python_flavor python310 %define my_python %{expand:%{__%{python_flavor}}} Name: rpmlint-mini Version: %(rpm -q rpmlint --qf '%%{VERSION}') Release: 0 Summary: RPM file correctness checker License: GPL-2.0-or-later URL: https://github.com/rpm-software-management/rpmlint Source0: desktop-file-utils-0.26.tar.xz Source1: stdlib.txt Source2: rpmlint.wrapper Source3: rpmlint-mini.rpmlintrc # PATCH-FEATURE-OPENSUSE desktop-file-utils-suse-keys.patch vuntz@opensuse.org -- Handle SUSE-specific keys in validator. This is not strictly necessary, since they are prefixed with X-, but we can verify that the value has the right type. Patch0: desktop-file-utils-suse-keys.patch # PATCH-FIX-UPSTREAM -- SingleMainWindow is present in xdg-specs 1.5 and can be used by both GNOME and KDE Patch2: 0001-validate-support-SingleMainWindow-key-from-1.5.patch Patch3: 0002-validate-Support-version-1.5.patch # need to fetch the file from there BuildRequires: checkbashisms # the main package rpmlint's python3 runtime requirements do not necessarily match our target flavor BuildRequires: %{python_flavor}-base BuildRequires: %{python_flavor}-packaging BuildRequires: %{python_flavor}-pybeam BuildRequires: %{python_flavor}-pyenchant BuildRequires: %{python_flavor}-python-magic BuildRequires: %{python_flavor}-pyxdg BuildRequires: %{python_flavor}-rpm BuildRequires: %{python_flavor}-tomli BuildRequires: %{python_flavor}-tomli-w BuildRequires: %{python_flavor}-xml BuildRequires: %{python_flavor}-zstandard BuildRequires: dash BuildRequires: glib2-devel BuildRequires: glib2-devel-static BuildRequires: libedit-devel BuildRequires: libtool BuildRequires: meson BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: rpmlint >= 2 #!BuildIgnore: rpmlint-mini Requires: cpio Requires: polkit-default-privs %description rpmlint is a tool to check common errors on RPM packages. Binary and source packages can be checked. %prep %autosetup -p1 -n desktop-file-utils-0.26 %{buildroot}/opt/testing/bin/rpmlint.real chmod a+x %{buildroot}/opt/testing/bin/rpmlint.real rm -rf %{buildroot}/{usr,etc} install -m 755 -D %{SOURCE2} %{buildroot}/opt/testing/bin/rpmlint # We don't want requirements of libraries, or the odd shebang %define __requires_exclude (^lib.*|python3)$ # We don't want to provide any libraries, or Python modules we ship %define __provides_exclude ^(lib|python) %check # check rpmlint-mini with the custom flavor %meson_test sed -e 's|/opt|%{buildroot}/opt|' -e 's|exec|%my_python|' %{buildroot}/opt/testing/bin/rpmlint > myrpmlint chmod +x myrpmlint set +e sh -x myrpmlint -i rpmlint test $? -gt 0 -a $? -lt 60 && exit 1 set -e %files /opt/testing %license COPYING %changelog