rpmlint-mini/rpmlint-mini.spec

135 lines
5.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package rpmlint-mini
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
Name: rpmlint-mini
Version: 1.10
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
Group: System/Packages
Url: http://rpmlint.zarb.org/
Source: desktop-file-utils-0.24.tar.xz
Source100: rpmlint-deps.txt
Source101: rpmlint.wrapper
Source102: rpmlint-mini.config
Source103: polkit-default-privs.config
Source104: appdata_checker.config
Source1000: rpmlint-mini.rpmlintrc
# need to fetch the file from there
BuildRequires: checkbashisms
BuildRequires: dash
BuildRequires: glib2-devel
BuildRequires: glib2-devel-static
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: polkit-default-privs
BuildRequires: polkit-whitelisting
BuildRequires: rpmlint
#!BuildIgnore: rpmlint-mini
Requires: cpio
%description
rpmlint is a tool to check common errors on RPM packages. Binary and
source packages can be checked.
%prep
%setup -q -n desktop-file-utils-0.24
[[ -r COPYING ]]
%build
%configure
pushd src
make %{?_smp_mflags} desktop-file-validate V=1 DESKTOP_FILE_UTILS_LIBS="%{_libdir}/libglib-2.0.a -lpthread -lrt"
popd
%install
# test if the rpmlint works at all
set +e
%{_bindir}/rpmlint rpmlint
test $? -gt 0 -a $? -lt 60 && exit 1
set -e
# okay, lets put it together
mkdir -p %{buildroot}/opt/testing/share/rpmlint
install -m 755 -D src/desktop-file-validate %{buildroot}/opt/testing/bin/desktop-file-validate
cp -a %{_bindir}/dash %{_bindir}/checkbashisms %{buildroot}/opt/testing/bin
mkdir -p %{buildroot}/opt/testing/%{_lib}
cp -a %{_libdir}/libedit.so.0* %{buildroot}/opt/testing/%{_lib}
cp -a %{_datadir}/rpmlint/*.py %{buildroot}/opt/testing/share/rpmlint
# install config files
install -d -m 755 %{buildroot}/opt/testing/share/rpmlint/mini
for i in %{_sysconfdir}/rpmlint/{pie,licenses}.config "%{SOURCE103}" "%{SOURCE104}"; do
cp $i %{buildroot}/opt/testing/share/rpmlint/mini
done
install -m 644 -D %{_datadir}/rpmlint/config %{buildroot}/opt/testing/share/rpmlint/config
install -m 644 "%{SOURCE102}" %{buildroot}/opt/testing/share/rpmlint
# extra data
install -m 755 -d %{buildroot}/opt/testing/share/rpmlint/data
install -m 644 %{_sysconfdir}/polkit-default-privs.standard %{buildroot}/opt/testing/share/rpmlint/data
install -m 644 %{_sysconfdir}/polkit-rules-whitelist.json %{buildroot}/opt/testing/share/rpmlint/data
#
pushd %{_libdir}/python%{py3_ver}/
for f in $(<%{SOURCE100}); do
find -path "*/$f" -exec install -D {} %{buildroot}/opt/testing/%{_lib}/python%{py3_ver}/{} \;
done
# ErlangCheck dependencies that are not under %_libdir but under /usr/lib :-(
cp -a %{python3_sitelib}/{construct,pybeam,six.py} %{buildroot}/opt/testing/%{_lib}/python%{py3_ver}/site-packages
install -D %{_bindir}/python3 %{buildroot}/opt/testing/bin/python3
cp -a %{_libdir}/libpython%{py3_ver}m.so.* %{buildroot}/opt/testing/%{_lib}
cp -a %{_bindir}/rpmlint %{buildroot}/opt/testing/share/rpmlint/rpmlint.py
pushd %{buildroot}/opt/testing/share/rpmlint
PYTHONOPTIMIZE=1 python3 -O -m compileall -b *.py
rm *.py
popd
pushd %{buildroot}/opt/testing/%{_lib}/python%{py3_ver}/
PYTHONOPTIMIZE=1 find -name \*.py -exec python3 -O -m compileall -b {} \; -delete
popd
find %{buildroot}/opt/testing/ -name __pycache__ -print -exec rm -Rf {} +
rm -rf %{buildroot}/{usr,etc}
rm -f %{buildroot}/opt/testing/bin/rpmlint
install -m 755 -D %{SOURCE101} %{buildroot}/opt/testing/bin/rpmlint
# hackatlon
%define my_requires %{_builddir}/%{?buildsubdir}/%{name}-requires
cat << EOF > %{my_requires}
cat - > file.list
%{__find_requires} < file.list > requires.list
%{__find_provides} < file.list > provides.list
while read i; do
grep -F -v "\$i" requires.list > requires.list.new
mv requires.list.new requires.list
done < provides.list
cat requires.list
rm -f requires.list provides.list file.list
EOF
chmod +x %{my_requires}
%define _use_internal_dependency_generator 0
%define __find_requires %{my_requires}
%define __find_provides %{nil}
# final run check to detect python dep changes
LD_LIBRARY_PATH=%{buildroot}/opt/testing/%{_lib}
PYTHONPATH=%{buildroot}/opt/testing/share/rpmlint
PYTHONHOME=%{buildroot}/opt/testing/
export PYTHONPATH LD_LIBRARY_PATH PYTHONHOME
%{buildroot}/opt/testing/bin/python3 -tt -u -O %{buildroot}/opt/testing/share/rpmlint/rpmlint.pyc /.build.binaries/*.rpm 2>&1 || exit 1
echo ".. ok"
%files
/opt/testing
%license COPYING
%changelog