Personal tools
     DOCUMENTATION

Conary:RPM Package Recipe

From rPath Wiki

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

Conary packagers can write a package recipe to incorporate software provided for RPM package management. The recipe inherits from AutoPackageRecipe and from RPMPackageRecipe defined in the rpmpackage recipe defined in conary.rpath.com@rpl:devel. The RPMPackageRecipe class is designed to use source code and patch files contained within RPM files with source code (SRPMs).

The following is an example of a Conary recipe inheriting from the RPMPackageRecipe class:

 
loadSuperClass('rpmpackage')
class Hesiod(RPMPackageRecipe, AutoPackageRecipe):
    name = 'hesiod'
    version = '3.1.0'
    rpmRelease = '4'
    rpmPatches = [ 'hesiod-3.0.2-env.patch', ]

Use the class for a recipe by adding the loadSuperClass line before the class definition, then inheriting from the RPMPackageRecipe class as in the example:

loadSuperClass('rpmpackage=conary.rpath.com@rpl:devel')
class ExampleApp(RPMPackageRecipe, AutoPackageRecipe):

The following are real-world examples of recipes using RPMPackageRecipe from conary.rpath.com@rpl:devel:

Image:Bulbgraph.png   Any recipes using srpm= for manipulating SRPM files can be updated to use the RPMPackageRecipe class instead. Modify the recipe to inherit from both AutoPackageRecipe and RPMPackageRecipe, and unpack and apply patches with r.unpack. Packagers can still use the srpm URL directly as it is stored in the class variable srpm (called as r.srpm).

The following variables can be leveraged in the recipe to alter the behavior of the class:

  • externalArchive: (string) Can be set if you want to pull patches or sources from the RPM, but want the upstream archive to come from a different location
  • tarballName: (string) Used if rpmpackage cannot determine the correct archive name contained within the RPM file
  • distroVersion: (string) The version of Red Hat Enterprise Linux (RHEL) or Fedora Core to use for fetching the RPM; defaults to development for Fedora Core and to 4 for RHEL *
  • rpmRelease: (string) RPM release string (occurring after the dash and before the dot)
  • isRHEL: (boolean) RHEL sources are used if this variable is true, Fedora sources are used otherwise.
  • rpmPatches: (list of strings) Patches to apply from the RPM
  • rpmSources: (list of strings) Sources to add from the RPM
  • rpmUpVer: (string) The upstream package version; defaults to the recipe's upstream version
  • rpmName: (string) The upstream package name; defaults to the recipe's upstream name

Check out the rpmpackage recipe if desired to further examine the inherited code:

$cvc co rpmpackage=conary.rpath.com@rpl:devel

  * Red Hat, Enterprise Linux, and Fedora are trademarks of Red Hat, Inc.



From here you may wish to:

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