#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

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

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	/usr/bin/python2.1 setup.py build
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -rf build/
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/scons.
	cp -r build/lib/* debian/scons/usr/lib/python2.1/site-packages/
	sed '1s|.*|#!/usr/bin/python2.1|' build/scripts/scons > debian/scons/usr/bin/scons
	chmod +x debian/scons/usr/bin/scons
	cp scons.1 debian/scons/usr/share/man/man1/
	cp README.txt debian/scons/usr/share/doc/scons/
	cp CHANGES.txt debian/scons/usr/share/doc/scons/changelog
	gzip -9 debian/scons/usr/share/doc/scons/*
	cp debian/copyright debian/scons/usr/share/doc/scons/

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	#dh_installdocs
	dh_installchangelogs 
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install

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