# Description: A console Jabber client. 
# URL: http://mcabber.com/
# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
# Depends on: ncurses

name=mcabber
version=0.9.10
release=1
source=(http://mcabber.com/files/$name-$version.tar.bz2)

build() {
  cd $name-$version
  sed -e '/#undef malloc/d' -e '/#undef realloc/d' -i config.h.in
  sed -e 's|`$PKG_CONFIG --cflags $pkg_config_args`|"-I$CLFS/usr/include/glib-2.0 -I$CLFS/usr/lib/glib-2.0/include"|g' -i configure
  ./configure --build=$CHOST \
              --host=$CTARGET \
              --disable-nls \
              --prefix=/usr  \
              --disable-glibtest
  sed -e '/#define realloc rpl_realloc/d' \
      -e '/#define malloc rpl_malloc/d' \
      -i config.h
  find -type f -name 'Makefile' \
    -exec sed -e "s|-I/usr|-I$CLFS/usr|g" -e "s|-O2 -O2|-O2|g" -i {} \;
  make 
  make DESTDIR=$PKG install
  rm -r $PKG/usr/share/mcabber
}