Essien Ita Essien wrote:
> sounds interesting... very. Can you give s snippet from the resuling
> PKGBUILD? sorry i'm a bit slow with _only_ textual descriptions :)
>
>   
OK - see if this helps.

Firstly the case where one package is split-up.  For example the gcc 
PKGBUILD would look something like (with much stealing from current 
package builds):

build()
{
....
make || return 1
}

package()
{
#main
make -j1 DESTDIR=${startdir}/pkg/main install || return 1
rm -f ${startdir}/pkg/main/usr/lib/lib*
find ${startdir}/pkg/main -name libstdc++.mo -delete

#lib
make -j1 DESTDIR=${startdir}/pkg/lib install-target-libstdc++-v3 
install-target-libmudflap install-target-libgomp install-target-libssp 
|| return 1
rm -rf ${startdir}/pkg/lib/usr/include
rm -rf ${startdir}/pkg/lib/usr/lib/gcc
rm -rf ${startdir}/pkg/lib/usr/bin
rm -rf ${startdir}/pkg/lib/usr{,share}/man
find ${startdir}/pkg/lib -name gcc.mo -delete

#obc
...
}

Note the gcc package is installed in ${startdir}/pkg/main and the 
gcc-libs is installed in ${startdir}/pkg/libs.  That is it.... no other 
tricks!


Now the slightly more difficult case of supporting different 
configurations.  I'll use ettercap as an example as I have looked at it 
recently (see http://bugs.archlinux.org/task/4051 ).  Basically, it can 
have an optional GTK interface.  So you would end up with something like

build
{
cd $startdir/src/$origname-$origver

case "$1" in
  "gtk" )
    ./configure --prefix=/usr --sysconfdir=/etc --enable-plugins 
--enable-https
  ;;
  * )
    ./configure --prefix=/usr --sysconfdir=/etc --enable-plugins 
--enable-https  --disable-gtk
  ;;
esac

make || return 1
make DESTDIR=$startdir/pkg install

...
}

This would work with "makepkg" using the default case (*) and making 
package ettercap.  "makepkg gtk" would make ettercap-gtk.  If we were 
building foo-mysql and foo-prestgres then the default case would be 
"return 1" or some other error.

Note that I have concerns that this way of providing multiple 
configuration options may make things too complicated with needing case 
statements for provides/conflicts, configure options, etc...  But then 
again, it may still be better than providing multiple PKGBUILDS.  I'm 
still trying to improve this so more suggestions are alway welcome! :)

Allan




_______________________________________________
arch mailing list
[email protected]
http://archlinux.org/mailman/listinfo/arch

Reply via email to