Personal tools
     DOCUMENTATION

Conary:Package Recipe

From rPath Wiki

Jump to: navigation, search
Conary --> Packaging --> Recipe --> Package Recipe
Jump to:

As described in the Conary recipe page, recipes provide the Conary instructions needed to create an installable and maintainable software unit for a Conary-based system. Package recipes follow the Conary recipe conventions and are used to package software representing a single application. rPath recommends that packagers use sample recipes and the recipe templates as a resource to start a new recipe:

  • Start with a recipe template. See the Recipe Templates page for a linked list of recipe templates provided by rPath.
  • View recipes in rBuilder Online. Use the Browse Repository link to browse project repositories on rBuilder Online and to find and view existing recipe files. Click the <packagename>:source link in the package information, and then click Show Files to see the list of files that were checked in as the package source. Clicked the linked .recipe file to view the recipe.
  • Check out an existing recipe. Use cvc co to check out a package in a Conary build environment, and change to the package directory to view the recipe (.recipe file) used to create the package. If you do not have write access to a project repository with packages you wish to view, you can shadow a package from another repository and check out the shadow.

Conary's application programming interface (API) provides four recipe super-classes to serve as parent classes to the class created in a package recipe. Each of these four classes, along with their accompanying source and build classes, are listed on the package recipe classes page with links to its corresponding API reference.

The following is an example recipe to package an application in which C source code is provided. Note the comments identifying significant parts of the recipe:

# Use a "CamelCase" version of the package name as the class name
# Inherit from a recipe class that provides Conary features corresponding to the source type
class Tmpwatch(CPackageRecipe):   
    name = 'tmpwatch'     # Each recipe must have a name string
    version = '2.9.0'     # Each recipe must have a version string that refers to the source
 
    # Use recipe templates or recipes of similar packages as a starting point
    def setup(r):
        # Add the source archive from a particular location, in this case a URL
        r.addArchive('http://url/to/tmpwatch-%(version)s.tar.gz')
        # Add local source, in this case to a specific destination with a set mode
        r.addSource('crond-tmpwatch', dest='/etc/cron.daily/tmpwatch', mode=0755)
        # Use the method for stepping through a typical make sequence for C source
        r.MakeInstall(rootVar='ROOT')


From here you may wish to:

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