Tired of all the clutter makepkg-template causes in your PKGBUILD? Use makepkg-expanded to build them leaving the template markers exactly as you wrote them. It will
- build a package without any change to the PKGBUILD,
- only propagating changes caused by a
pkgver
function and - batch build all your packages in one go, also preparing them for AUR upload.
- It also is aware of git and can use a directory of repository-wide templates.
For more details and options, see the manual page.
Many functionalities are also available as separate or additional tools and can ease life dealing with PKGBUILDs and the AUR even without templates.
- cp-pkgver copies version variables from one PKGBUILD to another. It can be used by makepkg-expanded to propagate changes from the expanded variant back to the original script.
- clean-templates removes template markers, mode lines and duplicate templates to make the result looks more like an ordinary PKGBUILD. It is automatically invoked my makepkg-expanded by default.
- graph-templates helps to keep an overview of templates, build scripts and their relations. A gvpr script is also included to restrict the graph to reachable nodes, which represent actually used templates.
- aurbranch commits the PKGBUILD and related files to a dedicated branch suitable to push to the AUR. It can not only be used directly in the
-r
option of makepkg-expanded, but is generally usable when a slightly changed variant of a repository should be pushed to the AUR. - auradopt helps to prepare such a branch with an existing history.
- offbranch is a tool to allow commits to a git branch without checking it out. It provides the Git-centric functionalities aurbranch uses, but is completely agnostic of any AUR or pacman related specialities as is
- offremote which prepares remotes tracking exactly one branch of another repository. It is normally invoked automatically by aurbranch when it creates a new distribution branch and used by aurremote.
You can learn about how to use all of these in concert with this tutorial.
As it is probably only useful in Arch Linux, anyways, go grab it from the AUR.
To use the PKGBUILD as it is kept in this repository, the makepkg-template for git has to be installed.
To use makepkg-expanded, only pacman is needed, as it includes makepkg-template. For aurbranch to automatically generate .SRCINFO files, makepkg is needed, which is also included in pacman.
The repository-oriented tools offbranch, aurbranch and aurremote need git.
The output of graph-templates can be processed further using graphviz, which can also execute reachable.gvpr.
The rest, cp-pkgver and clean-templates, function even just with bash and sed.