This repository collects templates for pacman's makepkg-template capturing most of the VCS package guidelines from the Arch Linux Wiki. They will
- add git as a make dependency,
- care for the built package to provide and conflict with its non-git variant and
- clone
$url
as a package source, to be placed into the$srcdir
as$pkgname
, without its -git suffix.
- These can be overwritten by setting
$_giturl
and$_gitname
, respectively, before inputting the template.
- Also, a
pkgver
function will be inserted. It uses tags if available and automatically fall back to counting revisions otherwise.
To use it, install this package, add a line like
# template input; name=git
to your PKGBUILD and process it with makepkg-template
. See the PKGBUILD of git-makepkg-templates itself for an example.
The components are available in different granularities.
-
If you only need a
pkgver
function and care for sources and dependencies yourself, just includegit-pkgver
. -
To achieve the inverse and just get points (1) to (3) of the above list, use
git-source
. -
git-revcount
provides even less and serves just a single line to generate a revision counting version. This should be prepended to version strings that are generated from information within the repository files, to clearly distinguish them from their non-git counterparts. Include it last in a relevantpkgver
function, while the commands before finish up with a dot, omitting a trailing newline. For example, when the version is noted in a plain file calledversion
, writepkgver() { cat version | tr "\n" "." # template input; name=git-revcount }
It also does not append a newline, so after it, you may add further information, like branches, experimental state or similar.
-
The
git
template provides everything combined.