cpan2rpm: a perl module packager + YUM repo

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!


Loading...

Getting the software

You can grab cpan2rpm from CPAN or SourceForge, from our anonymous ftp server, or by clicking on the links below (HTTP transfers):

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

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

binary RPM perl-HTTP-Lite-2.1.6-1.noarch.rpm
source RPM perl-HTTP-Lite-2.1.6-1.src.rpm

Fedora Core users, may also install via the local YUM repository by typing into a terminal:

# yum -y install cpan2rpm
Finally, I've put the full source on github at https://github.com/ekkis/cpan2rpm so anyone can patch it. Grab what's there and overwrite your current version to make sure you've got the latest bug fixes.

Verifying the packages

Our RPMs are GPG signed. To verify signatures, download our GPG public key, add it to your keyrings and verify the fingerprint as shown below. Our GPG key id: A58D8D0B, fingerprint: 33AE EE83 84BB BA57 BD5E 533E F58C E9BE A58D 8D0B.
# cd /tmp
# wget ftp.arix.com/RPM-GPG-KEY
# gpg --import RPM-GPG-KEY
# rpm --import RPM-GPG-KEY
# gpg --fingerprint cpan2rpm@arix.com

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 d2fd5ae4ea0a41be

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.10.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 indicate).

Package repository

When you build a package online, the web page delivers your browser the binary for download. Additionally, however, the package (and its source package) becomes immediate available from our server via anonymous FTP.

As an added bonus, we make maintain a YUM repository from those builds. To add our repo to your system, grab the definition file as shown (Fedora users) below:

# wget -P /etc/yum.repos.d http://perl.arix.com/cpan2rpm/arix-perl.repo
and install whatever you need in the normal way:
# yum -y install perl-*whatever*
By default, packages will be verified before they are installed. To avoid this, edit the definition file and set gpgcheck=0, otherwise, please install our public key as indicated below.
# wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-arix-perl ftp://arix.com/RPM-GPG-KEY
Additionally, you may want to disable our repo from default use by setting the flag as shown: enabled=0. You can still use the repo when you like by calling yum like this:
# yum --enablerepo=arix-perl install perl-*whatever*

Target system

Please note that this repo only provides binaries for Fedora Core 11 (on Perl 5.10.0). However, you can always rebuild for your target platform (see Installation section for instructions on rebuilding) from the source packages.

Other systems

Packages are readily available for other systems, as follows (if you run a repo that you want to share, let me know):

Frequently Asked Questions

Where can I get help?

If you need urgent help, call 911.

If something's broken, you're puzzling over how to do something, or need any other help with this software, first read through this FAQ. If your answer isn't here, ask our mailing list by subscribing at: http://lists.sourceforge.net/lists/listinfo/cpan2rpm-general. Please note: feature requests and bug reports should also be handled through the list - thank you notes can be mailed directly to the author :)

Who's the author?

Erick Calder <cpan2rpm@arix.com>

I fixed a bug - how do I submit a patch?

For one-off patches just e-mail the list - make sure to patch the latest, unreleased version of the script (see the section Getting the software above).

If you would like to become a regular contributor, post your SSH public key (RSA format) on the mailing list with the subject header "New contributor". Once you've been added to the system, do the following:

XML::SAX::Expat won't build, help?

The build process fails, 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)
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()
        "
    

The packages I generate aren't getting GPG signed!

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 online

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 click the Build! button. Arguments to the cpan2rpm may be passed in the Arguments field (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>"

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.