As for a better solution? Hmm. `install` (and probably other tools too) can reference user and group names directly. Thus, this:
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).
It won't work for packages from AUR either. `install` would be called before .install script is able to useradd and groupadd. Only package updates would work.
I've attached a simple bash script
You forgot to attach the script or ML stripped it.