Conary:CPAN Perl App Template
From rPath Wiki
Conary packagers can write a package recipe that inherits from the CPANPackageRecipe class in Conary, designed to package Perl applications that are stored on CPAN (search.cpan.org).
Use the following template to start the recipe, and make the changes suggested:
loadSuperClass('cpanpackage=conary.rpath.com@rpl:devel') class MyApp(CPANPackageRecipe): name = 'perl-myapp' version = '1.0' author = 'CPANAUTHORNAME' server = 'http://search.cpan.org/CPAN/' buildRequires = []
Suggested changes:
- Change the class name to a CamelCase representation of the application name
- Change the value for name to perl- followed by the package name on CPAN (such as perl-XML-Grove)
- Change the value for version to the application version
- Do one of the following:
- Remove the author and server lines (preferred)
- Change the value of author to be the CPAN identifier for the author
- If the Perl module builds an accompanying C library (.so), also inherit from the CPackageRecipe superclass
- Change the URL to reflect the location of the application
- After cooking (with cvc) or building (with rMake), add items to the buildRequires section as instructed by the build messages (see Conary Recipe Structure for more information); remove the buildRequires line altogether if it is not needed
The cpan2conary script can automate the creation of Conary recipes from a CPAN module. The script changes IO::Socket::SSL into perl-IO-Socket-SSL and cooks it. Note the Conary warning displayed when cooking and add the buildRequires as necessary.
Some applications using Perl contain private Perl modules. Conary discovers that these are required by the application modifying the {[t|@INC}} array, but it has no way of discovering that the application also provides what it requires. Perl dependencies that are provided within the package should be explicitly removed with code like this:
r.Requires(exceptDeps='perl: (mod1|mod2|mod3|...)')
Conary does not expect that CPAN applications require this modification, but some applications that depend on CPAN modules may also require this modification for internal dependencies.
