#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/utils.mk

# only enable jack on i386 and powerpc (See #406754)
ifeq (i386,$(DEB_HOST_ARCH))
WITH_JACK_CONFFLAG := --with-jack=yes
else
 ifeq (powerpc,$(DEB_HOST_ARCH))
WITH_JACK_CONFFLAG := --with-jack=yes
 else
  ifeq (amd64,$(DEB_HOST_ARCH))
WITH_JACK_CONFFLAG := --with-jack=yes
  else
WITH_JACK_CONFFLAG := --with-jack=no
  endif
 endif
endif

DEB_CONFIGURE_EXTRA_FLAGS := \
	$(WITH_JACK_CONFFLAG) \
	--enable-unicode \
	--with-expat=system \
	--with-ffmpeg=system \
	--with-libflac=system \
	--with-libid3tag=system \
	--with-libmad=system \
	--with-libsamplerate=system \
	--without-libresample \
	--with-libsndfile=system \
	--with-libtwolame=system \
	--with-libvamp=system \
	--with-libvorbis=system \
	--with-portaudio=v19 \
	--with-portmixer \
	--with-soundtouch=system \
	$(null)

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

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