#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND=-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 \
	--without-libsamplerate \
	--with-libsndfile=system \
	--with-libsoxr=system \
	--with-libtwolame=system \
	--with-libvamp=system \
	--with-libvorbis=system \
	--with-midi=system \
	--with-portaudio=system \
	--with-sbsms=system \
	--with-soundtouch=system \
	$(NULL)

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- $(configure_flags)

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

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