#!/usr/bin/make -f

configure: configure-stamp

configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp: configure-stamp 
	dh_testdir
	python setup.py build
	xsltproc  --nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl debian/xmms2tray.xml
	convert data/xmms2_24.png xmms2tray.xpm
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	python setup.py clean
	dh_clean 
	rm -f xmms2tray.1
	rm -f xmms2tray.xpm
	# WHY don't the distutils do this ?!
	rm -rf build

install: build
	dh_testdir
	dh_testroot
	dh_prep
	python setup.py install --prefix=/usr --root=$(CURDIR)/debian/xmms2tray
	rm $(CURDIR)/debian/xmms2tray/usr/share/doc/xmms2tray/COPYING
	dh_install xmms2tray.xpm usr/share/pixmaps
	dh_install debian/xmms2tray.desktop usr/share/applications
	dh_installman xmms2tray.1

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installmenu
	dh_python2
	dh_installman
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

binary: binary-indep binary-arch

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

