English version

There has been a bunch of new R review submitted to the redhat Bugzilla lately and I have been doing some.

R is easy to package (R2spec being of some help on that) and quite boring to review. The package needs to follow the guidelines but after that besides the license, potential warning at build time and the dependencies there isn't much to check.

So in order to make my life easier I have written a small script that automates a number of steps for me.

There is what it does from a srpm:

  • check for the latest version
  • download the src.rpm
  • install the src.rpm
  • download sources
  • sha1sum of the sources
  • sha1sum of the sources from src.rpm
  • check that R-core is in the Requires line
  • check that R-devel is in the BuildRequires line
  • check that tex(latex) is in the BuildRequires line
  • check that %dir */R/library/%{packname} is present
  • check that %doc concerns at least doc, html, DESCRIPTION, NEWS and print the other
  • check the %install
  • check that there is coherence between noarch and datadir
  • check that there is not both datadir and libdir in a spec
  • build locally the rpm and run rpmlint on them
  • start a build on koji for the src.rpm

This output looks like this:

$ python Scripts/R-autoreview.py -s R-caTools-1.10-2.fc12.src.rpm * Latest version packaged
Target is already in the folder, no need to re-download it 
e9f393dbfe3928448ccdc40dd011987d73acce9b  caTools_1.10.tar.gz
e9f393dbfe3928448ccdc40dd011987d73acce9b  /home/pierrey/rpmbuild/SOURCES/caTools_1.10.tar.gz
* sha1sum are equals
* All required Requires are present
! R-core is present more than once
* All required BuildRequires are present
* There is 1 %dir
  %dir is OK
* There is 2 %doc
  %doc is OK
* The rpm installed in _libdir
* The rpm seems to have the required element in %install
* The rpm uses %{_libdir} and is arch
rpmbuild -ba /home/pierrey/rpmbuild/SPECS/R-caTools.spec > R-caTools.spec-build.log 2>&1 
* Build properly under 2.6.33.3-85.fc13.x86_64
* rpmlint:
R-caTools.src: W: spelling-error %description -l en_US cumsum -> cum sum, cum-sum, cums um
R-caTools.x86_64: W: spelling-error %description -l en_US cumsum -> cum sum, cum-sum, cums um
3 packages and 0 specfiles checked; 0 errors, 2 warnings. 
Scratch build on koji for target f14
* Koji build: http://koji.fedoraproject.org/koji/taskinfo?taskID=2184735
  0 free  0 open  3 done  0 failed
  2184735 build (dist-f14, R-caTools-1.10-2.fc12.src.rpm) completed successfully
   TODO:
* Check the sources for license
* Check the build, log for Warning & co

This script is available at: http://pingou.fedorapeople.org/R-autoreview.py