#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CARGO_HOME = $(CURDIR)/debian/cargo

%:
	dh $@

override_dh_auto_build:
	cargo build --release

override_dh_auto_install:
	install -D -m 755 target/release/suspiro \
		$(CURDIR)/debian/suspiro/usr/bin/suspiro
	install -D -m 644 data/suspiro.service \
		$(CURDIR)/debian/suspiro/usr/lib/systemd/user/suspiro.service
	install -D -m 644 data/io.suspiro.Daemon.service \
		$(CURDIR)/debian/suspiro/usr/share/dbus-1/services/io.suspiro.Daemon.service
	install -D -m 644 data/io.suspiro.Daemon.conf \
		$(CURDIR)/debian/suspiro/usr/share/dbus-1/system.d/io.suspiro.Daemon.conf

override_dh_auto_clean:
	cargo clean
	rm -rf $(CARGO_HOME)

override_dh_auto_test:
	cargo test --release
