# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Samuel Fernando Mesa <samuelmesa dot linuxmail.org>

pkgname=librttopo
pkgver=1.1.0
pkgrel=5
pkgdesc="RT Topology Library"
arch=(x86_64 aarch64)
url="https://git.osgeo.org/gitea/rttopo/librttopo"
license=(GPL2)
depends=(geos)
source=(https://gitlab.com/rttopo/rttopo/-/archive/$pkgname-$pkgver/rttopo-$pkgname-$pkgver.tar.gz
        postgis-15444-security-fix.patch)
sha256sums=('22ebb43da155f660016ce8be94d5cb39c8e46d97d27a77f8163c6733adc09727'
            '759e5137b49b01af7ccb4d40dcc673a004c6b1461b74d624be18787a960863fb')

prepare() {
  cd rttopo-$pkgname-$pkgver
  patch -p1 < ../postgis-15444-security-fix.patch
  ./autogen.sh
}

build() {
  cd rttopo-$pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd rttopo-$pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
}
