pkgname=ncid
pkgver=0.71
pkgrel=2
pkgdesc="daemon to display callerid"
url="http://ncid.sourceforge.net/"
license=""
depends=(ghosd python)
makedepends=()
conflicts=()
replaces=()
backup=()
arch=('i686')
install=ncid.install
 #wget http://internap.dl.sourceforge.net/sourceforge/ncid/ncid-0.71-src.tar.gz

source=(http://internap.dl.sourceforge.net/sourceforge/ncid/$pkgname-$pkgver-src.tar.gz  ncidd.conf ncid.conf ncid.py ncidpermissions.sql ncid.sql)
md5sums=()

build() {
cd $startdir/src/$pkgname
#cd $startdir/src/
  ./configure --prefix=/usr
  make clean
  make package  || return 1
  mkdir -p $startdir/pkg/usr/bin
  mkdir -p $startdir/pkg/usr/sbin
  mkdir -p $startdir/pkg/etc/ncid
  cp $startdir/*.conf $startdir/pkg/etc/ncid
  install -m 755 ncidd $startdir/pkg/usr/sbin
  install -m 755 ncid $startdir/pkg/usr/bin

  mkdir -p $startdir/pkg/usr/share/man/man1
  mkdir -p $startdir/pkg/usr/share/man/man5
  mkdir -p $startdir/pkg/usr/share/man/man8
   cd man
  install -m 644 ncid.1 ncidscripts.1 ncidtools.1 $startdir/pkg/usr/share/man/man1
  install -m 644 ncid.conf.5 ncidd.conf.5 ncidd.alias.5 ncidscript.conf.5 $startdir/pkg/usr/share/man/man5
  install -m 644 ncidd.8 $startdir/pkg/usr/share/man/man8
   cd -
   mkdir -p $startdir/pkg/var/log
   touch $startdir/pkg/var/log/cidcall.log
cd scripts 

mkdir -p $startdir/pkg/usr/share/ncid/
install -m 755 $startdir/src/ncid-osd $startdir/pkg/usr/share/ncid
install -m 755 ncidrotate ncid-page ncid-samba ncid-speak $startdir/pkg/usr/share/ncid
install -m 644 README $startdir/pkg/usr/share/ncid/
cd -
cd tools
mkdir -p $startdir/pkg/usr/bin
install -m 755  cidlog cidalias cidlogupd  $startdir/pkg/usr/bin
cd -
install -m 755  $startdir/src/ncid.py   $startdir/pkg/usr/bin


install -m 755 -D  $startdir/src/ncid.sql  $startdir/pkg/tmp/ncid.sql
install -m755 -D $startdir/src/ncidpermissions.sql  $startdir/pkg/tmp/ncidpermissions.sql  
chmod 777 $startdir/pkg/tmp
  #make DESTDIR=$startdir/pkg install
  #mkdir -p $startdir/pkg/usr/local/bin
#  cp putfifo $startdir/pkg/usr/local/bin/
#  cp onscreend $startdir/pkg/usr/local/bin/ 
}