PKGBUILD(5) Pacman PKGBUILD(5) (NAME) PKGBUILD - (SYNOPSIS) PKGBUILD (DESCRIPTION) PKGBUILD . PKGBUILD makepkg pacman . PKGBUILD /usr/share/pacman . PKGBUILD.proto . (OPTIONS AND DIRECTIVES) PKGBUILD . makepkg . PKGBUILD pkgname pkgver pkgrel arch. _ () . makepkg . $_basekernver . pkgname (array) (split packages). : "@ . _ + -". . pkgver ( 2.7.1). () . pkgver pkgver() PKGBUILD . prepare() ( ) pkgver . ( ). pkgrel . . 1 PKGBUILD . ( x.y). epoch epoch . 0 . ( - ) . pacman(8) . pkgdesc . . url URL . . license (array) . : license=('GPL' 'FDL'). install . PKGBUILD makepkg . source ( install=$pkgname.install). changelog (changelog) . . PKGBUILD makepkg . source ( changelog=$pkgname.changelog). source (array) . PKGBUILD URL makepkg . PKGBUILD $pkgname $pkgver . noextract . source_x86_64=(). cksums_x86_64=(). . : source=('filename::url'). makepkg (VCS) . . source .sig, .sign .asc makepkg PGP . validpgpkeys (array) (fingerprints) PGP. makepkg (keyring) . (subkey) makepkg . . . noextract (array) source. . . cksums (array) CRC source ( ) . makepkg . SKIP . cksum "makepkg -g >> PKGBUILD" . cksums . "makepkg -g" . md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums, b2sums (arrays) makepkg cksums . INTEGRITY_CHECK makepkg.conf(5) . groups (array) . KDE kde . arch (array) ( arch=('i686' 'x86_64')). arch=('any') . "_" . backup (array) . /etc . "Handling Config Files" pacman(8) . depends (array) . . name<>version <> : >= ( ) <= ( ) = () > ( ) < ( ). ( .so ) makepkg . . depends_x86_64=(). makedepends (array) . depends . makedepends_x86_64=(). checkdepends (array) . depends . check() makepkg . checkdepends_x86_64=(). optdepends (array) ( ) . optdepends pacman . depends . optdepends : optdepends=('python: for library bindings') optdepends_x86_64=(). conflicts (array) ( ). depends . depends . conflicts_x86_64=(). provides (array) " " . . dcron cron dcron OR fcron cron . name=version . dcron cron=2.0 cron>=2.0 . > < . ( .so ) makepkg . . provides_x86_64=(). replaces (array) . . j2re jre . depends . Sysupgrade pacman . . replaces_x86_64=(). options (array) makepkg (override) . options . "!" . makepkg.conf(5) . : force epoch . strip (symbols) . . docs (doc). !docs . libtool libtool (.la) . !libtool . staticlibs (.a) . ( ) !staticlibs . emptydirs . zipman (man) info gzip. ccache ccache build(). !ccache ccache . distcc distcc build(). !distcc distcc . buildflags (CPPFLAGS CFLAGS CXXFLAGS LDFLAGS) build() makepkg.conf(5) . !buildflags . makeflags makeflags build() makepkg.conf(5) . !makeflags -j2 ( ) . debug (DEBUG_CFLAGS DEBUG_CXXFLAGS) makepkg.conf(5) . `strip' . lto (Link Time Optimization). -flto CFLAGS CXXFLAGS . options_x86_64=(). xdata (array) . pacman makepkg . key=value key value . "pkgtype" makepkg . (PACKAGING FUNCTIONS) PKGBUILD . PKGBUILD package() prepare() build() check() . makepkg (source) . makedepends . local . package() package() . fakeroot . makepkg . $srcdir . verify() verify() . . . $startdir . prepare() prepare() (patching) . build() . prepare() . $srcdir . build() build() / package() . $srcdir . check() check() . build() package() . checkdepends . $srcdir . $pkgname $pkgver . makepkg : srcdir makepkg . pkgdir makepkg . . package() . startdir PKGBUILD $(pwd) makepkg . . (PACKAGE SPLITTING) makepkg PKGBUILD . pkgname . package_foo() foo . PKGBUILD . () : pkgdesc arch url license groups depends optdepends provides conflicts replaces backup options install changelog. makepkg --syncdeps . depends makedepends . : pkgbase makepkg . pkgname . : "@ . _ + -". . // (INSTALL/UPGRADE/REMOVE SCRIPTING) Pacman . . . . " " epoch pkgver-pkgrel epoch:pkgver-pkgrel . pre_install . : . post_install . : . pre_upgrade . : . post_upgrade . : . pre_remove . : . post_remove . : . pkgname.install PKGBUILD . install : install=pkgname.install source . /usr/share/pacman proto.install . (USING VCS SOURCES) (VCS) : source=('directory::url#fragment?query') makepkg Bazaar Git Subversion Fossil Mercurial . prepare() . VCS Git "git archive" . (URL) : directory () VCS makepkg . url URL VCS . makepkg VCS VCS URL . VCS vcs+ URL . Git HTTPS : git+https://.... fragment () (revision) makepkg VCS . type=value source=(url#revision=123) . VCS : bzr revision ( 'bzr help revisionspec' ) fossil branch, commit, tag git branch, commit, tag hg branch, revision, tag svn revision query () VCS PGP . source=(url#fragment?signed) source=(url?signed#fragment) . Git . (EXAMPLES) PKGBUILD patch . . # Maintainer: Joe User pkgname=patch pkgver=2.7.1 pkgrel=1 pkgdesc="A utility to apply patch files to original sources" arch=('i686' 'x86_64') url="https://www.gnu.org/software/patch/patch.html" license=('GPL') groups=('base-devel') depends=('glibc') makedepends=('ed') optdepends=('ed: for "patch -e" functionality') source=("ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig}) sha256sums=('9124ba46db0abd873d0995c2ca880e81252676bb6c03e0a37dfc5f608a9b0ceb' 'SKIP') build() { cd "$srcdir/$pkgname-$pkgver" ./configure --prefix=/usr make } package() { cd "$srcdir/$pkgname-$pkgver" make DESTDIR="$pkgdir/" install } (SEE ALSO) makepkg(8), pacman(8), makepkg.conf(5) pacman pacman https://archlinux.org/pacman . (BUGS) . https://gitlab.archlinux.org/pacman/pacman/-/issues . (AUTHORS) : o Allan McRae o Andrew Gregory o Morgan Adamiec : o Judd Vinet o Aurelien Foret o Aaron Griffin o Dan McGee o Xavier Chantry o Nagy Gabor o Dave Reisner o Eli Schwartz git shortlog -s pacman.git . Pacman 7.1.0 2026-05-06 PKGBUILD(5)