You should get used to reading the Arch Wiki, Anyways It's Mentioned Here: https://wiki.archlinux.org/title/PKGBUILD
6.3 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 right 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.
this is a sample .install
file:
# This is a default template for a post-install scriptlet.
# Uncomment only required functions and remove any functions
# you don't need (and this header).
## arg 1: the new package version
pre_install() {
# do something here
}
## arg 1: the new package version
post_install() {
# do something here
}
## arg 1: the new package version
## arg 2: the old package version
pre_upgrade() {
# do something here
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
# do something here
}
## arg 1: the old package version
pre_remove() {
# do something here
}
## arg 1: the old package version
post_remove() {
# do something here
}