#!/usr/bin/make -f

export REPACK_SH=$(CURDIR)/debian/repack.sh

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export CFLAGS+=$(CPPFLAGS)
export CXXFLAGS+=$(CPPFLAGS)

%:
	dh $@ --with=python3

override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_install:
	dh_auto_install
	find debian/tmp -type f -name "*.la" -ls -delete
	cd debian/tmp/usr/share/doc/lives-$(DEB_VERSION_UPSTREAM) && \
		rm \
			ChangeLog \
			FEATURES \
			BUGS \
			AUTHORS
	find debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/lives -type d -empty -delete
	find debian/tmp/usr/share/lives -type d -empty -delete
	chmod a-x \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/lives/plugins/effects/realtime/weed/data/fourKlives/songs/*.txt
