#!/usr/bin/make -f
# debian/rules for the Debian dbus-mono package.
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>

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

export MONO_SHARED_DIR=$(CURDIR)

build: build-stamp
build-stamp:
	dh_testdir

	./configure --prefix=/usr --mandir=\$${prefix}/share/man \
	            --infodir=\$${prefix}/share/info $(confflags)
	$(MAKE)

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	-$(MAKE) -k distclean
	rm -f config.cache config.log config.status
	rm -rf autom4te.cache */autom4te.cache .wapi

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install

	install -d debian/tmp/usr/lib/mono/
	cp -aR debian/tmp/usr/share/dotnet/mono/dbus-sharp debian/tmp/usr/lib/mono/

	cd $(CURDIR)/debian/tmp && \
	   find -type f -name "*.dll" -exec chmod -x {} \;

binary-indep:
binary-arch: build install
	dh_testdir
	dh_testroot

	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_netdeps
	dh_makenetlibs -V
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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