# Contributor: Bjoern Schilberg <bjoern@intevation.de>
# Maintainer: Bjoern Schilberg <bjoern@intevation.de>
pkgname=mapserver
pkgver=7.0.7
pkgrel=0
pkgdesc="MapServer is CGI-based platform for publishing spatial data and interactive mapping applications to the web."
url="http://mapserver.org/"
arch="x86_64"
license="MIT"
depends="geos gdal proj4 cairo curl fcgi freetype libjpeg libpng libxml2 libpq giflib"
depends_dev="cmake postgresql-dev geos-dev gdal-dev jpeg-dev giflib-dev libxml2-dev proj4-dev fcgi-dev curl-dev freetype-dev cairo-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev"
source="http://download.osgeo.org/mapserver/$pkgname-$pkgver.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	mkdir build; cd build
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DWITH_GDAL=ON \
		-DWITH_GEOS=ON \
		-DWITH_OGR=ON \
		-DWITH_PROJ=ON \
		-DWITH_POSTGIS=ON \
		-DWITH_KML=ON \
		-DWITH_WCS=ON \
		-DWITH_SOS=ON \
		-DWITH_WMS=ON \
		-DWITH_CLIENT_WMS=ON \
		-DWITH_WFS=ON \
		-DWITH_CLIENT_WFS=ON \
		-DWITH_THREAD_SAFETY=OFF \
		-DWITH_FCGI=ON \
		-DWITH_CAIRO=ON \
		-DWITH_CURL=ON \
		-DWITH_MYSQL=OFF \
		-DWITH_FRIBIDI=OFF \
		-DWITH_HARFBUZZ=OFF \
		-DWITH_EXEMPI=OFF
	make -j1 || return 1
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install || return 1
	rm -rf "$pkgdir"/usr/share/
	chmod -x "$pkgdir"/usr/include/mapserver/*.h
}

sha512sums="94225dbe64edf6623bb5e92649d505809f70f86c24ca06675f6277ac4a161c40c369fd1973db649e6c864fa5e2e4a8a93cbd36d1524297a0e47b96ab59c0941c  mapserver-7.0.7.tar.gz"
