#!/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

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

# Can be dropped in compat level 13
execute_after_dh_installinit:
	dh_installsysusers

override_dh_clean:
	rm -rf build
	dh_clean
