#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

DESTDIR := $(CURDIR)/debian/$(shell dh_listpackages)

%:
	dh $@ 

build:
	cd cmd/broker/ && go build 

override_dh_gencontrol:
	if [ -f debian/version ] ; then dh_gencontrol -- -v"`cat debian/version`" ; else dh_gencontrol ; fi

override_dh_install:
	if [ -f Makefile ] || [ ! -d files ]; then \
	  dh_install --exclude=debian --exclude=__pycache__ --exclude=.gitignore; \
	else \
	  mkdir -p $(DESTDIR) ; \
	  cp -ra files/* $(DESTDIR) ; \
	fi
