Personal tools
     DOCUMENTATION

Conary:Complex C App Template

From rPath Wiki

Jump to: navigation, search
Conary --> Packaging --> Recipe --> Recipe Templates --> Complex C App Template

Conary packagers can write a package recipe to package source code written in C, C++, or C#. Packagers have two classes from which the recipe can inherit, depending on the needs of the application:

  • AutoPackageRecipe is used when the source code can be built with configure ; make ; make install (Use the Recipe Template for Simple C Source for these recipes.)
  • CPackageRecipe is used when this "simple" sequence does not apply, allowing packagers to call associated methods as necessary to perform each source-building task

Use the following template to start recipes using CPackageRecipe, and make the changes suggested:

 
class MyApp(CPackageRecipe):
    name = 'myapp'
    version = '1.0'
 
    buildRequires = []
 
    def setup(r):
        r.addArchive('http://www.example.com/sample/'
                     '%(name)s-%(version)s.tar.bz2')
        r.Make(makeName='samplemake')
        r.Run('another special build command')
        r.MakeInstall()
        r.Install('samplefile', '%(datadir)s/%(name)s/')

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
  • 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
  • Change the URL to reflect the location of the application
  • Change the makeName value as necessary to represent a non-standard makefile processor for the application, or change this line to r.Make if the application uses standard make code
  • Change the r.Run line as necessary to represent any special commands needed by the application when the code is built, or remove this line entirely if no special commands are needed
  • Change the r.Install line as necessary to represent any additional files that must be installed, or remove this line entirely if no additional files are required



From here you may wish to:

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