#!/usr/bin/make -f

SYSEMULATOR=qemu-system-x86_64
ifeq ($(DEB_HOST_ARCH),arm64)
  SYSEMULATOR=qemu-system-aarch64
endif
ifeq ($(DEB_HOST_ARCH),ppc64el)
  SYSEMULATOR=qemu-system-ppc64
endif


%:
	dh $@ --with apache2 --with sysuser

override_dh_auto_build:
	mkdir build
	sed -e 's/qemu-system-x86_64/$(SYSEMULATOR)/' src/config.pl > build/config.pl
	cp src/apache.conf build/qemu-web-desktop.conf
	pandoc -s -o build/qwdctl.1 src/qwdctl.md

override_dh_install:
	dh_install

override_dh_clean:
	rm -rf build
	dh_clean