[pacman-dev] Splitting packages in makepkg

Sergej Pupykin pupykin.s at gmail.com
Tue Jun 17 09:31:28 EDT 2008


Modified idea:

PKGBUILD
------------------
pkgname=foobar
pkgver=1.0
pkgrel=1
subpackages=(dev doc)
pkgdesc="base package desc"
pkgdesc_dev="foo dev desc"
....

build() {

 .....

 make DESTDIR=$startdir/pkg install
 ...
 make DESTDIR=$startdir/pkg-dev install
 ...
 make DESTDIR=$startdir/pkg-doc install
}
---------------

According to subpackages array makepkg creates 3 dirs:
- $startdir/pkg (as usually)
- $startdir/pkg-dev
- $startdir/pkg-doc

PKGBUILDs build function install all stuff into them

And then, makepkg creates 3 packages:

$pkgname-...pkg.tar.gz (if $startdir/pkg is not empty)
$pkgname-dev-...pkg.tar.gz (if $startdir/pkg-dev is not empty)
$pkgname-doc-...pkg.tar.gz (if $startdir/pkg-doc is not empty)

May be I am not too famillar with bash, but you can get pkgdesc_dev at
least with construction like this:
$ export pkgdesc_dev="foo dev desc"
$ export pkgdescname=pkgdesc_dev
$ echo `bash -c  "echo \$\`echo $pkgdescname\`"`
foo dev desc

It can be easy modified for full package names as I described above:
subpackages=(foo foo-dev foo-doc kmail kopete)
or
pkgname=(foo foo-dev foo-doc kmail kopete)




More information about the pacman-dev mailing list