rpmlint-mini/rpmlint-mini.spec

158 lines
6.1 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package rpmlint-mini
#
# Copyright (c) 2024 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.11 layout.
%define python_flavor python311
%define my_python %{expand:%{__%{python_flavor}}}
Name: rpmlint-mini
Version: %(rpm -q rpmlint --qf '%%{VERSION}')
Release: 0
Summary: RPM file correctness checker
Accepting request 661564 from home:matwey:construct:2.9 - Add imp and pickle to rpmlint-deps.txt they are required by python-construct=2.9 which is required by python-pybeam=0.5 - python is 3.7, so update rpmlint-deps.txt (use ? instead of minor version) - rpmlint-deps.txt: Follow changes from rpm and copy _rpm*.so instead of _rpm.so (the name is newly extended with .cpython). - set locale to C.utf8 to avoid non-ascii warnings - Update descriptions. Use better-performing find invocations. - don't include a copy of libmagic (bsc#976406) - Use wildcard for sysconfigdata architecture in rpmlint-deps.txt - Use wildcard for abi in rpmlint-deps.txt, e.g. armv7hl is gnueabihf - also import ElementTree - include pybeam also for lib64 architectures - rebuild against rpmlint 1.10 drops: rpmlint-deps.patch - Switch to Python 3.x - Add rpmlint-deps.patch: Revert 'Adapt rpmlint-deps.txt for python-construct >= 2.8' for Leap 42.x - buildignore ourselves to allow better bootstrapping. - Adapt rpmlint-deps.txt for python-construct >= 2.8 - Configure appdata_checker: pass --nonet in plus: as OBS has no internet access, every appdata file containing screenshots would be marked as 'failed' otherwise. - update desktop-file-utils to 0.23: + Accept version 1.1 desktop files. + Add Cinnamon, EDE and LXQt to the list of registered desktop environments (fdo#73497, fdo#56353, fdo#79561). + Allow multipart/related MIME type; it's used for MHTML (fdo#93376). + Ensure DBusActivatable filenames conform to reverse-DNS notation (fdo#66904). + Downgrade trailing semicolons to optional (fdo#76902). + Fix buffer over-read (fdo#94303). - Also copy magic and magic.mgc to /opt/testing to have the correct magic files for the used libmagic around. Use the environment variable MAGIC to hel the wrapper to to find the magic file for its libmagic (boo#976406) - raise version to 1.8 - add lib-dynload/unicodedata.so required by rpmlint 1.6 - package dependencies of ErlangCheck.py: - python-pybeam - python-construct - python-six note, that ErlangCheck.py is not enabled by default - repackage libedit0 dependency of dash - dash is in /usr/bin now - no longer install rpmgroups.config - update to desktop-file-validate 0.22: - add DBusActivatable key to allowed keys - warn about OnlyShowIn in Action groups - allow validating multiple desktop files - improve help output - update man page - update to desktop-file-validate 0.21: - update to current version of menu specification (Vincent): - only print hint if no main category is present, not an error - make Science a main category - add new registered categories: Adult, Feed, Humanities, Maps, Shooter, Spirituality, XFCE - update related categories - add TDE to list of registered OnlyShowIn - accept and validate GNOME3/GSettings for AutostartCondition (Vincent) - output hint if more than one main category is present (Vincent) - output hint about suggested related categories (Vincent) - fix build against python 2.7.5 - bump version to 1.4 - fix build by passing rpmlint :) - let it require cpio - the same as with rpmlint - update to desktop-file-validate 0.20 (bnc#779850): - add MATE and Razor to list of registered environments (Vincent) - validate Desktop Actions (Giovanni Campagna, Vincent) - add documentation - update desktop-file-validate to 0.19: - add Unity to list of registered environments - deal with various zz-application/zz-winassoc-XXX mime types - mark all zz-application/* MIME types as aliases - add support for updated Keywords key - accept x-scheme-handler/* mime types - install licenses.config - add the new abuild build path to the search dir list - bump version to 1.3 (matching rpmlint update) - fix magic detection after the file update to 5.07 - bump version to 1.2 (matching rpmlint update) - include pie.config - allow adding configs via RPMLINT_MINI_CONFIG - add missing deps - bump version to 1.1 (matching rpmlint update) - rlwarn was renamed to warn - fix lib requirements of libglib - bump version to 1.0 (match rpmlint update) - bump version to 0.99 (match rpmlint update) - buildrequire glib2-devel-static (new package split) - fix build against autoconf 2.67 + update to desktop-file-utils 0.17: - accept chemical/* mime types as valid types - make icon names with an extension for Icon key a non-fatal error - check that a main category is included in the Categories - check that categories required by another one are present - do not always show warnings about KDE specific uses - check that the Comment does not look like the Name and the GenericName - display error about multiple keys with the same name earlier - improve MIME type check to make sure that the MIME types are valid - add LXDE in the list of registered OnlyShowIn values - add "warning" to error strings to make them easily greppable - handle AutostartCondition key, as proposed for the autostart specification and used in GNOME - accept empty Categories key as valid - make new errors non-fatal to give some time to maintainers to fix their .desktop file after a release of desktop-file-utils - plug leak - code cleanups - fix build against python 2.7 - add string_escape to dependencies, needed by checkbashisms - include dash and checkbashisms needed by BashismsCheck - update dependency list for rpmlint 0.95 / rpm 4.8.0 - fix polkit check - configure CheckPolkitPrivs - remove error prone package-rpmlintrc.diff. Instead have rpmlint execute a file via standard means which in turn reads custom configs - add rpmgroups.config - include python-magic to fix e.g. the 'no-binary' check (bnc#539042) - fix build with rpmlint 0.90 - fix build with rpmlint 0.87 - include StringIO.pyo, needed by xml module used by the dbus policy check to print useful errors - - add python-xml parts needed for PolicyKit checks - fix dependencies of python again (bnc#430381) - add self check to avoid breakage in future - next try to get a working rpmlint again - fix build again - fix build for python 2.6 - support even OBS style of building - Fix syntax error. - ignore warnings in the test package - update desktop-file-validate to 0.14 * for changelog, see desktop-file-utils package - update to (also) build rpmlint 0.82 - add missing utf8 module (#343642) - update to (also) build rpmlint 0.81 - update desktop-file-validate to 0.14 - refresh patches - update desktop-file-validate to 0.13 - fix build for lib64 archs - add static copy of desktop-file-validate to fix the rpmlint check for desktop files - remove source files to reduce size - read $RPM_SOURCE_DIR/%{name}-%{version}-rpmlintrc as well - read $RPM_SOURCE_DIR/rpmlintrc as well to allow package specific overrides - Initial package OBS-URL: https://build.opensuse.org/request/show/661564 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint-mini?expand=0&rev=98
2018-12-27 10:25:37 +01:00
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
%build
%meson
%meson_build
%install
# Check that rpmlint works at all, with the primary flavor
set +e
%{_bindir}/rpmlint -i rpmlint
test $? -gt 0 -a $? -lt 60 && exit 1
set -e
# Check that we have all required python modules in the target flavor
for p in $(rpm -q --requires rpmlint | grep '^python3-'); do
rpm -q --whatprovides ${p/python3-/%{python_flavor}-}
done
# Build a virtual env
%my_python -m venv %{buildroot}/opt/testing --without-pip --copies
# We don't need activation
rm %{buildroot}/opt/testing/bin/activate*
# We need these available
cp -a %{_vpath_builddir}/src/desktop-file-validate %{buildroot}/opt/testing/bin
cp -a %{_bindir}/dash %{_bindir}/checkbashisms %{buildroot}/opt/testing/bin
cp -a %{_libdir}/libedit.so.0* %{buildroot}/opt/testing/lib
# Install config files
install -d -m 755 %{buildroot}/opt/testing/share
cp -a %{_sysconfdir}/xdg/rpmlint %{buildroot}/opt/testing/share
# Override configs are selectively taken from rpmlint-strict
rm -f %{buildroot}/opt/testing/share/rpmlint/*.override.toml
# Python standard library, rpmlint dependencies, and the interpreter
pushd %{_libdir}/python%{python_version}
for file in $(cat %{SOURCE1}); do
exp=$(ls -1 $file)
install -D -m 644 $exp %{buildroot}/opt/testing/lib/python%{python_version}/$exp
done
popd
ldd %{python_sitearch}/rpm/*.so | while read L T R A
do
# skip libc/libm, they must match the system ld.so (which we cannot replace)
case $L in lib[cm].*) continue;; esac
cp '-aLt%{buildroot}/opt/testing/lib' "${R}" || # is it a virtual library?
! <"${R}" || # it is a real library and still could not be copied
false # this is necessary to really fail
done
cp -a %{python_sitearch}/{rpm,zstandard}* \
%{buildroot}/opt/testing/lib/python%{python_version}/site-packages
cp -a %{python_sitelib} %{buildroot}/opt/testing/lib/python%{python_version}
cp -a %{python3_sitelib}/rpmlint* %{buildroot}/opt/testing/lib/python%{python_version}
cp -a %{_libdir}/libpython%{python_version}*.so.* %{buildroot}/opt/testing/lib
cp -a %{_libdir}/libexpat*.so.* %{buildroot}/opt/testing/lib
cp -a %{_libdir}/libmpdec*.so.* %{buildroot}/opt/testing/lib || echo "Skipping libmpdec.so"
pushd %{buildroot}/opt/testing/lib/python%{python_version}/
rm -r site-packages/meson*
for f in $(find -name \*.py | sort) ; do
PYTHONOPTIMIZE=1 %{my_python} -O -m compileall -b $f
rm $f
done
popd
find %{buildroot}/opt/testing/ -name __pycache__ -exec rm -rf {} +
# Change the script-interpreter line to use our custom python venv in /opt/testing
sed -e '1s,#!.*python.*,#!/opt/testing/bin/python3,' %{_bindir}/rpmlint > %{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