From Fedora Project Wiki

Common Rpmlint Errors


Author: Parag Nemade

Revision: 0.3

Initial Draft: Thursday Jul 20, 2006

Last Revised: Saturday Jul 22, 2006


Rpmlint command


I suggest you to first use rpmlint command on SRPM as rpmlint -iv foo-1.0-1.src.rpm

Once you got silent output from rpmlint on source RPM then start building package. Now apply rpmlint on binary rpms as

rpmlint -iv foo-1.0-1.fc5.i386.rpm

For more information on rpmlint you can check man rpmlint also.

Common Errors and Warnings


This page contains various common errors reported by rpmlint command. I have collected following common rpmlint errors from various fedora extras reviews in Bugzilla.

no-binary


E: foo-package no-binary

The package should be of the noarch architecture because it doesn't contain any binaries.

Solution:- Then you can add to SPEC file BuildArchitectures: noarch

standard-dir-owned-by-package


E: foo-package standard-dir-owned-by-package /usr/share

This package owns a directory that is part of the standard hierarchy, which can lead to default directory permissions or ownerships being changed to something non-standard.

Solution:- You should not make Systems standard directory's to belong to your package.

non-conffile-in-etc


W: foo-package non-conffile-in-etc /etc/xdg/menus/applications-merged/foo-package.menu

A non-executable file in your package is being installed in /etc, but is not a configuration file. All non-executable files in /etc should be configuration files. Mark the file as %config in the spec file.

Solution:- under %files section you can add %config /etc/xdg/menus/applications-merged/foo-package.menu

summary-ended-with-dot


W: foo-package summary-ended-with-dot A content management system for foo package.

Summary ends with a dot.

Solution:- Remove period in Summary.

incoherent-version-in-changelog


W: foo-package incoherent-version-in-changelog 0.6.1-1 0.6.1-1..fc6

Your last entry in %changelog contains a version that is not coherent with the current version of your package.

Solution:- Check Last entry under changelog section for version and release tags in SPEC file.

script-without-shellbang


E: foo-package script-without-shellbang /var/www/foo-package/plugins/foo.php

This executable text file does not contain a shebang, thus it cannot be properly executed. Often this is a sign of spurious executable bits for a non-script file, but can also be a case of a missing shebang. To fix this error, find out which case of the above it is, and either remove the executable bits or add the shebang.

Solution:- You forgot to set executable bits on files reported by this error.

wrong-script-end-of-line-encoding


E: foo-package wrong-script-end-of-line-encoding /var/www/foo-package/plugins/foo.php

This script has wrong end-of-line encoding, usually caused by creation or modification on a non-Unix system. It will prevent its execution.

Solution:- Create files on Linux only. Don't create files on non-Unix environment and add it in package.

version-control-internal-file


E: foo-package version-control-internal-file /var/www/foo-package/CVS/Entries

You have included file(s) internally used by a version control system in the package. Move these files out of the package and rebuild it.

Solution:- CVS directories and anything under them should just be deleted.

zero-length


E: foo-package zero-length /var/www/foo-package/foo.js

Solution:- These shouldn't be included unless they're required for something.


description-line-too-long


E: foo-package description-line-too-long

Your description lines must not exceed %d characters. If a line is exceeding this number, cut it to fit in two lines.

Solution:- Make description lines each of max 80 characters.

non-standard-group


W: foo-package non-standard-group Networking/Other

The group specified in your spec file is not valid. To find a valid group, please refer to the distribution + RPM documentation.

Solution:- On FC5, Check /usr/share/doc/rpm-4.4.2/GROUPS for valid group names.

invalid-license


W: foo-package invalid-license GNU General Public License (GPL)

The license you specified is invalid. The valid licenses are:

-GPL                                    -LGPL
-Artistic                               -BSD
-MIT                                    -QPL
-MPL                                    -IBM Public License
-Apache License                         -PHP License
-Public Domain                          -Modified CNRI Open Source License
-zlib License                           -CVW License
-Ricoh Source Code Public License       -Python license
-Vovida Software License                -Sun Internet Standards Source License
-Intel Open Source License              -Jabber Open Source License

if the license is close to an existing one, you can use '<license> style'.

Solution:- License tag in your SPEC file must contains name of license given above.

non-coherent-filename


W: foo-package non-coherent-filename foo-package-0.99-0.Fedora.src.rpm

The file which contains the package should be named <NAME>-<VERSION>-<RELEASE>.<ARCH>.rpm.

Solution:- Your package name must be of form <NAME>-<VERSION>-<RELEASE>.<ARCH>.rpm

strange-permission


W: foo-package strange-permission foo-package.spec 0744

A file that you listed to include in your package has strange permissions. Usually, a file should have 0644 permissions.

Solution:- Change permissions on SPEC file.

hardcoded-library-path


E: foo-package hardcoded-library-path in %{buildroot}/usr/lib/menu/

A library path is hardcoded to one of the following paths: /lib, /usr/lib. It should be replaced by something like /%{_lib} or %{_libdir}.

Solution:- Don't hardcode path in SPEC rather use macros.

incoherent-init-script-name


incoherent-init-script-name

Solution:- The init script name should be the same as the package name in lower case.

no-default-runlevel


no-default-runlevel

Solution:- The default runlevel isn't specified in the init script. You need to add a line like the following one in the header of the init script:


2345 are the default runlevels. When installed, the package will be started on runlevel 2, 3, 4 and 5, and stopped for 1 and 6. 04 and 70 are starting order and stopping order. See InitscriptHowto for more information.

More Information on Rpmlint


You can directly see files installed by package rpmlint under [[file:///usr/share/rpmlint rpmlint] . There you will find various python files for different types of package checking e.g.

File Name		Purpose
AbstractCheck.py	Abstract class to hold all the derived classes.
BinariesCheck.py	check binary files in a binary rpm package.
Config.py		handle configuration options. To be used from config files.
DistributionCheck.py	check the Distribution specificities in a binary rpm package.
FHSCheck.py		check FHS conformity
FilesCheck.py 		test various aspects on files: locations, owner, groups,
Filter.py 		filter the output of rpmlint to allow exceptions.
I18NCheck.py 		checks i18n bugs.
Pkg.py 			provide an API to handle a rpm package either by accessing
rpmlint.py 		main entry point: process options, load the checks and run
SignatureCheck.py 	check the presence of a PGP signature.
SourceCheck.py 		verify source package correctness.
SpecCheck.py 		check the spec file of a source rpm.
TagsCheck.py 		Check a package to see if some rpm tags are present
ZipCheck.py 		Verify Zip/Jar file correctness


Links


For more detailed information of some common rpmlint errors refer to

CommonRpmlintIssues

Rpmlint RT