# Maintainer:  Federico Cinelli   <cinelli@aur.archlinux.org>

pkgname=gpsmanshp
pkgver=1.2.3
pkgrel=5
pkgdesc="A Tcl package to read and write shapefiles"
arch=('x86_64')
url="http://gpsmanshp.sourceforge.net/"
license=('GPL')
depends=('glibc' 'shapelib' 'tcl')
source=("https://sourceforge.net/projects/$pkgname/files/distr/${pkgname}_$pkgver.tgz")
sha256sums=('2803524aa8f87db6ff1eaec93cef9619c944c9aa00149e554be11f6e2f1cafd2')

prepare() {
  cd "${pkgname}_$pkgver"
  sed -i "s|8.4|8.6|g" Makefile8.5
}

build() {
  cd "${pkgname}_$pkgver"
  make -f Makefile8.5 TCLVERSION=8.6
}

package() {
  cd "${pkgname}_$pkgver"
  install -d "$pkgdir"/usr/lib/gpsmanshp
  make -f Makefile8.5 TCLVERSION=8.6 INSTALLDIR="$pkgdir"/usr/lib/gpsmanshp install
}
