Hello,
This isn't correct, see the license section of the PKGBUILD wiki page.
You may want to link the page (with the section you are referencing), and it is not under makepkg, it is under PKGBUILD: https://wiki.archlinux.org/title/PKGBUILD#license If you are still confused, TL;DR the licence is not included within the generic licences package, see: https://archlinux.org/packages/core/any/licenses/ This therefore means, you have to install the licence which is distributed with the source into the licence directory, under the name of the package.
This entire prepare function is just wrong. The PKGBUILD shouldn't be doing different things based on what random things it might find on the system.
I will elaborate on this a little to avoid confusion. the PKGBUILD is a file which describes how to create the package, this is done platform independently, for example when arch linux developers build packages, they are built in a clean chroot with nothing but base-devel and the dependencies needed for the package. This means including scripts inside your PKGBUILD to change how the package is built breaks the PKGBUILD and also will not work. There is the .install file, which can do modification to the host system when the package is being installed, but I do not think this will deem useful in this situation, but for more information see the man pages. Hope this helps, -- Polarian GPG signature: 0770E5312238C760 Website: https://polarian.dev JID/XMPP: polarian@polarian.dev