Development/Packaging/Tools/rpmlint

From Mandriva

Jump to: navigation, search
rpmlint

Image:rpmlint.png

Contents


[edit]

Description

rpmlint is a tool to check common errors on RPM packages. It is designed to check Mandriva Linux packages but it works with all RPM packages. SUSE and RedHat are also using it.

[edit]

New website

rpmlint has been moved to http://rpmlint.zarb.org/, please fill bug reports on the new website, unless they are Mandriva specific, in which case you should use Mandriva bugzilla.

[edit]

Configuration

You can configure rpmlint with the file ~/.rpmlintrc, or /etc/rpmlintrc. Mandriva build cluster is already configured. You should set at least the following:

from Config import *
setOption("Packager","[email protected]")
# default value
# setOption('Packager', 'Mandriva Linux Team <http://www.mandrivaexpert.com>|@mandriva.com|@mandriva.org')
addFilter("E: .* no-signature")
addFilter("W: .* invalid-packager")
addFilter("E: .* no-packager-tag")
addFilter("E: .*-debug .*")
addFilter("W: .*-debug .*")
# not very clean, but easier to maintain
release_tag = os.popen("rpm --eval '%mkrel 1'").readlines()[0][1:-1]
setOption('ReleaseExtension', release_tag)

For more options, look at the rpmlint documentation.

[edit]

Results

Many rpmlint errors are detailed in Packaging Problems. Results of the use of rpmlint against the distribution are detailed in Packaging Reports.

[edit]

Feature requests

Reported on Image:bug_small.png Bug #20976.

  • check qt3 path, currently rpmlint will produce an error if you specify correct path to qt3 ( %{_prefix}/lib/qt3 ), but it should rather produce an error if you specify it incorrectly (e.g. %{_libdir}/qt3 )
  • ensure that things won't get fscked if we build -debug package (e.g. don't use %summary macro later, don't add %{_libdir}/* to %files list etc.)
  • forbid using in %_remove_install_info macro in %postun since it's too late, it has to be called from %preun (since install-info relies on info file header)
  • check that packages don't contain files in /usr/include/X11
  • when providing versioned requires, packages should probably provide %{release} too, e.g. lib%{name}-devel = %{version}-%{release} , not just lib%{name}-devel = %{version}
  • when an install is an upgrade, check that directories like /usr/lib/doc/$packagename-$previousversion or perl-$previousversion are removed
  • ensure that %buildroot isn't touched in %pre, nor %build, e.g. rm -rf $RPM_BUILD_ROOT should be done in %install instead
  • since we now have a new %check stage, make test, make check, etc. should be done in this new stage, check for this
  • Requires(pre,post,etc.) won't work, do Requires(pre), Requires(post) etc. instead, check for this
  • spec files should be in utf-8, check for this
  • ensure that %mkrel get's used
Personal tools