#!/usr/bin/make -f
ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
WITH_TREMOR=
ifeq ($(ARCH), arm)
WITH_TREMOR=--with-tremor
endif
ifeq ($(ARCH), armel)
WITH_TREMOR=--with-tremor
endif
ifeq ($(ARCH), armeb)
WITH_TREMOR=--with-tremor
endif

LDFLAGS += -Wl,--as-needed

%:
	dh $@

override_dh_auto_configure:
	./configure $(WITH_TREMOR) --enable-sqlite \
		--enable-un \
		--enable-ao \
		--enable-lastfm \
		--enable-pipe-output \
		--enable-lame-encoder \
		--enable-cue \
		--enable-mikmod \
		--enable-soundcloud \
		--enable-iso9660 \
		--enable-systemd-daemon \
		--enable-modplug \
		--enable-curl \
		--with-systemdsystemunitdir=/lib/systemd/system \
                --enable-ffado --with-zeroconf=avahi \
		--enable-sndfile \
		--enable-rtopt \
		--prefix=/usr \
		--sysconfdir=/etc/mpd

override_dh_strip:
	dh_strip  --dbg-package=mpd-dbg

override_dh_installinit:
	dh_installinit -n
