From f834c1e2fc2aff4c7b42a6aed365f580d5a8587a Mon Sep 17 00:00:00 2001
From: Chris Oelmueller <chris.oelmueller@gmail.com>
Date: Tue, 25 Jun 2013 12:38:12 +0200
Subject: [PATCH] ghmm: 0.9_rc2-1 (Version bump and PKGBUILD updates)

In detail:
* fix `optdepends` (contained something also present in `depends`)
* add `makedepends`
* move preparation code to `prepare`
* add package conflict with ghmm-svn
* add comments on binary moving (from ghmm-svn)
* adopt package
---
 .SRCINFO | 15 ++++++++++-----
 PKGBUILD | 36 +++++++++++++++++++++++-------------
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/.SRCINFO b/.SRCINFO
index b1a413acc34..75a509a9c4b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,23 @@
 pkgbase = ghmm
 	pkgdesc = General Hidden Markov Model library
-	pkgver = 0.9_rc1
-	pkgrel = 3
+	pkgver = 0.9_rc2
+	pkgrel = 1
 	url = http://ghmm.org
 	arch = i686
 	arch = x86_64
 	license = LGPL
+	makedepends = automake
+	makedepends = autoconf
+	makedepends = m4
+	makedepends = swig
 	depends = gsl
 	depends = libxml2
-	optdepends = gsl
 	optdepends = python2
 	optdepends = python2-pygsl
-	source = http://sourceforge.net/projects/ghmm/files/ghmm/ghmm%200.9-rc1/ghmm-0.9-rc1.tar.gz
-	md5sums = 34d09198401f3a3d6ea04dc8280cdb25
+	conflicts = ghmm-svn
+	source = http://sourceforge.net/projects/ghmm/files/ghmm/ghmm%200.9-rc2/ghmm-0.9-rc2.tar.gz
+	md5sums = 9be708ffcb17eb23f4cdb3971c11f471
+	sha256sums = 6a6a90b47f9a363d3f6e3283e34a986237dbde1196ab9f39dbb7dc2cf3eff057
 
 pkgname = ghmm
 
diff --git a/PKGBUILD b/PKGBUILD
index 2e7938f395d..743a7b70156 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,32 +1,42 @@
-# Maintainer: Michael Schubert <mschu.dev at gmail>
-# Contributor: languiar <languitar at semipol dot de>
+# Maintainer: Chris Oelmueller <chris.oelmueller@gmail.com>
+# Contributor: Michael Schubert <mschu.dev at gmail>
+# Contributor: dave pretty <david (dot) pretty (at) gmail (dot) com >
 
 pkgname=ghmm
-pkgver=0.9_rc1
+pkgver=0.9_rc2
 _pkgver=${pkgver//_/-}
-pkgrel=3
+pkgrel=1
 pkgdesc="General Hidden Markov Model library"
 arch=('i686' 'x86_64')
 url="http://ghmm.org"
 license=('LGPL')
 depends=('gsl' 'libxml2')
-optdepends=('gsl' 'python2' 'python2-pygsl')
-source=("http://sourceforge.net/projects/ghmm/files/ghmm/ghmm%200.9-rc1/$pkgname-$_pkgver.tar.gz")
-md5sums=('34d09198401f3a3d6ea04dc8280cdb25')
+makedepends=('automake' 'autoconf' 'm4' 'swig')
+optdepends=('python2' 'python2-pygsl')
+conflicts=('ghmm-svn')
+source=("http://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgname%20${_pkgver}/$pkgname-${_pkgver}.tar.gz")
+md5sums=('9be708ffcb17eb23f4cdb3971c11f471')
+sha256sums=('6a6a90b47f9a363d3f6e3283e34a986237dbde1196ab9f39dbb7dc2cf3eff057')
 
-build() {
-  cd "$pkgname-$_pkgver"
+prepare() {
+  cd "$srcdir/$pkgname-$_pkgver"
   mv configure.in configure.ac
   sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac
+}
 
+build() {
+  cd "$srcdir/$pkgname-$_pkgver"
   ./autogen.sh
   PYTHON=/usr/bin/python2 ./configure --prefix=/usr
-  make 
+  make
 }
 
 package() {
-  cd "$pkgname-$_pkgver"
-  make prefix="$pkgdir/usr" install
+  cd "$srcdir/$pkgname-$_pkgver"
+  make prefix="$pkgdir/usr" install # does not support DESTDIR
+
+  # Name clash with graphviz also installing a `cluster` binary.
+  # ghmm has fewer users than graphviz and is obsolete according to
+  # docs, so I currently prefer renaming the ghmm-provided `cluster`.
   mv "$pkgdir/usr/bin/cluster" "$pkgdir/usr/bin/ghmm-cluster"
 }
-