#!/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

include /usr/share/dpkg/architecture.mk
export PKG_CONFIG = $(DEB_HOST_GNU_TYPE)-pkg-config

CFLAGS=-Wall `$(PKG_CONFIG) --cflags gtk+-2.0`
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
# `nostrip' handled by dh_strip...

build: build-stamp
build-stamp:
	dh_testdir
	docbook-to-man g3data.sgml > g3data.1
	gzip --best g3data.1
	dh_auto_build -- CFLAGS="$(CFLAGS)"
	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp
	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) clean
	rm -f g3data.1*
	dh_testroot
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs usr/bin
	# Add here commands to install the package into debian/g3data.
	install -m 755 g3data debian/g3data/usr/bin
	mkdir -p debian/g3data/usr/share/pixmaps/

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs
	dh_installexamples test*
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
	dh_installman g3data.1.gz
	dh_install debian/g3data.desktop usr/share/applications
	dh_install debian/g3data.png usr/share/pixmaps
#	dh_installinfo
#	dh_undocumented
	dh_installchangelogs 
#	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

build-arch: build
build-indep: build

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