openSUSE:Package Cleaning
spec-cleaner
spec-cleaner is a tool that cleans the RPM spec file according to the style guide. It can put the lines in the right order, transform hardcoded paths with the correct macros, replace old macros with new ones or remove code that is no longer needed or is outdated. And it can do much more.
It’s also very easy to use, just call
$ spec-cleaner -i mypackage.spec
for applying all changes inline directly to your spec file.
If you just want to watch the diff of the changes that spec-cleaner would make, call:
$ spec-cleaner -d mypackage.spec
rpmlint
Another tool that will help you keep your package in good shape is rpmlint. It checks common errors in RPM packages and specfiles. It can find file duplicates, check that binaries are in the proper location, keep an eye on correct libraries, systemd, tmpfiles packaging and much more. Inspecting your package from top to bottom, it reports any error or warning.
rpmlint runs automatically during the OBS build so it can fail the whole build if there are serious problems. It works as a tool for enforcing specific standards in packages built within OBS.
You can see the output of the tool after each local build when you use 'osc build'.
In OBS web UI you can see RPM Lint results next to the Build Results:
If you want to run it on your own, call:
$ rpmlint mypackage.rpm
Understanding rpmlint output
Each rpmlint check usually provides a description that can help to understand where the problem is. If you need more guidance, visit openSUSE:Packaging Checks page that provides more details and hints for almost every check.
Build Checks Statistics
openSUSE hosts a page rpmlint.opensuse.org that collects statistics about rpmlint errors and warnings currently reported in various repositories. This can be useful for example if you would like to volunteer and systematically help to reduce some common problems in openSUSE packages.
Reporting issues
Both spec-cleaner and rpmlint implement the new packaging changes and new rules as soon as possible. But it’s possible that maintainers may miss something. In that case, feel free to report it as an issue on their github.
See also
Related articles
External links