Example PKGBUILDs are located in /usr/share/pacman/. An explanation of possible PKGBUILD variables can be found in the PKGBUILD article.
/usr/share/pacman/
PKGBUILD