#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif


%:
	dh --with python2 $@

override_dh_auto_clean:
	# avoid unsupported option "-a"
	python setup.py clean

override_dh_auto_install:
	python setup.py install \
		--no-check-deps \
		--root=$(CURDIR)/debian/tmp \
		--prefix=/usr \
		--install-sysconf=/etc/ \
	        --install-localstate=/var \
		--drill=/bin/true \
		--sendmail=/bin/true

	install -m 640 $(CURDIR)/debian/genzone.conf $(CURDIR)/debian/pyfred-genzone/etc/fred/
	install -m 640 $(CURDIR)/debian/pyfred.conf  $(CURDIR)/debian/fred-pyfred/etc/fred/
	#install -m 640 $(CURDIR)/debian/fred-pyfred.event.d $(CURDIR)/debian/fred-pyfred/etc/event.d/fred-pyfred

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

#override_dh_pysupport:
#	dh_pysupport /usr/share/ginger

