#!/usr/bin/make -f

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

DESTDIR=$(CURDIR)/debian/gmt-coast-low

build:

clean:
	dh_testdir
	dh_testroot
	rm -f README.*
	dh_clean

install: install-stamp
install-stamp: 
	dh_testdir
	dh_testroot
	dh_prep 
	dh_installdirs usr/share/gmt usr/sbin
	
	tar xjf $(CURDIR)/GSHHS_coast.tar.bz2 -C $(DESTDIR)/usr/share/gmt
	mv $(DESTDIR)/usr/share/gmt/share/coast $(DESTDIR)/usr/share/gmt/.
	mv $(DESTDIR)/usr/share/gmt/README.* $(CURDIR)/.
	install -o root -g root -m 755 $(CURDIR)/debian/gmt-coastline-download $(DESTDIR)/usr/sbin
	rm -rf $(DESTDIR)/usr/share/gmt/share
	rm -f $(DESTDIR)/usr/share/gmt/COPYING
	rm -f $(DESTDIR)/usr/share/gmt/*.TXT
	
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
