#!/usr/bin/make -f

export DH_VERBOSE=1

DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')

%:
	dh $@

override_dh_installchangelogs:
	dh_installchangelogs RELEASE_HISTORY

override_dh_install:
	dh_install
	rm -f $(CURDIR)/debian/$(DEBPKGNAME)/usr/bin/groupBy # distributed in the filo package.

override_dh_fixperms:
	dh_fixperms
	chmod -x $(CURDIR)/debian/$(DEBPKGNAME)/usr/share/bedtools/genomes/*.genome

get-orig-source:
	uscan --no-symlink --force-download --download-version $(DEB_UPSTREAM_VERSION)

