#!/usr/bin/make -f
# -*- makefile -*-

DIST_DEPENDS ?= ""

ifeq (Ubuntu,$(shell lsb_release -is))
	DIST_DEPENDS = samba-common-bin | sernet-samba-common
else ifeq (squeeze,$(shell lsb_release -cs))
	DIST_DEPENDS = samba-common-bin | sernet-samba-common
endif

clean:
	dh_testdir
	dh_testroot
	dh_clean
	rm -f debian/files || true

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -m 0755 opsi-setup debian/opsi-depotserver/usr/bin/opsi-setup
	install -m 0755 opsi-set-rights debian/opsi-depotserver/usr/bin/opsi-set-rights
	install -m 0755 opsi-setup debian/opsi-depotserver-expert/usr/bin/opsi-setup
	install -m 0755 opsi-set-rights debian/opsi-depotserver-expert/usr/bin/opsi-set-rights
	dh_install
	
binary-indep: install
	dh_testdir -i
	dh_testroot -i
	dh_installdebconf
	dh_installchangelogs -i
	dh_shlibdeps
	echo "depend:opsi=$(DIST_DEPENDS)" >> debian/opsi-depotserver.substvars
	dh_md5sums
	dh_gencontrol
	dh_installdeb
	dh_builddeb


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

