#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

include /usr/share/dpkg/architecture.mk
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@


override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib/$(DEB_TARGET_MULTIARCH)/vlc/plugins --with-tests

override_dh_auto_install:
	dh_auto_install
	find debian/vlc-plugin-bittorrent/ -name '*.la' -delete
	find debian/vlc-plugin-bittorrent/ -name '*.a' -delete
override_dh_auto_test:
	# The VLC test need to write to $HOME, make sure $HOME exist and is writable.
	# Could use debhelper compat level 13 to get the same effect, but stable
	# currently have level 12 and I want it to be buildable in stable without
	# a backported debhelper.
	-HOME=$(CURDIR)/debian/tmp dh_auto_test

override_dh_auto_clean:
	dh_auto_clean
	$(RM) debian/files test/data/vlcdummy-vlc.log
