# Maintainer: Dominik Köppl <dominik@devwork.org>
#
# annual - Reminder for annual events
# Keeps track of all your anniversaries and hopefully reminds you at the right time.
# Copyright (C) 2011 Dominik Köppl
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
# 
# This program is distributed in the hope that it will be useful, but WITHOUT 
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.

pkgname=annual-git
_pkgname=annual
pkgver=20110809
pkgrel=1
pkgdesc='Reminds for annual events like birthdays, holidays, etc.'
arch=('i686' 'x86_64')
url='http://www.nongnu.org/annual/'
license=('GPL3')
depends=('qt>=4.6', 'perl-xml-xpath')
options=('strip')
conflicts=($_pkgname)

#install="$pkgname.install"
#source=($pkgname)

_gitroot="git://git.savannah.nongnu.org/$_pkgname.git"
_gitname="$_pkgname"

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 --depth=1 $_gitroot $_gitname
	fi
	msg "GIT checkout done or server timeout"
	msg "Starting make..."
	cd "$srcdir/$_gitname"
	cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo .
	make 
}

package() {
	cd "$srcdir/$_gitname"
	make DESTDIR=$pkgdir install
}
