I have a tree which I need to install with a foder named /usr. This folder exists in src folder. Now I need to write a function in PKGBUILD that installs to the fakeroot before the *.pkg.tar.gz is built. What needs to go in


package() {
    # I need to copy the 'usr' dir in 'srcdir' to PKGBUILD's fakeroot

According to the Arch Linux Wiki you should run something along the lines of make DESTDIR="$pkgdir/" install inside the package() function to install the files to the fakeroot directory. E.g.:

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install

If you don't use make in your project, you can look at what make install does and adapt it to your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.