#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=2

# This has to be exported to make some magic below work.
export DH_OPTIONS

cfg=--prefix=/usr --mandir=${prefix}/usr/share/man
pwd:=$(shell pwd)
INSTALL=/usr/bin/install

build: build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	#$(MAKE)

	./configure
	$(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	-$(MAKE) clean

	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	
	$(MAKE) install DESTDIR=$(pwd)/debian/nstats/usr/
	rm -fvr debian/feh/usr/doc

binary-indep: DH_OPTIONS=-i

# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
	# Need this version of debhelper for DH_OPTIONS to work.
	#dh_testversion 2 2
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmenu
	#dh_installchangelogs ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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