#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

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

INSTMOD=install -g root -o root -m 644 
INSTBIN=install -g root -o root -m 755

DSTDIR_BIN=debian/tmp/usr/lib/roxen/bin
DSTDIR_LIB=debian/tmp/usr/share/roxen/pike
DSTDIR_CAUD=debian/libroxen-xmlrpc-caudium/usr/share/roxen/modules
DSTDIR_ROXN=debian/libroxen-xmlrpc-roxen/usr/share/roxen/modules

build: build-stamp
build-stamp:
	dh_testdir

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Install common programs
	$(INSTBIN) xml-rpc/test.pike $(DSTDIR_BIN)/xmlrpc-test1.pike
	$(INSTBIN) xml-rpc/test2.pike $(DSTDIR_BIN)/xmlrpc-test2.pike
	$(INSTBIN) xml-rpc/server.pike $(DSTDIR_BIN)/xmlrpc-server.pike
	$(INSTBIN) xml-rpc/standalone-ssl-server.pike $(DSTDIR_BIN)/xmlrpc-server-ssl.pike
	$(INSTBIN) xml-rpc/xmlrpc.pmod $(DSTDIR_LIB)

	# Install the Caudium module
	$(INSTMOD) xml-rpc/caudium/xml-rpc.pike $(DSTDIR_CAUD)
	$(INSTMOD) xml-rpc/caudium/xml-rpc-provider.pike $(DSTDIR_CAUD)

	# Install the Roxen module
	$(INSTMOD) xml-rpc/roxen/xml-rpc.pike $(DSTDIR_ROXN)
	$(INSTMOD) xml-rpc/roxen/xml-rpc-provider.pike $(DSTDIR_ROXN)

	touch install-stamp

# 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_installdocs
	dh_installchangelogs 

	dh_link
	dh_strip
	dh_compress
	dh_fixperms

	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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