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

# For Fujitsu Fortran & C. You have to install ffc package. 
#   Please copy control.ffc to control. 
#PACKAGE=gt3-dcl5-ffc
#PREFIXLIB=gt3-dcl5-ffc
#CC=fcc
#FC=frt

# For GNU Fortran. 
#   Please copy control.g77 to control. 
PACKAGE=gt3-dcl5
PREFIXLIB=gt3-dcl5
CC=gcc
FC=g77

export CC
export FC

build: build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE) GTOOLDIR=`pwd`

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) clean.all

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs usr/lib/$(PREFIXLIB)/bin usr/lib/$(PREFIXLIB)/lib usr/lib/$(PREFIXLIB)/include

	# Add here commands to install the package into debian/tmp.
	$(MAKE) install GTOOLDIR=`pwd`


# 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_testversion
	dh_testdir
	dh_testroot
#	dh_installdebconf	
	dh_installdocs HISTORY.doc INSTALL CREDITS.tex STATUS.doc doc/howtoloo.doc doc/gokuraku doc/reference
	dh_installexamples
	dh_installmenu
#	dh_installemacsen
#	dh_installpam
#	dh_installinit
	dh_installcron
	dh_installmanpages
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs 
	dh_link usr/lib/$(PREFIXLIB)/bin/gt3frt  usr/bin/gt3frt \
		usr/lib/$(PREFIXLIB)/bin/gtb2l.pl usr/bin/gtb2l \
		usr/lib/$(PREFIXLIB)/bin/gtb2l.pl usr/bin/gtl2b \
		usr/lib/$(PREFIXLIB)/bin/gtadd usr/bin/gtadd \
		usr/lib/$(PREFIXLIB)/bin/gtanim usr/bin/gtanim \
		usr/lib/$(PREFIXLIB)/bin/gtavr usr/bin/gtavr \
		usr/lib/$(PREFIXLIB)/bin/gtbpf usr/bin/gtbpf \
		usr/lib/$(PREFIXLIB)/bin/gtcon usr/bin/gtcon \
		usr/lib/$(PREFIXLIB)/bin/gtcont usr/bin/gtcont \
		usr/lib/$(PREFIXLIB)/bin/gtcontex usr/bin/gtcontex \
		usr/lib/$(PREFIXLIB)/bin/gtcrax usr/bin/gtcrax \
		usr/lib/$(PREFIXLIB)/bin/gtcreate usr/bin/gtcreate \
		usr/lib/$(PREFIXLIB)/bin/gtcurv usr/bin/gtcurv \
		usr/lib/$(PREFIXLIB)/bin/gtdiv usr/bin/gtdiv \
		usr/lib/$(PREFIXLIB)/bin/gtedy usr/bin/gtedy \
		usr/lib/$(PREFIXLIB)/bin/gtext usr/bin/gtext \
		usr/lib/$(PREFIXLIB)/bin/gtfixendian usr/bin/gtfixendian \
		usr/lib/$(PREFIXLIB)/bin/gtfunc usr/bin/gtfunc \
		usr/lib/$(PREFIXLIB)/bin/gthead usr/bin/gthead \
		usr/lib/$(PREFIXLIB)/bin/gthydro usr/bin/gthydro \
		usr/lib/$(PREFIXLIB)/bin/gtimis usr/bin/gtimis \
		usr/lib/$(PREFIXLIB)/bin/gtint1 usr/bin/gtint1 \
		usr/lib/$(PREFIXLIB)/bin/gtint2 usr/bin/gtint2 \
		usr/lib/$(PREFIXLIB)/bin/gtintrp usr/bin/gtintrp \
		usr/lib/$(PREFIXLIB)/bin/gtmark usr/bin/gtmark \
		usr/lib/$(PREFIXLIB)/bin/gtmask usr/bin/gtmask \
		usr/lib/$(PREFIXLIB)/bin/gtmetrics usr/bin/gtmetrics \
		usr/lib/$(PREFIXLIB)/bin/gtmlt usr/bin/gtmlt \
		usr/lib/$(PREFIXLIB)/bin/gtmxmn usr/bin/gtmxmn \
		usr/lib/$(PREFIXLIB)/bin/gtonth2 usr/bin/gtonth2 \
		usr/lib/$(PREFIXLIB)/bin/gtpv2 usr/bin/gtpv2 \
		usr/lib/$(PREFIXLIB)/bin/gtqsat usr/bin/gtqsat \
		usr/lib/$(PREFIXLIB)/bin/gtrelh usr/bin/gtrelh \
		usr/lib/$(PREFIXLIB)/bin/gtrun usr/bin/gtrun \
		usr/lib/$(PREFIXLIB)/bin/gts2p usr/bin/gts2p \
		usr/lib/$(PREFIXLIB)/bin/gtscat usr/bin/gtscat \
		usr/lib/$(PREFIXLIB)/bin/gtsel usr/bin/gtsel \
		usr/lib/$(PREFIXLIB)/bin/gtseq usr/bin/gtseq \
		usr/lib/$(PREFIXLIB)/bin/gtset usr/bin/gtset \
		usr/lib/$(PREFIXLIB)/bin/gtshow usr/bin/gtshow \
		usr/lib/$(PREFIXLIB)/bin/gtskelton usr/bin/gtskelton \
		usr/lib/$(PREFIXLIB)/bin/gtslp usr/bin/gtslp \
		usr/lib/$(PREFIXLIB)/bin/gtsqrt usr/bin/gtsqrt \
		usr/lib/$(PREFIXLIB)/bin/gtstfilt usr/bin/gtstfilt \
		usr/lib/$(PREFIXLIB)/bin/gtstrm usr/bin/gtstrm \
		usr/lib/$(PREFIXLIB)/bin/gtstspct usr/bin/gtstspct \
		usr/lib/$(PREFIXLIB)/bin/gtstspct_old usr/bin/gtstspct_old \
		usr/lib/$(PREFIXLIB)/bin/gtsub usr/bin/gtsub \
		usr/lib/$(PREFIXLIB)/bin/gttheta usr/bin/gttheta \
		usr/lib/$(PREFIXLIB)/bin/gtthetae usr/bin/gtthetae \
		usr/lib/$(PREFIXLIB)/bin/gttv usr/bin/gttv \
		usr/lib/$(PREFIXLIB)/bin/gtvect usr/bin/gtvect \
		usr/lib/$(PREFIXLIB)/bin/gtxpwspct usr/bin/gtxpwspct
	dh_strip
	dh_compress
	dh_fixperms

	# You may want to make some executables suid here.
	dh_suidregister
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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