#!/usr/bin/make -f
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_BUILD_GNU_TYPE
export DEB_BUILD_OPTIONS = nocheck
export DEB_DH_SHLIBDEPS_ARGS_ALL = -- --ignore-missing-info -l/usr/lib/${DEB_BUILD_GNU_TYPE}/pulseaudio --warnings=5 -v

%:
	dh $@

override_dh_auto_clean:
	scons clean

override_dh_auto_build:
	scons --prefix=/usr --host=${DEB_HOST_GNU_TYPE} \
		--libdir=/usr/lib/${DEB_HOST_MULTIARCH} \
		--build-3rdparty=libuv,libunwind,speexdsp,sox,sndfile,openssl,openfec

override_dh_auto_install:
	scons --prefix=/usr --host=${DEB_HOST_GNU_TYPE} \
		--libdir=/usr/lib/${DEB_HOST_MULTIARCH} \
		--build-3rdparty=libuv,libunwind,speexdsp,sox,sndfile,openssl,openfec \
		install DESTDIR=debian/tmp

override_dh_shlibdeps:
	dh_shlibdeps ${DEB_DH_SHLIBDEPS_ARGS_ALL}

override_dh_builddeb:
	dh_builddeb -- -Zgzip
