#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Joey Hess and Craig Small.
#
# Customized for denyhosts by Marco Bertorello and Marco Nenciarini
#

DESTDIR := debian/denyhosts

%:
	dh --with python2,systemd $@

#Disabled; some tests only fail when building Debian package
#override_dh_auto_test:
#	python -m unittest discover tests	

override_dh_auto_install:
	python setup.py install --no-compile -O0 --force \
	  --install-scripts=$(DESTDIR)/usr/sbin \
	  --install-purelib=$(DESTDIR)/usr/share/denyhosts
	mv $(DESTDIR)/usr/sbin/denyhosts.py $(DESTDIR)/usr/sbin/denyhosts
	mv $(DESTDIR)/usr/sbin/daemon-control-dist $(DESTDIR)/usr/share/denyhosts/denyhosts_ctl.py
	install -D -m 0640 denyhosts.conf $(DESTDIR)/etc/denyhosts.conf

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.txt
