Reference Manual¶
Key-Values¶
Single-Value Fields¶
URL¶
A URL to a human-readable homepage.
URL: https://phabricator.kde.org/source/discover/
URL: https://download.kde.org/stable/plasma/%{version}/%{name}-%{version}.tar.xz
Release¶
The version of the package itself—increment this when you change the build recipe to get a different package when there’s not a new version of the thing being packaged.
Release: 5
Epoch¶
The epoch of your package. If the epoch for a package is higher than an older version, it will be considered an upgrade, regardless of the version and release.
Epoch:
Array Fields¶
Array fields can be specified like this:
Array: item
Array: item
# array is [item, item]
Or they can be specified like this:
Array: item item
Requires¶
Indicates a dependency that needs to be installed in order to use the package.
Requires: dependency
BuildRequires¶
Indicates a dependency that needs to be installed in order to build the package.
BuildRequires: dependency
CheckRequires¶
Indicates a dependency that needs to be installed in order to run tests on the package.
CheckRequires: dependency
Recommends¶
Indicates a dependency that can be installed to provide more features for a package. Do not use this to make parts of a package optional by breaking them with missing dependencies. Instead, use split packages.
Recommends: dependency
Conflicts¶
Indicates a package that cannot be installed alongside this package.
Conflicts: dependency
Replaces¶
Indicates that this package should replace another package. pacman
will
attempt to replace the old one with this package when it becomes aware of it
during a system upgrade.
Replaces: dependency
ExclusiveArch¶
Indicates that this package can only be compiled on the given architectures.
ExclusiveArch: x86_64
SourceX¶
Indicates a source to build a package with.
Source0: URL [with hashMethod hashValue] [with sig signatureFile] [with key pgpKey] [with keyserver keyserverURL]
PatchX¶
Indicates a patch to be applied on the package sources.
Patch0: URL [with hashMethod hashValue] [with sig signatureFile] [with key pgpKey] [with keyserver keyserverURL]
Hash Methods¶
Name |
|
---|---|
sha1 |
A sha1 sum to verify the source with |
sha224 |
A sha224 sum to verify the source with |
sha256 |
A sha256 sum to verify the source with |
sha384 |
A sha384 sum to verify the source with |
sha512 |
A sha512 sum to verify the source with |
md5 |
A md5 sum to verify the source with |
Directives¶
Build Recipe¶
Prepare¶
Commands to prepare the package for compilation. Normally, you can omit this directive and assume you’re starting in the extracted root of Source0 if it is a tarball and you don’t need to apply patches.
%prep
commands
Install¶
Commands to install the final package into the virtual filesystem for compressing.
%install
commands
Scriptlets¶
Small scripts that run at key points in transactions.
%scriptlet
commands
Scriptlet |
Description |
Arguments |
---|---|---|
|
Run before files are extracted when installing a package. |
|
|
Run after files are extracted when installing a package. |
|
|
Run before files are extracted when updating a package. |
|
|
Run after files are extracted when updating a package. |
|
|
Run before files are removed when removing a package. |
|
|
Run after files are removed when removing a package. |
|
Changelog¶
A changelog describing changes to a package.
%changelog
New in version 2.10
- More hellos!
- yadda yadda
Split Packages¶
Splitting packages.
Declaring a split package¶
%package (-n) name
Declares a new split package called $PARENT_NAME-$NAME
. If -n
is provided,
the name is used verbatim instead of appending it to the parent package’s name.
Moving files to a split package¶
%files (-n) name
Specifies a files section for a split package. Like %package
, -n
will cause
name
to be used verbatim. Files are listed based on their location in the parent
package, like so:
%files translationfiles
/usr/share/locale/*/LC_MESSAGES/hello.mo
Files are interpreted as regex.
The following macros are provided as shorthand for the GNU install directories:
Macro |
Default Location |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scriptlets¶
%scriptlet (-n) name
Key-Values¶
%package extension
Summary: A totally cool extension for %{name}