#!/usr/bin/make -f

PKGNAME := winpdb
MANPAGES = $(PKGNAME).1

%.1: debian/%.sgml
	docbook-to-man $< > $@

%:
	dh --with python2 $@

build: build-arch build-indep


build-arch:

build-indep: build-indep-stamp

build-indep-stamp: $(MANPAGES)
	dh --with python2 build
	touch $@

override_dh_python2:
	install -m 644 $(CURDIR)/artwork/$(PKGNAME)-icon-16.png \
                       $(CURDIR)/debian/$(PKGNAME)/usr/share/icons/hicolor/16x16/apps/$(PKGNAME).png
	install -m 644 $(CURDIR)/artwork/$(PKGNAME)-icon-32.png \
                       $(CURDIR)/debian/$(PKGNAME)/usr/share/icons/hicolor/32x32/apps/$(PKGNAME).png
	install -m 644 $(CURDIR)/artwork/$(PKGNAME)-icon-64.png \
                       $(CURDIR)/debian/$(PKGNAME)/usr/share/icons/hicolor/64x64/apps/$(PKGNAME).png
	install -m 644 $(CURDIR)/artwork/$(PKGNAME)-icon.svg \
                       $(CURDIR)/debian/$(PKGNAME)/usr/share/icons/hicolor/scalable/apps/$(PKGNAME).svg
	install -m 644 $(CURDIR)/debian/$(PKGNAME).xpm \
                       $(CURDIR)/debian/$(PKGNAME)/usr/share/pixmaps/$(PKGNAME).xpm
	chmod 755 $(CURDIR)/debian/$(PKGNAME)/usr/lib/python*/*-packages/*.py
	dh_python2

clean:
	dh --with python2 clean
	rm -f $(MANPAGES) build*-stamp

.PHONY: clean
