#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

FULL_VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2 | cut -d- -f1)
VERSION := $(shell echo $(FULL_VERSION) | sed -e "s/~beta[[:digit:]]\+/-BETA/")
LC_VERSION := $(shell echo $(VERSION) | tr A-Z a-z)

BASE_URL := http://www.gaia-gis.it/gaia-sins
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# see FTBFS #649302
ifeq ($(DEB_HOST_ARCH),powerpc)
EPSG := --disable-epsg
else
EPSG :=
endif

%:
	dh $@

versions:
	@echo "Spatialite full version: $(FULL_VERSION)"
	@echo "Spatialite version: $(LC_VERSION)"

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-geos \
		$(EPSG) \
		--enable-proj

override_dh_shlibdeps:
	dh_shlibdeps -l/usr/lib:$(CURDIR)/debian/tmp/usr/lib
