#!/usr/bin/make -f

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_install:
	dh_install
	install -D -m 644 KodakESP_16.drv $(CURDIR)/debian/printer-driver-c2esp/usr/share/cups/drv/c2esp.drv
	install -D -m 644 KodakESP_C_07.drv $(CURDIR)/debian/printer-driver-c2esp/usr/share/cups/drv/c2espC.drv
ifeq ($(derives_from_ubuntu),yes)
	# Install the apport hook on Ubuntu and derivatives
	install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/printer-driver-c2esp/usr/share/apport/package-hooks/source_c2esp.py
endif
