RPM Customized Build Environment

From Outrun Wiki
Jump to: navigation, search

Overview

You can specify different paths and other build parameters via the rpmmacros file.

List of parameters

(incomplete)

Parameter Comment
%_rpmdir Target for created RPM packages
%_srcrpmdir Target for created source RPM packages
%vendor Package Vendor tag (i.e. an organization that distributes these packages)
%packager Packager tag (i.e. the person that built these packages.
%distribution Distribution tag (i.e. the group of packages the package belongs to)
%_signature gpg Signature type gpg
%_gpg_name Username of the person signing the packages (something like <user@buildhost.example.org> - must exactly match the GPG key)
%_gpg_path Path to the GPG keys (usually ~/.gnupg, define as %(echo $HOME)/.gnupg)

Default values

The standard .rpmmacros uses:

# Package metadata
%vendor		Outrun RPMbuild system
%packager	%(getent passwd $(id -un) |awk -F: '{print $5}' | cut -d, -f1)
%distribution	Local

An up-to-date template can be found in /usr/share/build/rpmmacros.

Notes:

Distribution
The %distribution tag is used for naming the repository if you build the release file. Spaces are replaced by "-" and characters are converted to lowercase.
GPG signing
GPG signing is disabled by default
Showing package metadata after rebuilding
# To show how the vendor, packager and distribution tags are embedded in each package built:
rpm -q --qf "Package Name:\t%{NAME}\nPackage Vendor:\t%{VENDOR}\nRPM Packager\t%{PACKAGER}\nDistribution:\t%{DISTRIBUTION}\n" <package>
# If the package is not yet installed but available on the local filesystem, use rpm -qp