#!/usr/bin/make -f

TASKSELOPTS = -u
include /usr/share/blends-dev/Makefile

dist:
	# the next two lines are taken from the original dist target from blends-dev Makefile
	rm -f $(BLEND)-tasks.desc debian/control
	make -f debian/rules get-orig-source
	# This sed command removes gosa-plugin-netgroups from the list of Recommends and
	# adds gosa-plugin-netgroups to Depends (# Closes: #793667)
	# (the implementation is a workaround for the missing feature 
	# in blends-dev tracked as #825172)
	sed -i -e '/^ *gosa-plugin-netgroups,$$/d' \
	       -e '/^Package: education-main-server/{;N;N;N;N;s/\nDepends: [^\n]*/&, gosa-plugin-netgroups,/;}' \
	       debian/control
	# regenerate source tarball after d/control was changed
	# (this is a symptom of the above being a workaround and
	# why it should be implemented in blends-dev - also
	# compare the following line with the second line of this target…) 
	make -f debian/rules get-orig-source
	# The following sed command does to things:
	# workaround #845760: - use (= ${source:Version}) for arch:all depends
	# workaround #845762: - add ${misc:Depends} to all generated binary packages
	# 				(needed because we use debhelper)
	# There might be a better way to achieve this with the blends-dev framework…
	sed -i 's#education-tasks (= $${binary:Version})#education-tasks (= $${source:Version}), $${misc:Depends}#g' debian/control
