#!/usr/bin/make -f

THEMES_DIR=debian/metacity-themes/usr/share/themes

build: build-stamp

build-stamp: 
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 
	rm -f TWEAK-*.tar.gz
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	# The extract script does what the name suggest, also it
	# simplyfies the tree of some themes.
	debian/extract.pl
	# dh_fixperms ignores /usr/share/themes
	chmod -R 0644 $(THEMES_DIR);
	chmod -R +X $(THEMES_DIR);
	# The makedoc scripts generates documentation for each theme and the 
	# package, removes duplicate licenses and copy any documentation provided
	# with the theme to the correct location
	debian/makedoc.pl


binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs 
	dh_fixperms
	dh_compress
	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 
