Conary:Package Recipe Classes
From rPath Wiki
| 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.addAction | Performs the specified shell command in the first pass of the build (similar to r.Run(), but performed during the prep stage) |
| r.addArchive | Adds an archive such as a tarball or zip file, unpacking it into the appropriate directory |
| r.addPatch | Applies a patch |
| r.addSource | Copies 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.Ant | Executes the ant utility |
| r.Automake | Runs aclocal, autoconf, and automake |
| r.CompilePython | Generates compiled Python files (.pyc and .pyo files) |
| r.Configure | Runs an autoconf configure script |
| r.ConsoleHelper | Sets up consolehelper symbolic links, control files, and dependency for an application |
| r.Copy | Copies files without changing the mode |
| r.Cmake | Runs cmake configure script |
| r.Create | Creates a file |
| r.Desktopfile | Installs desktop (.desktop) files |
| r.Doc | Installs documentation files |
| r.Environment | Sets an environment variable after all macros have been set |
| r.Glob | Translates a glob statement into a regular expression, substituting macros. |
| r.Install | Copies files from one location to another and sets their mode |
| r.Ldconfig | Runs ldconfig in a directory |
| r.Link | Installs a hard link |
| r.Make | Runs the make utility with system defaults |
| r.MakeDirs | Makes directories |
| r.MakeFIFO | Creates a FIFO (named pipe) |
| r.MakeInstall | Runs make install and sets the destination directory |
| r.MakeParallelSubdir | Runs make utility with system default for parallelmflags applied only to sub-make processes |
| r.MakePathsInstall | Runs make when there is no single functional destination directory and provides for setting it manually |
| r.ManualConfigure | Works like r.Configure except all arguments to the configure script can be explicitly provided |
| r.Move | Moves files |
| r.PythonSetup | Calls setup.py to use the python-setuptools library to install without building an .egg file |
| r.Regexp | Translates a regexp statement, substituting macros. |
| r.Remove | Removes files |
| r.Replace | Substitutes text in a file |
| r.Run | Runs a shell command |
| r.SetModes | Sets modes on files |
| r.SGMLCatalogEntry | Adds an entry to the SGML catalog file |
| r.Symlink | Creates symbolic links |
| r.TestSuite | Creates a script to run the package's test suite |
| r.XInetdService | Creates a file in /etc/xinetd.d/ to run an application |
| r.XMLCatalogEntry | Adds 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.ByDefault | Determines which components should be installed by default when the package is installed |
| r.ComponentProvides | Causes each trove to provide itself explicitly |
| r.ComponentRequires | Creates automatic intra-package inter-component dependencies |
| r.ComponentSpec | Determines which component contains each file |
| r.Config | Marks files as configuration files |
| r.ExcludeDirectories | Causes directories to be excluded from the package by default |
| r.Flavor | Drives the flavor mechanism |
| r.InitialContents | Marks only explicit inclusions as initial contents files |
| r.LinkCount | Specifies directory names which are exempted from the hard link rule |
| r.LinkType | Ensures only regular, non-config files may have hard links |
| r.MakeDevices | Makes device nodes |
| r.Ownership | Sets user and group ownership of files when the default of root:root is not appropriate |
| r.PackageSpec | Determines which package (and, optionally, component) each file is in |
| r.Provides | Drives the provides mechanism |
| r.Requires | Drives the requirement mechanism |
| r.TagDescription | Marks tag description files as such so that Conary handles them correctly |
| r.TagHandler | Marks tag handler files as such so that Conary handles them correctly |
| r.TagSpec | Applies tags defined by tag descriptions |
| r.TestSuiteFiles | Indicates extra files to copy into the test directory |
| r.TestSuiteLinks | Indicates extra files to link into the test directory |
| r.Transient | Marks files that have transient contents |
| r.UtilizeGroup | Marks files as requiring a group definition to exist even though the file is not owned by that group |
| r.UtilizeUser | Marks 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.AutoDoc | Adds documentation not otherwise installed |
| r.BadFilenames | Requires that filenames must not contain newlines; No exceptions are allowed |
| r.BadInterpreterPaths | Enforces the use of absolute paths for interpreters |
| r.CheckDesktopFiles | Warns about possible errors in desktop files, such as missing icon files |
| r.CheckDestDir | Verifies absence of destination directory's path in file paths and symbolic link contents |
| r.CheckSonames | Warns about various possible shared library packaging errors |
| r.DanglingSymlinks | Enforces the absence of dangling symbolic links |
| r.EnforceCILBuildRequirements | Enforces Common Intermediate Language runtime requirements |
| r.EnforceCMakeCacheBuildRequirements | Ensures that components mentioned in CMakeCache.txt files are listed as build requirements |
| r.EnforceFlagBuildRequirements | Ensures that all files used to define the current flavor are listed as build requirements |
| r.EnforceConfigLogBuildRequirements | Finds build requirement component references in config.log files |
| r.EnforceJavaBuildRequirements | Enforces Java runtime requirements |
| r.EnforcePerlBuildRequirements | Enforces Perl runtime requirements |
| r.EnforcePythonBuildRequirements | Enforces Python runtime requirements |
| r.EnforceSonameBuildRequirements | Tests to ensure that each requires dependency in the package is matched by a suitable element in the buildRequires list |
| r.ExecutableLibraries | Sets executable mode on library files and warns about doing so |
| r.FilesForDirectories | Warns about the presence of files where directories are expected |
| r.FilesInMandir | Enforces content of manual page directory to files only |
| r.FixBuilddirSymlink | Remove builddir from symlink contents when appropriate |
| r.FixupManpagePaths | Tries to fix up manpage paths normally caught by FilesInMandir, and other mishaps |
| r.FixupMultilibPaths | Repairs and warns when programs should be installing to lib64, yet install to lib instead |
| r.IgnoredSetuid | Warns about setuid/setgid conflicts between the recipe and filesystem |
| r.ImproperlyShared | Enforces architecture-independent content in data directories |
| r.NonBinariesInBindirs | Enforces binary directory content to files with executable bit set |
| r.NonMultilibComponent | Tests multilib support for Python and Perl component |
| r.NonMultilibDirectories | Enforces absence of lib64 directories in troves for 32-bit platforms |
| r.NonUTF8Filenames | Enforces UTF-8 encoding of filenames |
| r.NormalizeAppDefaults | Resolves proper location of X app-defaults files (no exceptions are recommended) |
| r.NormalizeCompression | Compresses files with maximum compression and without data that can change from invocation to invocation |
| r.NormalizeInfoPages | Compresses info files and removes dir file |
| r.NormalizePythonInterpreterVersion | Provides version-specific path to python interpreter in python program files |
| r.NormalizeInitscriptContents | Fixes common errors within init scripts and adds dependencies if needed |
| r.NormalizeInitscriptLocation | Properly locates initscripts while resolving ambiguity about their location |
| r.NormalizeInterpreterPaths | Re-writes interpreter paths in scripts, changing indirect calls through env to direct calls |
| r.NormalizeLibrarySymlinks | Runs the ldconfig program in each system library directory to prevent packaging of unowned symbolic links |
| r.NormalizeManPages | Forces all man pages to follow typical system policy |
| r.NormalizePamConfig | Removes old PAM module path from configuration files |
| r.NormalizePkgConfig | Make pkgconfig files multilib-safe |
| r.ParseManifest | Parses a file containing a manifest intended for RPM |
| r.PythonEggs | Enforces the absence of Python .egg files |
| r.ReadableDocs | Ensures documentation files are world-readable |
| r.RelativeSymlinks | Makes all symbolic links relative |
| r.RemoveNonPackageFiles | Removes classes of files that typically should not be packaged |
| r.RequireChkconfig | Requires all initscripts to provide chkconfig information |
| r.SharedLibrary | Marks system shared libaries such that ldconfig will be run |
| r.Strip | Strips executables and libraries of debugging information |
| r.WarnWriteable | Warns about files which are unexpectedly writable by group or other |
| r.WorldWriteableExecutables | Ensures 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.InstallBucket | Included for backwards compatibility with older recipes; should be removed from recipes |
| r.ObsoletePaths | Previous 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 |
