Personal tools
     DOCUMENTATION

Conary:Package Recipe Classes

From rPath Wiki

Jump to: navigation, search
Conary --> Packaging --> Recipe --> Package Recipe --> Package Recipe Classes
rPath recommends starting a recipe from a recipe template or from a copy (shadow or clone) of an existing recipe:

Conary recipe classes provide the tools necessary for writing recipes used in packaging. This page lists the PackageRecipe class and its subclasses, including the classes defined for adding source and for performing build and policy actions. Each items is linked to its usage information in the Conary Application Programming Interface (API) documentation, generated by Epydoc from the Python docstrings in the Conary code base: Conary API Documentation

Package Recipe Classes

Use the following classes in the package recipe class definition to inherit recipe tools as appropriate for the needs of the recipe:

PackageRecipe Provides the essential requirements for Conary recipes
BuildPackageRecipe Provides additional build requirements for recipes to create packages which require additional tools to build, such as grep, and sed
CPackageRecipe Used for most recipes of packages consisting of binaries built from C source code
AutoPackageRecipe Used for simple recipes which build packages requiring the auto* tools, such as automake and autoconf.

Source Actions

Use one or more of these actions as appropriate to obtain and prepare source code:

r.addActionPerforms the specified shell command in the first pass of the build (similar to r.Run(), but performed during the prep stage)
r.addArchiveAdds an archive such as a tarball or zip file, unpacking it into the appropriate directory
r.addPatchApplies a patch
r.addSourceCopies a file into the build directory a specified the destination directory

Build Actions

Use build actions to direct the build and installation of software packages. Note the following regarding build actions:

  • Conary Macros can be used when calling any of these actions
  • Specified file names are relative to the destdir (a macro) if they are absolute paths and relative to the main build directory in all other cases
r.AntExecutes the ant utility
r.AutomakeRuns aclocal, autoconf, and automake
r.CompilePythonGenerates compiled Python files (.pyc and .pyo files)
r.ConfigureRuns an autoconf configure script
r.ConsoleHelperSets up consolehelper symbolic links, control files, and dependency for an application
r.CopyCopies files without changing the mode
r.CmakeRuns cmake configure script
r.CreateCreates a file
r.DesktopfileInstalls desktop (.desktop) files
r.DocInstalls documentation files
r.EnvironmentSets an environment variable after all macros have been set
r.GlobTranslates a glob statement into a regular expression, substituting macros.
r.InstallCopies files from one location to another and sets their mode
r.LdconfigRuns ldconfig in a directory
r.LinkInstalls a hard link
r.MakeRuns the make utility with system defaults
r.MakeDirsMakes directories
r.MakeFIFOCreates a FIFO (named pipe)
r.MakeInstallRuns make install and sets the destination directory
r.MakeParallelSubdirRuns make utility with system default for parallelmflags applied only to sub-make processes
r.MakePathsInstallRuns make when there is no single functional destination directory and provides for setting it manually
r.ManualConfigureWorks like r.Configure except all arguments to the configure script can be explicitly provided
r.MoveMoves files
r.PythonSetupCalls setup.py to use the python-setuptools library to install without building an .egg file
r.RegexpTranslates a regexp statement, substituting macros.
r.RemoveRemoves files
r.ReplaceSubstitutes text in a file
r.RunRuns a shell command
r.SetModesSets modes on files
r.SGMLCatalogEntryAdds an entry to the SGML catalog file
r.SymlinkCreates symbolic links
r.TestSuiteCreates a script to run the package's test suite
r.XInetdServiceCreates a file in /etc/xinetd.d/ to run an application
r.XMLCatalogEntryAdds an entry to the XML catalog file

Policy Actions

Policy actions are used to specify exceptions to Conary policy. Conary policy audits the results of the build actions to ensure they conform to certain Conary specifications.

Built-in Policy Actions

Use these actions in a recipe to provide more information to Conary built-in policy classes:

r.ByDefaultDetermines which components should be installed by default when the package is installed
r.ComponentProvidesCauses each trove to provide itself explicitly
r.ComponentRequiresCreates automatic intra-package inter-component dependencies
r.ComponentSpecDetermines which component contains each file
r.ConfigMarks files as configuration files
r.ExcludeDirectoriesCauses directories to be excluded from the package by default
r.FlavorDrives the flavor mechanism
r.InitialContentsMarks only explicit inclusions as initial contents files
r.LinkCountSpecifies directory names which are exempted from the hard link rule
r.LinkTypeEnsures only regular, non-config files may have hard links
r.MakeDevicesMakes device nodes
r.OwnershipSets user and group ownership of files when the default of root:root is not appropriate
r.PackageSpecDetermines which package (and, optionally, component) each file is in
r.ProvidesDrives the provides mechanism
r.RequiresDrives the requirement mechanism
r.TagDescriptionMarks tag description files as such so that Conary handles them correctly
r.TagHandlerMarks tag handler files as such so that Conary handles them correctly
r.TagSpecApplies tags defined by tag descriptions
r.TestSuiteFilesIndicates extra files to copy into the test directory
r.TestSuiteLinksIndicates extra files to link into the test directory
r.TransientMarks files that have transient contents
r.UtilizeGroupMarks files as requiring a group definition to exist even though the file is not owned by that group
r.UtilizeUserMarks files as requiring a user definition to exist even though the file is not owned by that user

Pluggable Policy Actions

Use these actions in a recipe to provide more information to Conary policy defined outside of Conary itself, but provided in the default Conary policy (note that it is possible for a Conary-based operating system to provide additional "pluggable policy" beyond this list):

r.AutoDocAdds documentation not otherwise installed
r.BadFilenamesRequires that filenames must not contain newlines; No exceptions are allowed
r.BadInterpreterPathsEnforces the use of absolute paths for interpreters
r.CheckDesktopFilesWarns about possible errors in desktop files, such as missing icon files
r.CheckDestDirVerifies absence of destination directory's path in file paths and symbolic link contents
r.CheckSonamesWarns about various possible shared library packaging errors
r.DanglingSymlinksEnforces the absence of dangling symbolic links
r.EnforceCILBuildRequirementsEnforces Common Intermediate Language runtime requirements
r.EnforceCMakeCacheBuildRequirementsEnsures that components mentioned in CMakeCache.txt files are listed as build requirements
r.EnforceFlagBuildRequirementsEnsures that all files used to define the current flavor are listed as build requirements
r.EnforceConfigLogBuildRequirementsFinds build requirement component references in config.log files
r.EnforceJavaBuildRequirementsEnforces Java runtime requirements
r.EnforcePerlBuildRequirementsEnforces Perl runtime requirements
r.EnforcePythonBuildRequirementsEnforces Python runtime requirements
r.EnforceSonameBuildRequirementsTests to ensure that each requires dependency in the package is matched by a suitable element in the buildRequires list
r.ExecutableLibrariesSets executable mode on library files and warns about doing so
r.FilesForDirectoriesWarns about the presence of files where directories are expected
r.FilesInMandirEnforces content of manual page directory to files only
r.FixBuilddirSymlinkRemove builddir from symlink contents when appropriate
r.FixupManpagePathsTries to fix up manpage paths normally caught by FilesInMandir, and other mishaps
r.FixupMultilibPathsRepairs and warns when programs should be installing to lib64, yet install to lib instead
r.IgnoredSetuidWarns about setuid/setgid conflicts between the recipe and filesystem
r.ImproperlySharedEnforces architecture-independent content in data directories
r.NonBinariesInBindirsEnforces binary directory content to files with executable bit set
r.NonMultilibComponentTests multilib support for Python and Perl component
r.NonMultilibDirectoriesEnforces absence of lib64 directories in troves for 32-bit platforms
r.NonUTF8FilenamesEnforces UTF-8 encoding of filenames
r.NormalizeAppDefaults Resolves proper location of X app-defaults files (no exceptions are recommended)
r.NormalizeCompressionCompresses files with maximum compression and without data that can change from invocation to invocation
r.NormalizeInfoPagesCompresses info files and removes dir file
r.NormalizePythonInterpreterVersionProvides version-specific path to python interpreter in python program files
r.NormalizeInitscriptContentsFixes common errors within init scripts and adds dependencies if needed
r.NormalizeInitscriptLocationProperly locates initscripts while resolving ambiguity about their location
r.NormalizeInterpreterPathsRe-writes interpreter paths in scripts, changing indirect calls through env to direct calls
r.NormalizeLibrarySymlinksRuns the ldconfig program in each system library directory to prevent packaging of unowned symbolic links
r.NormalizeManPagesForces all man pages to follow typical system policy
r.NormalizePamConfigRemoves old PAM module path from configuration files
r.NormalizePkgConfigMake pkgconfig files multilib-safe
r.ParseManifestParses a file containing a manifest intended for RPM
r.PythonEggsEnforces the absence of Python .egg files
r.ReadableDocsEnsures documentation files are world-readable
r.RelativeSymlinksMakes all symbolic links relative
r.RemoveNonPackageFilesRemoves classes of files that typically should not be packaged
r.RequireChkconfigRequires all initscripts to provide chkconfig information
r.SharedLibraryMarks system shared libaries such that ldconfig will be run
r.StripStrips executables and libraries of debugging information
r.WarnWriteableWarns about files which are unexpectedly writable by group or other
r.WorldWriteableExecutablesEnsures executable files are not world-writable

Deprecated Classes

The following classes are deprecated for package recipes. They are provided here for the sake of compatibility with older recipes.

r.EtcConfig Included for backwards compatibility with older recipes; convert all instances to r.Config instead of r.EtcConfig
r.Group While use of this class is valid in group info recipes, it is deprecated in package recipes
r.InstallBucketIncluded for backwards compatibility with older recipes; should be removed from recipes
r.ObsoletePathsPrevious versions of Conary used r.ObsoletePaths to warn about paths which were correct but are now considered obsolete. r.ObsoletePaths has been replaced by r.FixObsoletePaths.
r.SupplementalGroup While use of this class is valid in group info recipes, it is deprecated in package recipes
r.User While use of this class is valid in user info recipes, it is deprecated in package recipes



From here you may wish to:

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