Personal tools
     DOCUMENTATION

Conary:Recipe Template for Binary Files

From rPath Wiki

Jump to: navigation, search
Conary --> Packaging --> Recipe --> Recipe Templates --> Recipe Template for Binary Files

Conary packagers can package applications that are only provided as binaries (installable executable programs), such as for closed-source software. Packagers write recipes for binary-only packages by inheriting from the BinaryPackageRecipe class in Conary.

Use the following template to start the recipe, and make the changes suggested:

 
loadSuperClass('binarypackage=conary.rpath.com@rpl:1')
class MyApp(BinaryPackageRecipe):
    name = 'myapp'
    version = '1.0'
    archive = 'http://www.example.com/foo/%(name)s-%(version)s.tar.bz2'
    buildRequires = []

Suggested changes:

  • Change the class name to a CamelCase representation of the application name
  • Change the value for name to the application name as packaged
  • Change the value for version to the application version
  • 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
  • If necessary (for example, to change the arguments provided to the addArchive method), replace the archive line by defining an unpack() method. Change the value of the dir option in addArchive as necessary:
 
    def unpack(r):
        r.addArchive('http://www.example.com/foo/'
                     '%(name)s-%(version)s.tar.gz',
                     dir='/opt/%(name)s/',
                     preserveOwnership=True)
  • If you want to preserve the ownership from the archive, add the preserveOwnership argument as demonstrated in the example above.
  • If multiple archives are needed, replace the archive line with an unpack method containing multiple addArchive lines:
 
    def unpack(r):
        # automatically looks for %(name)s-%(version)s.tar.bz2,
        # %(name)s-%(version)s.tar.gz, and other variants
        r.addArchive('http://www.example.com/%(name)s/')
        # unpack thing.tar.bz2 into /srv/myapp
        r.addArchive('http://www.example.com/other/thing.tar.bz2',
                     dir='%(servicedir)s/%(name)s/)
 
  • Specify debug info to go into a separate :debuginfo component if desired:
    def disableStrip(r): pass
  • Pass exceptions to policy or include other small adjustments as necessary:
 
    def policy(r):
        # do not generate perl dependencies
        r.Requires(exceptDeps='perl:.*')
        # manually cause files in /usr/bin/ require a perl package
        r.Requires('perl-Foo:runtime', '%(bindir)s/')



From here you may wish to:

Participate in the rPath Community | Contribute to rPath Wiki | Report an issue to rPath