Why don't you thoroughly read the wiki page that you linked:
Packages in Arch Linux are built using the makepkg utility and
information stored in PKGBUILDs. When makepkg is run, it
searches for a PKGBUILD in the current directory and follows the instructions therein to either compile or otherwise acquire the
files to build a package file
Therefore, PKGBUILD
is a "recipe" for creating a package (similar to a RPM
spec
, gentoo
ebuild
etc). Sometimes, when a package is installed/removed/upgraded, it may require some scripts/programs to be automatically executed before/after the package files are written to/removed from disk so an additional "recipe" is needed, i.e. .install
(excerpt from the same link):
install
The name of the .install script to be included in the package. pacman
has the ability to store and execute a package-specific script when it
installs, removes or upgrades a package. The script contains the
following functions which run at different times:
pre_install - The script is run right before files are extracted. One argument is passed: new package version.
post_install - The script is run right after files are extracted. One argument is passed: new package version.
pre_upgrade - The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.
post_upgrade - The script is run after files are extracted. Two arguments are passed in the following order: new package version, old package version.
pre_remove - The script is run right before files are removed. One argument is passed: old package version.
post_remove - The script is run right after files are removed. One argument is passed: old package version.
Usually, you edit PKGBUILD
to customize the way the package is built (e.g. add/remove --configure
options, change install prefix, patch the source code, exclude files from the package etc). Likewise, you edit .install
to add or remove commands that should be automatically executed before/after a package install/upgrade/removal.
I'd say it's good practice to open those files when prompted and read their content just to make sure everything is OK.