# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: wahnby <wahnby@yahoo.fr>

pkgname=gnunet-svn
pkgver=0.10.1
pkgrel=1
pkgdesc="A framework for secure peer-to-peer networking"
arch=('i686' 'x86_64')
url="http://gnunet.org"
license=('GPL')
depends=('gmp' 'libgcrypt' 'libextractor' 'sqlite' 'gnurl'
	 'libmicrohttpd' 'libunistring' 'libidn')
makedepends=('gettext' 'pkgconfig'
	     'bluez-libs' 'python' 'glpk' 'libpulse' 'opus'
             'automake' 'autoconf')
optdepends=('bluez-libs'
	    'python'
	    'glpk'
	    'libpulse'
	    'opus')
backup=(etc/gnunet.conf)
options=('!makeflags')
source=(svn+https://gnunet.org/svn/gnunet/
	$pkgname.service
	defaults.conf
	rps-Makefile.am.diff)
md5sums=('SKIP'
         '89d74b4dda2698476d31c22e1f3ccbff'
         'c187fa340cd0a8c836b69ced221582cc'
         'ffa071953ad527614ed85901990603c1')

build() {
  patch $srcdir/gnunet/src/rps/Makefile.am < rps-Makefile.am.diff
  cd $srcdir/gnunet
  ./bootstrap
  [ -f Makefile ] || ./configure --prefix=/usr --enable-experimental
  make
}

package() {
  cd $srcdir/gnunet
  make DESTDIR=$pkgdir install
  install -D -m0644 $srcdir/defaults.conf $pkgdir/etc/gnunet.conf
  rm -rf $pkgdir/usr/include/libltdl $pkgdir/usr/lib/libltdl.* $pkgdir/usr/include/ltdl.h
  install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
}
