# Contributor: nsf <no.smile.face@gmail.com>
pkgname=bmpanel2-git
pkgver=20111111
pkgrel=1
pkgdesc="The second major release of the known panel."
arch=("i686" "x86_64")
url="http://code.google.com/p/bmpanel2"
license=('MIT')
depends=('libxext' 'pango' 'libxinerama')
optdepends=('pygtk: bmpanel2cfg utility')
makedepends=('git' 'cmake' 'gcc' 'make' 'pkgconfig' 'asciidoc' 'python2')
provides=('bmpanel2')
conflicts=('bmpanel2')
#-----------------------------------------------------------------------------
# dependencies (* - direct deps, + - indirect deps):
#
# * libxext - XShape extension for draggable tasks (icons)
#   + libx11 - main X11 client-side protocol implementation
# * pango - text drawing
#   + cairo - raster/vector drawing
#   + glib2 - main loop
# * libxinerama - bmpanel2 uses it by default, but it can be configured
#                 to use libxrandr too/instead.
#
# and also optional dependencies:
#
# * pygtk - you should have this in order to use bmpanel2cfg utility
#   + python - and this too obviously
#
# make dependencies:
#
# * git
# * cmake
# * gcc
# * make
# * pkgconfig - bmpanel2 uses it in cmake a lot
# * asciidoc - it is used for man page generation via a2x tool
#   + docbook-xsl - it is required too
# * python - you need this to build bmpanel2cfg utility using setup.py
#-----------------------------------------------------------------------------
source=()

_gitroot="git://github.com/nsf/bmpanel2.git"
_gitname="bmpanel2"

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [ -d $_gitname ] ; then
    cd $_gitname && git pull origin
    msg "The local files are updated."
  else
    git clone $_gitroot
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"

  cd "$srcdir/$_gitname-build"
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DPYTHON_EXECUTABLE=/usr/bin/python2.7 . || return 1
  make || return 1
  make DESTDIR="$pkgdir/" install
} 
