#!/usr/bin/make -f

# Do not link against unused libraries (make dpkg-shlibdeps happy).
LDFLAGS += -Wl,-z,defs -Wl,--as-needed

configure_flags := \
	--disable-dynamic-loading \
	--with-expat=system \
	--with-ffmpeg=system \
	--with-lame=system \
	--with-libflac=system \
	--with-libid3tag=system \
	--with-libmad=system \
	--without-libresample \
	--with-libsamplerate=system \
	--with-libsndfile=system \
	--with-libtwolame=system \
	--with-libvamp=system \
	--with-libvorbis=system \
	--with-midi=system \
	--with-portaudio=system \
	--with-sbsms=local \
	--with-soundtouch=system \
	$(NULL)

%:
	dh $@ --parallel

override_dh_auto_configure:
	./autogen.sh
	dh_auto_configure -- $(configure_flags)

override_dh_auto_install:
	dh_auto_install
	# Don't package unnecessary copy of GPL
	rm -f debian/tmp/usr/share/doc/audacity/LICENSE.txt

override_dh_strip:
	dh_strip --dbg-package=audacity-dbg
