[arch-general] Package guidelines 📦

Alberto Salvia Novella es20490446e at gmail.com
Mon Oct 14 14:48:20 UTC 2019


I want to suggest including all or some of these in the package 
guidelines 
<https://wiki.archlinux.org/index.php/Arch_package_guidelines>, or the 
appropriate documentation:


*New items:*

- Write your PKGBUILD in a way that will work by itself as long as 
possible, for example by automatically generating the list of archives 
instead of hard coding them.

- As far as practicable don't work around bugs on the package, but fix 
them as upstream as possible.

- In package() "mv" locally built files, and "cp" or "install" the rest.

- In pkgdesc don't describe what the package is, but rather what it 
does. Using a natural wording that any person will understand. For 
example don't say "GTK UVC video viewer", but "Captures image from a 
webcam".

- If the license is a Creative Commons one, write it like "CCPL:by-sa".


*Modifications:*

- Start new variables and functions names with a capital letter, to 
avoid clashes with those in makepkg itself.

- In pkgver(), any printf() line shall finish with the new line char (\n).


*Useful functions:*

In package(), you can set permissions recursively with:
find "${pkgdir}" -type d -exec chmod u=rwx,g=rx,o=rx {} \;
find "${pkgdir}" -type f -exec chmod u=rw,g=r,o=r {} \;
chmod +x "${pkgdir}/usr/bin/${Name}"

In pkgver(), you can get the version from a web-site with something like 
this:
curl --silent "${url}" | grep "${string}" | cut --delimiter='"' --fields=1


(Reply to this email including me on the recipients list, or I won't 
receive it)


More information about the arch-general mailing list