#!/usr/bin/make -f
export DH_GOPKG := github.com/cxnturi0n/convoC2

BUILD_DIR := build
SERVER_BUILD_DIR := $(BUILD_DIR)/server
ARCH := $(DEB_HOST_ARCH)

%:
	dh $@ --buildsystem=golang --with=golang

override_dh_auto_build:
	mkdir -p $(SERVER_BUILD_DIR)
	go mod vendor
	GOOS=linux GOARCH=$(DEB_HOST_ARCH) go build -mod=vendor -o $(SERVER_BUILD_DIR)/convoc2_server_$(DEB_HOST_ARCH) cmd/server/main.go

override_dh_auto_install:
	DESTDIR=$$(pwd)/debian/convoc2; \
	install -D -m 0755 $(SERVER_BUILD_DIR)/convoc2_server_$(DEB_HOST_ARCH) $$DESTDIR/usr/bin/convoc2

override_dh_auto_test:
