#!/usr/bin/make -f

# No compile step -- bundle/ in the source tarball is already a built
# `flutter build linux --release` output (see debian/control's comment and
# ../README.md). This just stages it into the package tree.

%:
	dh $@

override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:

# bundle/ ships prebuilt, already-release-optimized binaries -- no debug
# symbols to usefully extract into a separate dbgsym package, and at least
# libsentry.so's ELF layout trips up dh_strip/dwz's automatic extraction
# outright ("corrupt string table index").
override_dh_strip:
override_dh_dwz:

# Depends: in debian/control is hand-specified instead (see its comment) --
# automatic detection needs libgtk-3-dev etc. installed on the OBS worker,
# which drags in an ambiguous libjpeg-dev/libjpeg62-turbo-dev choice OBS's
# Debian dependency resolver won't guess on.
override_dh_shlibdeps:

override_dh_auto_install:
	mkdir -p debian/whatcha/opt/whatcha
	cp -r bundle/* debian/whatcha/opt/whatcha/
	mkdir -p debian/whatcha/usr/bin
	ln -sf /opt/whatcha/what_are_you_doing debian/whatcha/usr/bin/whatcha
	mkdir -p debian/whatcha/usr/share/applications
	install -m644 whatcha.desktop debian/whatcha/usr/share/applications/whatcha.desktop
	mkdir -p debian/whatcha/usr/share/icons/hicolor/1024x1024/apps
	install -m644 whatcha.png debian/whatcha/usr/share/icons/hicolor/1024x1024/apps/whatcha.png
