cpan2rpm - A Perl module packager

RPM packages are easy to install and manage, Perl modules are useful and do all sorts of things. Now you can have both with minimal effort: cpan2rpm makes that possible by incorporating a lot of know-how about package building into a simple and powerful interface. Download our software (see the man page) or build a package right from this page!

Now see our FAQ!


Getting the software

You can download cpan2rpm from our ftp site in the formats listed below.

tarball cpan2rpm-2.028.tar.gz
binary RPM cpan2rpm-2.028-1.noarch.rpm
source RPM cpan2rpm-2.028-1.src.rpm

Additionally, the software is available from CPAN as well as from SourceForge.

You may also want the HTTP::Lite module (in case you don't have LWP installed) which allows cpan2rpm to automatically download modules.

binary RPM perl-HTTP-Lite-1.0.0-1.i386.rpm
source RPM perl-HTTP-Lite-1.0.0-1.src.rpm

Finally, the latest-and-greatest, currently unreleased version of the script may be downloaded via HTTP. Just overwrite previous version with it or save to a different location!


Verifying the packages

Our RPMs are GPG signed. To verify signatures, download our GPG public key into a file (e.g. /tmp/arix.gpg.asc), add it to your keyring and verify the fingerprint like this:
# rpm --import /tmp/arix.gpg.asc
# gpg --fingerprint cpan2rpm@arix.com
Our key's fingerprint is:

AC3A 2FC6 2515 2299 C251 4DC3 4998 8435 DE77 0456.

Next you can verify the embedded signatures on our packages like this:

# rpm --checksig cpan2rpm-X.XX-X.noarch.rpm 
cpan2rpm-X.XX-X.noarch.rpm: (sha1) dsa sha1 md5 gpg OK>
Note that the text gpg OK should be present in the command's output. Additionally,
# rpm -qip cpan2rpm-x.xx-xx.noarch.rpm |grep -i signature
should display something similar to the line below, where the key id matches the imported key in your GPG keyring.
Signature   : DSA/SHA1, Mon 20 Jun 2005 10:41:39 PM PDT, Key ID 49988435de770456

Installing cpan2rpm

Once you've downloaded the RPM install it with the following command:
# rpm -Uvh cpan2rpm-x.xx-x.noarch.rpm
Alternatively you can simply supply rpm with a url, like this:
# rpm -Uvh ftp://arix.com/cpan2rpm-x.xx-x.noarch.rpm
Our binaries are architecture independent but generated on an i386 platform running perl 5.8.0 - if you run a different version of Perl, you'll need to recompile on your platform; fortunately that is easy, either get the source RPM and:
# rpm --rebuild cpan2rpm-x.xx-x.src.rpm
...or get the tarball and:
# rpmbuild -ta cpan2rpm-x.xx.tar.gz
after which the resulting package will be located at /usr/src/redhat/RPMS/<your-platform-here> (or wherever your ~/.rpmmacros may indicate).

Prebuilt packages

We offer a large number of packages prebuilt. These are built for Perl 5.8.0 (some of the older packages may be built for 5.6.0) but we provide the .src so you can rebuild if you need to (see instructions above). The directory of built packages is available via ftp at:
    ftp://arix.com/c2r/RPMS/

Frequently Asked Questions

Q: XML::SAX::Expat won't build, reporting:
Appending installation info to /var/tmp/perl-XML-SAX-Expat-0.37-rbos/usr/lib/perl5/5.8.0/i586-linux-thread-multi/perllocal.pod Can't locate XML/SAX/Expat.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i586-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /usr/lib/perl5/site_perl/5.8.0/XML/SAX.pm line 147. make: *** [install_sax_expat] Error 2 Bad exit status from /var/tmp/rpm-tmp.91049 (%install)

A: Courtesy of Richard Bos, the problem owes to the fact that the module needs to perform some steps in what would be the %post section of a spec-file. Since tarballs do not support this concept, the steps are currently performed under the %install section. The solution is two-fold:

  1. Edit the Makefile.PL to remove the following code:
    ## add ourselves to the list of installed parsers
    sub MY::install {
        package MY;
        my $script = shift->SUPER::install(@_);
        $script =~ s/install :: (.*)$/install :: $1 install_sax_expat/m;
        $script .= <<"INSTALL";
    
    install_sax_expat :
    \t\@\$(PERL) -MXML::SAX -e 
    "XML::SAX->add_parser(q(XML::SAX::Expat))->save_parsers()"
    
    INSTALL
    
        return $script;
    }
    
  2. Add the following code to the %post section of the specfile:
    %{__perl} -MXML::SAX -e "
        XML::SAX->add_parser(q(XML::SAX::Expat))->save_parsers()
        "
    
Q: The packages I generate aren't getting GPG signed!

A: Until version 2.021, cpan2rpm would incorrectly set up the ~/.rpmmacros file to include the definition %_gpg /usr/bin/gpg. Apparently, the documentation has as far back as RPM 2.0 stated that the macro should be named %_gpgbin.
To fix the problem, edit the macros file and replace the name of that definition (or, as of RPM 4.0, if GPG lives in the default directory, you may simply remove the macro definition).


Building packages - a web interface

You can now build your own packages right from this page! Simply enter the package name you wish to build (or a URL to the tarball) and select the type of file you want (or check out the output directory) for your package. For full syntax see the man page.

Pakage name:
e.g. Proc::Daemon, http://.../Proc-Daemon-0.03.tar.gz
Arguments:
e.g. --author="Zod <z@o.d>"
Give me the: binary source rpm spec file

Note: Certain packages cannot be built without first installing others. If you cannot build a particular package for that reason, just e-mail me and I'll install the dependencies for you.


- HOSTED ON -
SourceForge.net Logo