Sunday 5 February 2012

RPM Writing continued

Continuing on from my last post "RPM Writing", I will be be taking the RPM that was successfully built and testing it with rpmlint command. This command should check for common errors in the spec file,binary RPM and source RPM.

rpmlint on the spec file

[root@timeline ~]# rpmlint -i rpmbuild/SPECS/gnuchess.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.

rpmlint on the binary RPM

[root@timeline ~]# rpmlint -i rpmbuild/SRPMS/gnuchess-6.0.1-1.fc16.src.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

rpmlint on the source RPM

[root@timeline ~]# rpmlint rpmbuild/RPMS/x86_64/gnuchess-6.0.1-1.fc16.x86_64.rpm
gnuchess.x86_64: W: incoherent-version-in-changelog Nguyen ['6.0.1-1.fc16', '6.0.1-1']
gnuchess.x86_64: E: info-files-without-install-info-postin /usr/share/info/gnuchess.info.gz
gnuchess.x86_64: E: info-files-without-install-info-postun /usr/share/info/gnuchess.info.gz
gnuchess.x86_64: W: file-not-utf8 /usr/share/info/gnuchess.info.gz
gnuchess.x86_64: E: info-dir-file /usr/share/info/dir
gnuchess.x86_64: E: info-files-without-install-info-postin /usr/share/info/dir
gnuchess.x86_64: E: info-files-without-install-info-postun /usr/share/info/dir
gnuchess.x86_64: W: no-manual-page-for-binary gnuchessu
gnuchess.x86_64: W: no-manual-page-for-binary gnuchess
gnuchess.x86_64: W: no-manual-page-for-binary gnuchessx
1 packages and 0 specfiles checked; 5 errors, 5 warnings.

After running rpmlint to check for errors in the spec file, binary rpm and source rpm we are able to see what was checked, errors and warnings. There were no errors for gnuchess.spec and gnuchess-6.0.1-1.fc16.src.rpm but there were errors and warnings returned for gnuchess-6.0.1-1.fc16.src.rpm. Now that we know that which file has errors we will need to address them in order to have the rpm conform to rpm guidelines.

We can run the same rpmlint command with -i option to show informative message and additional explanations to the reported message

[root@timeline ~]# rpmlint -i rpmbuild/RPMS/x86_64/gnuchess-6.0.1-1.fc16.x86_64.rpm
gnuchess.x86_64: W: incoherent-version-in-changelog Nguyen ['6.0.1-1.fc16', '6.0.1-1']
The latest entry in %changelog contains a version identifier that is not
coherent with the epoch:version-release tuple of the package.

gnuchess.x86_64: E: info-files-without-install-info-postin /usr/share/info/gnuchess.info.gz
This package contains info files and provides no %post scriptlet containing a
call to install-info.

gnuchess.x86_64: E: info-files-without-install-info-postun /usr/share/info/gnuchess.info.gz
This package contains info files and provides no %postun scriptlet containing
a call to install-info.

gnuchess.x86_64: W: file-not-utf8 /usr/share/info/gnuchess.info.gz
The character encoding of this file is not UTF-8.  Consider converting it in
the specfile's %prep section for example using iconv(1).

gnuchess.x86_64: E: info-dir-file /usr/share/info/dir
You have /usr/info/dir or /usr/share/info/dir in your package. It will cause
conflicts with other packages and thus is not allowed. Please remove it and
rebuild your package.

gnuchess.x86_64: E: info-files-without-install-info-postin /usr/share/info/dir
This package contains info files and provides no %post scriptlet containing a
call to install-info.

gnuchess.x86_64: E: info-files-without-install-info-postun /usr/share/info/dir
This package contains info files and provides no %postun scriptlet containing
a call to install-info.

gnuchess.x86_64: W: no-manual-page-for-binary gnuchessu
Each executable in standard binary directories should have a man page.

gnuchess.x86_64: W: no-manual-page-for-binary gnuchess
Each executable in standard binary directories should have a man page.

gnuchess.x86_64: W: no-manual-page-for-binary gnuchessx
Each executable in standard binary directories should have a man page.

1 packages and 0 specfiles checked; 5 errors, 5 warnings.
[root@timeline ~]#

I find that using the -i option with rpmlint is very helpful as it helps make the errors more human readable so that you can know where to look in order to fix the errors. I found that this site list most of the errors I have which are common so I am able to edit my spec file and make the changes.
common Rpmlint issues - Fedora Project

[root@timeline ~]# rpmlint rpmbuild/RPMS/x86_64/gnuchess-6.0.1-1.fc16.x86_64.rpm
gnuchess.x86_64: E: standard-dir-owned-by-package /usr/share/info
gnuchess.x86_64: W: file-not-utf8 /usr/share/info/gnuchess.info.gz
gnuchess.x86_64: E: info-dir-file /usr/share/info/dir
gnuchess.x86_64: W: no-manual-page-for-binary gnuchessu
gnuchess.x86_64: W: no-manual-page-for-binary gnuchess
gnuchess.x86_64: W: no-manual-page-for-binary gnuchessx
1 packages and 0 specfiles checked; 2 errors, 4 warnings.

Currently still working on trying to address the binary RPM errors as its stands at 2 errors and 4 warnings. Will update this post shortly once they are resolved.

My spec file, RPM and SRPM can be  downloaded from these links I have posted.
gnuchess.spec
gnuchess-6.0.1-1.fc16.x86_64.rpm
gnuchess-6.0.1-1.fc16.src.rpm

No comments:

Post a Comment