Building Arch Linux Package from precompiled Binaries.
This article shows how to create an Arch Linux package
1) when you have got pre-compiled binary files available
or
2) have debian/fedora .deb/.rpm packages available and you have extracted them and got usr/, etc/, etc. directories with installable files in them. Hence want to convert deb/rpm packages into Arch Linux packages.
For this you have to create a directory structure let say
~/foobar/src
Also create ~/foobar/PKGBUILD.
Edit this PKGBUILD file and put in it
See https://wiki.archlinux.org/index.php/PKGBUILD for more info on individual line.
The main thing here is to include package() function to PKGBUILD which copies all files to package.
Now copy your binaries directory structure to src. e.g.
if you have /usr/bin/yourprogram /usr/share/files* /etc/* etc. after unpacking a distro package then put them as ~/foobar/src/usr/bin/yourprogram, ~/foobar/src/usr/share/files*, ~/foobar/src/etc/* etc.
Now open terminal emulator in ~/foobar directory and run
This will generate abc.pkg.tar.xz file in your current directory.
abc is name supplied for the package name in PKGBUILD.
Now you can install it via
1) when you have got pre-compiled binary files available
or
2) have debian/fedora .deb/.rpm packages available and you have extracted them and got usr/, etc/, etc. directories with installable files in them. Hence want to convert deb/rpm packages into Arch Linux packages.
For this you have to create a directory structure let say
~/foobar/src
Also create ~/foobar/PKGBUILD.
Edit this PKGBUILD file and put in it
Quote:
pkgname=Test
pkgver=1.0
pkgrel=1
pkgdesc="Test package."
arch=('i686' 'x86_64')
url="home"
license=('GPL')
depends=('bash')
package() {
cp -r * $pkgdir
}
pkgver=1.0
pkgrel=1
pkgdesc="Test package."
arch=('i686' 'x86_64')
url="home"
license=('GPL')
depends=('bash')
package() {
cp -r * $pkgdir
}
The main thing here is to include package() function to PKGBUILD which copies all files to package.
Now copy your binaries directory structure to src. e.g.
if you have /usr/bin/yourprogram /usr/share/files* /etc/* etc. after unpacking a distro package then put them as ~/foobar/src/usr/bin/yourprogram, ~/foobar/src/usr/share/files*, ~/foobar/src/etc/* etc.
Now open terminal emulator in ~/foobar directory and run
Code:
makepkg
abc is name supplied for the package name in PKGBUILD.
Now you can install it via
Code:
pacman -U abc.pkg.tar.xz
Total Comments 0