%scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &b-link-Package; Builder. If this tool is enabled, the command-line option is also enabled. Builds software distribution packages. A package is a container format which includes files to install along with metadata. Packaging is optional, and must be enabled by specifying the &t-link-packaging; tool. For example: env = Environment(tools=['default', 'packaging']) &SCons; can build packages in a number of well known packaging formats. The target package type may be selected with the the &cv-link-PACKAGETYPE; construction variable or the command line option. The package type may be a list, in which case &SCons; will attempt to build packages for each type in the list. Example: env.Package(PACKAGETYPE=['src_zip', 'src_targz'], ...other args...) The currently supported packagers are: msiMicrosoft Installer package rpmRPM Package Manger package ipkgItsy Package Management package tarbz2bzip2-compressed tar file targzgzip-compressed tar file tarxzxz-compressed tar file zipzip file src_tarbz2bzip2-compressed tar file suitable as source to another packager src_targzgzip-compressed tar file suitable as source to another packager src_tarxzxz-compressed tar file suitable as source to another packager src_zipzip file suitable as source to another packager The file list to include in the package may be specified with the &source; keyword argument. If omitted, the &f-link-FindInstalledFiles; function is called behind the scenes to select all files that have an &b-link-Install;, &b-link-InstallAs; or &b-link-InstallVersionedLib; Builder attached. If the ⌖ keyword argument is omitted, the target name(s) will be deduced from the package type(s). The metadata comes partly from attributes of the files to be packaged, and partly from packaging tags. Tags can be passed as keyword arguments to the &b-Package; builder call, and may also be attached to files (or more accurately, Nodes representing files) with the &f-link-Tag; function. Some package-level tags are mandatory, and will lead to errors if omitted. The mandatory tags vary depending on the package type. While packaging, the builder uses a temporary location named by the value of the &cv-link-PACKAGEROOT; variable - the package sources are copied there before packaging. Packaging example: env = Environment(tools=["default", "packaging"]) env.Install("/bin/", "my_program") env.Package( NAME="foo", VERSION="1.2.3", PACKAGEVERSION=0, PACKAGETYPE="rpm", LICENSE="gpl", SUMMARY="balalalalal", DESCRIPTION="this should be really really long", X_RPM_GROUP="Application/fu", SOURCE_URL="https://foo.org/foo-1.2.3.tar.gz", ) In this example, the target /bin/my_program created by the &b-Install; call would not be built by default since it is not under the project top directory. However, since no source is specified to the &b-Package; builder, it is selected for packaging by the default sources rule. Since packaging is done using &cv-link-PACKAGEROOT;, no write is actually done to the system's /bin directory, and the target will be selected since after rebasing to underneath &cv-PACKAGEROOT; it is now under the top directory of the project. Specifies the system architecture for which the package is being built. The default is the system architecture of the machine on which SCons is running. This is used to fill in the Architecture: field in an Ipkg control file, and the BuildArch: field in the RPM .spec file, as well as forming part of the name of a generated RPM package file. See the &b-link-Package; builder. A hook for modifying the file that controls the packaging build (the .spec for RPM, the control for Ipkg, the .wxs for MSI). If set, the function will be called after the SCons template for the file has been written. See the &b-link-Package; builder. The name of a file containing the change log text to be included in the package. This is included as the %changelog section of the RPM .spec file. See the &b-link-Package; builder. A long description of the project being packaged. This is included in the relevant section of the file that controls the packaging build. See the &b-link-Package; builder. A language-specific long description for the specified lang. This is used to populate a %description -l section of an RPM .spec file. See the &b-link-Package; builder. The abbreviated name, preferably the SPDX code, of the license under which this project is released (GPL-3.0, LGPL-2.1, BSD-2-Clause etc.). See http://www.opensource.org/licenses/alphabetical for a list of license names and SPDX codes. See the &b-link-Package; builder. Specfies the name of the project to package. See the &b-link-Package; builder. Specifies the directory where all files in resulting archive will be placed if applicable. The default value is &cv-NAME;-&cv-VERSION;. See the &b-link-Package; builder. Selects the package type to build when using the &b-link-Package; builder. May be a string or list of strings. See the docuentation for the builder for the currently supported types. &cv-PACKAGETYPE; may be overridden with the command line option. See the &b-link-Package; builder. The version of the package (not the underlying project). This is currently only used by the rpm packager and should reflect changes in the packaging, not the underlying project code itself. See the &b-link-Package; builder. The URL (web address) of the location from which the project was retrieved. This is used to fill in the Source: field in the controlling information for Ipkg and RPM packages. See the &b-link-Package; builder. A short summary of what the project is about. This is used to fill in the Summary: field in the controlling information for Ipkg and RPM packages, and as the Description: field in MSI packages. See the &b-link-Package; builder. The person or organization who supply the packaged software. This is used to fill in the Vendor: field in the controlling information for RPM packages, and the Manufacturer: field in the controlling information for MSI packages. See the &b-link-Package; builder. The version of the project, specified as a string. See the &b-link-Package; builder. This is used to fill in the Depends: field in the controlling information for Ipkg packages. See the &b-link-Package; builder. This is used to fill in the Description: field in the controlling information for Ipkg packages. The default value is &cv-SUMMARY;\n&cv-DESCRIPTION; This is used to fill in the Maintainer: field in the controlling information for Ipkg packages. This is used to fill in the Priority: field in the controlling information for Ipkg packages. This is used to fill in the Section: field in the controlling information for Ipkg packages. This is used to fill in the Language: attribute in the controlling information for MSI packages. See the &b-link-Package; builder. The text of the software license in RTF format. Carriage return characters will be replaced with the RTF equivalent \\par. See the &b-link-Package; builder. TODO This is used to fill in the AutoReqProv: field in the RPM .spec file. See the &b-link-Package; builder. internal, but overridable This is used to fill in the BuildRequires: field in the RPM .spec file. Note this should only be used on a host managed by rpm as the dependencies will not be resolvable at build time otherwise. internal, but overridable internal, but overridable This is used to fill in the Conflicts: field in the RPM .spec file. This value is used as the default attributes for the files in the RPM package. The default value is (-,root,root). This is used to fill in the Distribution: field in the RPM .spec file. This is used to fill in the Epoch: field in the RPM .spec file. This is used to fill in the ExcludeArch: field in the RPM .spec file. This is used to fill in the ExclusiveArch: field in the RPM .spec file. A list used to supply extra defintions or flags to be added to the RPM .spec file. Each item is added as-is with a carriage return appended. This is useful if some specific RPM feature not otherwise anticipated by SCons needs to be turned on or off. Note if this variable is omitted, SCons will by default supply the value '%global debug_package %{nil}' to disable debug package generation. To enable debug package generation, include this variable set either to None, or to a custom list that does not include the default line. Added in version 3.1. env.Package( NAME="foo", ... X_RPM_EXTRADEFS=[ "%define _unpackaged_files_terminate_build 0" "%define _missing_doc_files_terminate_build 0" ], ... ) This is used to fill in the Group: field in the RPM .spec file. This is used to fill in the Group(lang): field in the RPM .spec file. Note that lang is not literal and should be replaced by the appropriate language code. This is used to fill in the Icon: field in the RPM .spec file. internal, but overridable This is used to fill in the Packager: field in the RPM .spec file. This is used to fill in the Provides: field in the RPM .spec file. This is used to fill in the %post: section in the RPM .spec file. This is used to fill in the %pre: section in the RPM .spec file. This is used to fill in the Prefix: field in the RPM .spec file. internal, but overridable This is used to fill in the %postun: section in the RPM .spec file. This is used to fill in the %preun: section in the RPM .spec file. This is used to fill in the Requires: field in the RPM .spec file. This is used to fill in the Serial: field in the RPM .spec file. This is used to fill in the Url: field in the RPM .spec file. (node, tags) Annotates file or directory Nodes with information about how the &b-link-Package; Builder should package those files or directories. All Node-level tags are optional. Examples: # makes sure the built library will be installed with 644 file access mode Tag(Library('lib.c'), UNIX_ATTR="0o644") # marks file2.txt to be a documentation file Tag('file2.txt', DOC)