#!/usr/bin/make -f

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

%:
	dh $@

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_install:
	dh_install
ifeq ($(derives_from_ubuntu),yes)
	# Install the apport hook on Ubuntu and derivatives
	install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/c2esp/usr/share/apport/package-hooks/source_c2esp.py
endif
	
	#Compress the PPD files with Vitor Baptista's pyppd PPD
	# archiving tool. This makes the space needed for PPDs at least
	# 10 times smaller.
	( mkdir -p $(CURDIR)/debian/c2esp/usr/lib/cups/driver/ && \
	  pyppd --output=$(CURDIR)/debian/c2esp/usr/lib/cups/driver/c2esp \
		$(CURDIR)/debian/tmp/usr/share/ppd/c2esp/ \
	)
