archlinux-metapkg
This project is no longer maintained, although pull requests will still be accepted. It will eventually be superceded by superpac.
metapkg
creates metapackages for pacman
based upon METABUILD
files, which contain a concise syntax to describe what metapackages
should be built. For some examples of metapackages, see my
config-metapkgs
repo.
Syntax
METABUILD
files are constructed as a series of semicolon-separated
statements of the form:
.desc PACKAGE_NAME [PACKAGE_NAME ...] = VALID_STRING
.ver PACKAGE_NAME [PACKAGE_NAME ...] = VALID_STRING
.rel PACKAGE_NAME [PACKAGE_NAME ...] = VALID_STRING
[.deps] PACKAGE_NAME [PACKAGE_NAME ...] = PACKAGE_LIST
.optdeps PACKAGE_NAME [PACKAGE_NAME ...] = PACKAGE_LIST
.provides PACKAGE_NAME [PACKAGE_NAME ...] = PACKAGE_LIST
Where the .directive
keywords are case-insensitive.
Optionally, a statement may be prefixed with
.arch VALID_STRING [VALID_STRING ...]:
to indicate that the statement
will only be executed on a system whose architecture matches one in the
list. This, coupled with the fact that multiple .deps
, .optdeps
, and
.provides
statements are allowed, lets you add dependencies on certain
architectures without repeating yourself. Calling the .desc
, .ver
,
and .rel
directives twice will replace the contents of the fields.
Shell-style #
comments are also allowed, where information between the
#
and the end of the line is omitted by the parser.
A few more specifics:
-
PACKAGE_NAME
are validpacman
package names, containing alphanumerical ASCII characters, hyphens, underscores, at signs, and full stops. Package names may also not start with full stops or hyphens. -
PACKAGE_LIST
s are whitespace-delimited lists ofPACKAGE_NAME
s andMODIFIER
s. -
MODIFIER
s are either+
,-
,++
, or--
. -
VALID_STRING
s are either valid package names or string enclosed in double quotes, inside which double quotes may be escaped. Conveniently, valid version numbers inpacman
are also valid package names, although I've heard that if you use numbers for package names, you're a terrible person.
Modifiers
When an extra modifier is seen in a package list, it modifies the
list's state and changes how packages and groups are added to the
package list. The start state is +
. Modifiers include:
-
+
: Add following packages or groups to the dependencies for the metapackage. Shows an error if a package or group does not exist in the repositories or AUR and is not installed locally. -
-
: Removes following packages or groups from the dependencies for the metapackage. Shows an error if the package or group is not already in the dependency list. -
++
and--
: Same as+
and-
, although, the parsers continues without error if a package or group is not found.
Usage
To build the packages, simply run metapkg
in the same directory as
your METABUILD
file. This will create a pkg
directory with one
PKGBUILD
file for your metapackages. For safety reasons, metapkg
will not overwrite an existing PKGBUILD
file without the -f
option.