[pacman-dev] Splitting packages in makepkg

Mark Constable markc at renta.net
Fri Jun 13 09:42:09 EDT 2008


This is purely FWIW and I am *not* suggesting it be considered as the
canonical way to provide split packages. It provides a test case for
one approach that I have been using for months without requiring any
patches to makepkg. Probably best demonstrated as a psuedo example...

# cat PKGBUILD
pkgname=qt-copy
pkgver=4.4.0   
... etc

build()
{      
  # regular main package build instructions

  build_doc
  build_dev
}

build_doc()
{
  mv $pkgdir $pkgdir.orig && mkdir $pkgdir || return 1
  mkdir -p $pkgdir/{usr/bin,usr/share/doc}
  mv $pkgdir.orig/usr/share/doc/* $pkgdir/usr/share/doc

  cd $startdir
  makepkg --asroot -R -p PKGBUILD.doc
  rm -rf $pkgdir
  mv $pkgdir.orig $pkgdir
  cd $srcdir/$pkgname-$pkgver
}

build_dev()
{
  mv $pkgdir $pkgdir.orig && mkdir $pkgdir || return 1
  mkdir -p $pkgdir/{usr/bin,usr/include}
  mv $pkgdir.orig/usr/include/* $pkgdir/usr/include
# lazy
  mv $pkgdir.orig/usr/bin/* $pkgdir/usr/bin # mv all bins to dev
  mv $pkgdir/usr/bin/qtconfig $pkgdir.orig/usr/bin # mv qtconfig back
  mv $pkgdir/usr/bin/qdbus $pkgdir.orig/usr/bin # mv qdbus back

  cd $startdir
  makepkg --asroot -R -p PKGBUILD.dev
  rm -rf $pkgdir
  mv $pkgdir.orig $pkgdir
  cd $srcdir/$pkgname-$pkgver
}

------------------------------

# cat PKGBUILD.doc
pkgname=qt-copy-doc
pkgver=4.4.0
pkgrel=$(date +%Y%m%d)
pkgdesc="The Qt Gui Toolkit Documentation"
url="http://www.trolltech.com/products/qt"
arch=(any)
source=($pkgname-$pkgver.tar.gz)
license=(GPL)

------------------------------

# cat PKGBUILD.dev
pkgname=qt-copy-dev
pkgver=4.4.0
pkgrel=$(date +%Y%m%d)
pkgdesc="The Qt Gui Toolkit Development Files"
url="http://www.trolltech.com/products/qt"
arch=(i686 x86_64)
source=($pkgname-$pkgver.tar.gz)
license=(GPL)


--markc




More information about the pacman-dev mailing list