# Maintainer:  Federico Cinelli <cinelli@aur.archlinux.org>
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org

pkgname=gen2shp
pkgver=0.3.1
pkgrel=13
pkgdesc='Converts ArcInfo generate format to shapefile format'
arch=('x86_64')
url='http://www.intevation.de/~jan/gen2shp/'
license=('GPL')
depends=('glibc' 'shapelib')
source=("https://web.archive.org/web/20110716144136/http://intevation.de/~jan/gen2shp/$pkgname-$pkgver.tar.gz")
sha256sums=('eb84cbce842dcdf468e56f1e58ff666458bc14866345a495cc34b0d3dbad99c0')

build() {
  cd "$pkgname-$pkgver"

  # fix conflicting function names
  sed -i 's/getline/get_line/' gen2shp.c utils.c utils.h
  sed -i 's:libshp/::' gen2shp.c
  sed -i 's/-lshp gen2shp.c utils.o/gen2shp.c utils.o -lshp/' Makefile
  make CFLAGS="$CFLAGS"

}

package() {
  install -D "$pkgname-$pkgver/gen2shp" "$pkgdir/usr/bin/gens2shp"
}
