#!/usr/bin/make -f

#export DH_VERBOSE = 1

# This is a binary only package and we just install the two supported
# architectures based on which architecture it is.
include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH),amd64)
export obsidiandir = obsidian_amd64
else
export obsidiandir = obsidian_arm64
endif

DESTDIR = $(CURDIR)/debian/obsidian

%:
	dh $@

execute_after_dh_install:
	# The arm tarball includes x86_64 binaries in it, in a directory. In
	# neither installation are the files used, so lets just removed the
	# unpacked asar directory.
	rm -rf -v $(DESTDIR)/usr/lib/obsidian/resources/app.asar.unpacked
	# The asar file is marked as executable but doesn't need to be.
	chmod -x $(DESTDIR)/usr/lib/obsidian/resources/obsidian.asar

override_dh_dwz:
	# don't run tools on the binaries. We just want to install the
	# upstream binary files

override_dh_strip:
	# don't strip anything, just install the binaries.
