#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
-include /usr/share/dpkg/buildtools.mk
export CC

DEB_CONFIGURE_EXTRA_FLAGS := \
	--cflags "$(CFLAGS)" \
	--prefix /usr \
	--prefix-lib /usr/lib/$(DEB_HOST_MULTIARCH) \
	--without-xmms \
	--without-audacious \
	--without-beta \
	--runtime-detect \
	--link-deps indirect \
	--without-memory-api \
	--oss-dev /dev/dsp \
	--oss-mixer-dev /dev/mixer \
	--proc-net-arp /proc/net/arp \
	--no-ipx \
	--no-yiff \
	--no-celt \
	--no-celt0 \
	--no-slp \
	--distribution-version-string "Debian-$(DEB_VERSION)"

ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
DEB_CONFIGURE_EXTRA_FLAGS += --cross-compile
endif

%:
	dh $@

override_dh_auto_configure:
	./configure $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_auto_clean:
	dh_clean
	[ ! -f Makefile.conf ] || $(MAKE) -i distclean

override_dh_auto_test:

override_dh_install:
	dh_install
	rm -f $(CURDIR)/debian/libroar-dev/usr/include/roaraudio/.cvsignore
