On Mon, Jan 27, 2014 at 5:35 AM, Jeremy Audet <ichimonji10@gmail.com> wrote:
As for a better solution? Hmm. `install` (and probably other tools too) can reference user and group names directly. Thus, this:
install -o141 -g141 -dm750 "${pkgdir}/var/log/inspircd"
Could also be written as this:
install -o inspircd -g inspircd -dm750 "${pkgdir}/var/log/inspircd"
The problem with that is that the uid/gid for the permissions will be computed on the machine where the package is built, and there is no guarantee that the same uid/gid has the same name on another machine. Of course this isn't a problem if the package is only in the AUR, but it eliminates the option to prebuild the package (for inclusion in the official repositories, for instance). If you want an example, I've attached a simple bash script that demonstrates the behaviour by referencing "uidgidtestuser1" when building the package, then renaming that user to "uidgidtestuser2". The script will output a PKGBUILD, build the package, run sudo and manipulate users and install/uninstall the package, so MAKE SURE YOU READ THE SCRIPT before you run it. I take no responsibility for any damage caused by running it. /Emil Lundberg