#!/usr/bin/make -f

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

# A bug in gcc causes build failure with -fPIE on armel
ifneq ($(DEB_BUILD_ARCH), armel)
    export DEB_BUILD_MAINT_OPTIONS := hardening=+all
endif

%:
	dh $@ --with autoreconf

override_dh_auto_install:
	# rename the bash completion file before installation
	mkdir $(CURDIR)/debian/bash_completion
	cp $(CURDIR)/extras/lttng-bash_completion $(CURDIR)/debian/bash_completion/lttng
	dh_auto_install

override_dh_installinit:
	dh_installinit --name=lttng-sessiond

override_dh_clean:
	dh_clean
	rm -Rf $(CURDIR)/debian/bash_completion

override_dh_auto_test:

override_dh_makeshlibs:
	dh_makeshlibs -V
