I've been working off and on for the last few weeks on a script for generating a spec file for Perl modules from CPAN. The current version is here:
http://www.silug.org/~steve/software/scripts/perl/cpanspec
I started noticing that source rpms generated by cpanflute2 needed a lot of very redundant cleanup, although they would almost always build. This script goes for the opposite approach. The spec file generated is meant to be clean and correct (suitable for submitting to fedora.us), since fixing build problems is usually fairly trivial.
This script currently does the following:
* Gets the name and version from the tar file name. (This probably works for 99% of the modules on CPAN, but there are a few notable exceptions.) * Parses any README files for something suitable for %description. (I have a plan to make the guesses a bit better, but the current code works on a lot of modules.) * Guesses at what files should be included as %doc. * Gets BuildRequires from PREREQ_PM in Makefile.PL. * Sets URL and Source0 to actual (probably correct) URLs.
And there's probably other things I'm forgetting. :-)
Of course, the idea is to eventually either migrate these features into cpanflute2 or obsolete it by moving its features into this script. (I don't really care either way.)
To run the script, just provide the path to one or more tar files from CPAN on the command line. I haven't implemented any usage message (yet), so if you don't give it a list, it just won't do anything.
This message is all of the documentation that exists at the moment, but if anyone other than me finds it useful, I'll fix that. :-)
Steve