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

#include /usr/share/dpatch/dpatch.make

configure: configure-stamp
configure-stamp: 
	dh_testdir
	touch configure-stamp

build: build-stamp

build-stamp: configure-stamp
	dh_testdir
	./autogen.sh && ./configure --prefix=/usr && $(MAKE)
	pod2man --section=1 --release="" --center "" debian/salasaga.pod > debian/salasaga.1
	pod2man --section=1 --release="" --center "" debian/salasaga_screencapture.pod > debian/salasaga_screencapture.1
	touch $@

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) clean
	dh_clean build-stamp configure-stamp debian/salasaga.1 debian/salasaga_screencapture.1

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	mv debian/tmp/usr/share/pixmaps/salasaga-icon.png debian/tmp/usr/share/pixmaps/salasaga.png

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installchangelogs 
	dh_installdocs
	dh_installman
	dh_installmenu
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_perl
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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