#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk
-include /usr/share/dpkg/buildtools.mk

# Use this variable to allow options passed to cmake to be overridable
DEB_CMAKE_OPTIONS ?= \
		-DDYNLOAD=OFF \
		-DMODPLUG=ON \
		-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CMAKE_OPTIONS)

override_dh_shlibdeps: debian/tmp/alure-dummy.so
	dh_shlibdeps -O--parallel

debian/tmp/alure-dummy.so:
	mkdir -p debian/tmp
	$(CC) -xc -shared -Wl,--no-as-needed -Wl,-z,relro -Wl,-z,now -o $@ /dev/null \
		-lsndfile \
		-lvorbisfile \
		-lFLAC \
		-lmpg123 \
		-ldumb \
		-lmodplug
