Use this section if the software you're packaging for Conary is already an executable, compiled and ready to launch on a target system.
If you're using rBuilder 5 or later, you can create this type of package by using the Package Creator in its web interface. rBuilder combines its custom Conary factories with your uploaded source files to generate the recipe code you need. Conary and rBuilder combine their built-in intelligence to determine a lot about how the package should be assembled. rPath recommends that you take advantage of this built-in intelligence by continuing to use rBuilder's factories, and adding any supplemental and overriding code to the preProcess and postProcess sections of the recipe.
Without factories, you can create and maintain your package recipe to take advantage of the binarypackage superclass from Conary. Use the following as a template for starting your recipe:
# RECIPE TEMPLATE
# Package a binary/executable that is ready-to-run on the target system
loadSuperClass('binarypackage=conary.rpath.com@rpl:2')
class ExampleApp(BinaryPackageRecipe):
name = 'exampleapp'
version = '1.0'
archive = 'http://www.example.com/exampleapp/%(name)s-%(version)s.tar.bz2'
buildRequires = []
Replace the class name, package name, version, and the archive location as appropriate for an archive containing the executable files. The archive location can be just a file name (if you're checking in the file with the recipe), or a network-accessible location as shown in the template example.
If you need to change how the archive is unpacked and installed, or you need to include multiple archives, remove the "archive" line, and define an unpack method with the r.addArchive actions you need, instead:
# RECIPE TEMPLATE
# Package a binary/executable that is ready-to-run on the target system
# using an unpack method instead of the archive variable
loadSuperClass('binarypackage=conary.rpath.com@rpl:2')
class ExampleApp(BinaryPackageRecipe):
name = 'exampleapp'
version = '1.0'
buildRequires = []
def unpack(r):
r.addArchive('http://www.example.com/exampleapp/%(name)s-%(version)s.tar.gz',
dir='/opt/%(name)s/', preserveOwnership=True)
r.addArchive('http://www.example.com/exampleservice/%(name)s-%(version)-service.tar.bz2',
dir='%(servicedir)s/%(name)s/)
To add policy actions to the recipe (overriding Conary's default policy), add on a policy method with the actions you need:
# RECIPE TEMPLATE
# Package a binary/executable that is ready-to-run on the target system
# adding on a policy method to override default Conary policy actions
loadSuperClass('binarypackage=conary.rpath.com@rpl:2')
class ExampleApp(BinaryPackageRecipe):
name = 'exampleapp'
version = '1.0'
archive = 'http://www.example.com/exampleapp/%(name)s-%(version)s.tar.bz2'
buildRequires = []
def policy(r):
r.Requires(exceptDeps='perl:.*')
r.Requires('perl-Foo:runtime', '%(bindir)s/')
Reference all the other actions you can add to your recipe in Conary Recipe Actions, Macros, and Variables at docs.rpath.com/conary.