#!/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

DEB_BUILDDIR := debian/build
DEB_CONFIGURE_USER_FLAGS += $(WITH_TREMOR) --enable-sqlite --enable-un --enable-ao --enable-lastfm --disable-lame
LDFLAGS += -Wl,--as-needed

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
DEB_FIXPERMS_EXCLUDE:=var/*
DEB_DH_INSTALLINIT_ARGS:=-n

DEB_DH_STRIP_ARGS := --dbg-package=mpd-dbg
# oh bleah. see #380614
DEB_DESTDIR = $(CURDIR)/debian/mpd

binary-post-install/mpd::
	rm -f $(CURDIR)/debian/mpd/usr/share/doc/mpd/mpdconf.example
	rm -f $(CURDIR)/debian/mpd/usr/share/doc/mpd/COPYING
