#!/usr/bin/make -f
# -*- makefile -*-
export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_clean:
	touch config.make
	#$(MAKE) distclean
	dh_auto_clean

override_dh_auto_configure:
	./configure --disable-strip --with-gnustep --with-ssl=ssl

override_dh_auto_build:
	$(MAKE) all messages=yes OBJCFLAGS="$(CFLAGS)"

override_dh_auto_install:
	GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles $(MAKE) install \
		messages=yes OBJCFLAGS="$(CFLAGS)" \
		DESTDIR=$(CURDIR)/debian/tmp/ \
		GNUSTEP_INSTALLATION_DOMAIN=SYSTEM

# This will make sure that the SOGo binary packages will always depend
# on the latest SOPE
override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_link:
	gsdh_gnustep
	dh_link
