#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

upstream_version=20020317

TAR_DIR := oskit-${upstream_version}
include /usr/share/dbs/dbs-build.mk

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

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

build: $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/build-stamp: $(patched)
	dh_testdir

	cd $(BUILD_TREE) && ./configure --prefix=/usr --enable-indirect-osenv \
	--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)

# Add here commands to compile the package.

	$(MAKE) -C $(BUILD_TREE)

	touch $(STAMP_DIR)/build-stamp

clean:
	dh_testdir
	dh_testroot

	rm -rf $(SOURCE_DIR) $(STAMP_DIR)

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

# Add here commands to install the package into debian/<packagename>
	$(MAKE) -C $(BUILD_TREE) install-subdirs prefix=`pwd`/debian/oskit/usr

# 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_installchangelogs
	dh_installdocs
	dh_installexamples
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
#	dh_undocumented
#	dh_installman
	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
.PHONY: build clean binary-indep binary-arch binary install
