I have a .deb debian package which essentially contains the binaries of the software as a /usr/share/bin folder in a compressed data file, and another metadata compressed file containing the checksums of the other files.

My goal is to create a PKGBUILD to install such .deb package correctly on archlinux.

What's the proper way to do that?

Is enough to copy the contents of that /usr/share/bin directory into the pkg /usr/share/bin fakeroot environment using the build() function? The folder will be copied to the true /usr/share/bin location when the builded package is actually installed?

  • 7
    Essentially, yes (except use the package function). Look in the AUR for other packages ending with -bin and use the same approach...
    – jasonwryan
    Aug 27, 2014 at 7:59

1 Answer 1


Yes, it will work in the same way as other PKGBUILDs with binary sources - extract it and copy files. The only thing which should be mentioned is that deb-archive consists of 3 other files - debian-binary, control.tar.gz, data.tar.gz. makepkg will extract only first-level archive and then you should manually extract data.tar.gz.

prepare() {
    tar -zxvf data.tar.gz
    #tar -xvf data.tar.xz    # if archives are .tar.xz instead of .tar.gz

package() {
    # copy files

Alternatively, you can place deb-archive in noextract array and then manually extract only data.tar.gz:

$ ar p source.deb data.tar.gz | tar zx
  • makepkg changes the current directory to $srcdir before executing functions, so you don't need to include that anymore...
    – jasonwryan
    Aug 27, 2014 at 18:11
  • @jasonwryan, several developers have stated that there's no guarantee that such will remain true. For longevity's sake, it may make sense to leave the customary cd "${srcdir}" line in place.
    – HalosGhost
    Aug 28, 2014 at 3:08
  • 1
    @HalosGhost I'd not heard that. By the same logic, there is no guarantee that it will become false... :)
    – jasonwryan
    Aug 28, 2014 at 3:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .