Okay, I'll do my best to explain it here but there is a wiki page on it: https://wiki.archlinux.org/index.php/PKGBUILD
Basically it's a text file that has information on the package (name, version, dependencies, description) and it has a list of commands on creating a folder called 'pkg' which is almost like a root system which is then compressed with the information by a script called makepkg. So, in reality the user could use makepkg and instead of installing the package file they could just use: cp -R --copy-contents pkg/* / as root and the files needed would be installed. An example is needed for clarification:
Code:
pkgname=todotxt-recur
pkgver=1.02
pkgrel=2
pkgdesc='Addon for todotxt in order to create recurring tasks'
arch=('i686' 'x86_64')
url='https://github.com/paulroub/todo.txt-recurring-tasks'
license=('none')
depends=('perl' 'todotxt')
source=(https://github.com/downloads/paulroub/todo.txt-recurring-tasks/Todotxt-Recur-$pkgver.tar.gz)
sha1sums=('cafdd4361a1bcb7c70a0b8259952f10e01d7e643')
build() {
cd ${srcdir}/Todotxt-Recur-${pkgver}
perl Makefile.PL INSTALLDIRS=vendor
make
}
package() {
cd ${srcdir}/Todotxt-Recur-${pkgver}
make install DESTDIR=${pkgdir}
rm -R $pkgdir/usr/bin
install -Dm755 recur $pkgdir/usr/share/todotxt-addons/recur
}
Also, it doesn't really matter what commands are in build and which are in package. It's just to help people who read the file.
Bookmarks