
However, this is not mandatory, as the only requirement in this context is correct bash syntax.
It is common practice to preserve the order of the PKGBUILD fields as shown above. Where possible, remove empty lines from the PKGBUILD ( provides, replaces, etc.). Try to keep the line length in the PKGBUILD below ~100 characters. Also try to keep the descriptions to ~80 characters or less. For example, "Nedit is a text editor for X11" could be simplified to "A text editor for X11". When creating a package description for a package, do not include the package name in a self-referencing way. The optdepends information is automatically printed out on installation/upgrade so one should not keep this kind of information in. The above example is taken from the wine package. Any optional dependencies that are not needed to run the package or have it generally function should not be included in the depends array instead the information should be added to the optdepends array:. This tool can analyze both PKGBUILD and the resulting package tarball and will warn you about bad permissions, missing dependencies, redundant dependencies, and other common mistakes. The namcap utility can help you in this regard.
Please take the time to verify them carefully, for example by running ldd on dynamic executables, checking tools required by scripts or looking at the documentation of the software. Dependencies are the most common packaging error.For example, if a package needs extra setup to work, directions should be included. All important messages should be echoed during install using an.error, msg, msg2, plain, warning) as they might change at any time.
The packager field from the package meta file can be customized by the package builder by modifying the appropriate option in the /etc/nf file, or alternatively override it by creating ~/.nf. Avoid using /usr/libexec/ for anything.
If a new variable or a new function is absolutely required, prefix its name with an underscore ( _), e.g.Do not introduce new variables or functions into PKGBUILD build scripts, unless the package cannot be built without doing so, as these could possibly conflict with variables and functions used in makepkg itself.Packages should never be installed to /usr/local/.Other prototypes are found in /usr/share/pacman/ from the pacman package. PKGBUILD prototype # Maintainer: Your Name You should also see the PKGBUILD(5) and makepkg(8) manpages. When building packages for Arch Linux, adhere to the package guidelines below, especially if the intention is to contribute a new package to Arch Linux.