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

LSB_VENDOR = $(shell lsb_release -is)
LSB_CODENAME = $(shell lsb_release -cs)
DEB_VERSION = $(shell dpkg-parsechangelog -ldebian/changelog | grep ^Vers | cut -d\  -f2)

override_dh_auto_configure:
	dh_auto_configure -- \
		--libdir=\$${prefix}/lib \
		--with-vendor-package-version="Debian $(DEB_VERSION)" \
		--enable-engine-campfire \
		--enable-engine-irc \
		--enable-engine-jabbr \
		--enable-engine-xmpp \
		--disable-frontend-gnome \
		--disable-frontend-stfl \
		--with-db4o=included \
		GMCS=/usr/bin/mono-csc MCS=/usr/bin/mono-csc

override_dh_auto_build:
	# upstream's build system is not parallel safe
	$(MAKE)

override_dh_auto_install:
	dh_auto_install --destdir debian/tmp

# disable "make check"
override_dh_auto_test:

# disable stripping debugging symbols
override_dh_clistrip:

# disable generating clilibs
override_dh_makeclilibs:

override_dh_clideps:
	dh_clideps \
		--exclude-moduleref=i:secur32 \
		--exclude-moduleref=i:secur32.dll \
		--exclude-moduleref=libigemacintegration.dylib \
		--exclude-moduleref=/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon \
		--exclude-moduleref=/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation \
		--exclude-moduleref=/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices

override_dh_autoreconf:
	ln -sf debian/autogen.sh
	NOCONFIGURE=1 NOGIT=1 dh_autoreconf ./autogen.sh

override_dh_missing:
	dh_missing --list-missing

%:
	dh $@ --with autoreconf,cli --without single-binary
