#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

LIB_DIR=usr/lib/wikidpad


patch: patch-stamp
patch-stamp:
	dh_testdir
	QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
	touch patch-stamp

unpatch:
	dh_testdir
	QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
	rm -rf .pc patch-stamp

strip-cr:
	test -e stripcr-stamp || \
	find . -path ./debian -prune -o -type f -print0 | xargs -0 -n1 debian/stripcr
	touch stripcr-stamp


build: strip-cr patch-stamp

clean: unpatch
	dh_testdir
	dh_testroot

	dh_clean


install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	dh_install Consts.py $(LIB_DIR)
	dh_install ExceptionLogger.py $(LIB_DIR)
	dh_install appbase.css $(LIB_DIR)
	dh_install extensions $(LIB_DIR)
	dh_install icons $(LIB_DIR)
	dh_install lib $(LIB_DIR)
	dh_install sql_mar.py $(LIB_DIR)
	dh_install WikidPadHelp $(LIB_DIR)
	dh_install WikidPad.py $(LIB_DIR)
	dh_install WikidPadStarter.py $(LIB_DIR)
	dh_install WikidPad.xrc $(LIB_DIR)
	dh_install debian/addons/* usr
#	install -m 644 $(CURDIR)/debian/addons/wikidpad.desktop $(CURDIR)/debian/wikidpad/usr/share/applications/
#	install -m 755 $(CURDIR)/debian/addons/wikidpad $(CURDIR)/debian/wikidpad/usr/bin/

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

	dh_testdir
	dh_testroot
	dh_pysupport
	dh_installchangelogs
	dh_installdocs docs/*
	dh_installmenu
	dh_installmime
	dh_icons
	dh_compress
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

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