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

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

BRANCH=`cat debian/get-orig-source/current-branch`
RCVERSION=`cat debian/get-orig-source/rc-version`
SRC=AutoDockToolsDIST

%:
	dh $@ --with python2 

override_dh_install:
	dh_install
	find debian -name runAdt -exec chmod +x \{\} \;
	find debian -name adt -exec chmod +x \{\} \;
	# remove extra interpreter line ... the / in debian/ is important for the expression to work with symbolic links
	find debian/ \( -name runAdt -o -name AutoLigand.py -o -name VS_net.py \) -a  -type f -exec sed -i '1s?#!.*?#!/usr/bin/python?' \{\} \;
	find debian/ -name LICENSE -delete
	find debian/ -name runAdt -o -name adt | xargs -r chmod +x

override_dh_clean:
	dh_clean
	find . -name CVS -a -type d | xargs -r rm -r
	rm -f AutoDockTools/bin/runAdt
	rm -rf build build-stamp

get-orig-source:
	./debian/get-orig-source/get-orig-source $(SRC) $(BRANCH) $(RCVERSION)
