export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
export INSTALL_DIR=$(CURDIR)/debian/phrog
%:
dh $@
override_dh_auto_build:
HOME=$(CURDIR)/debian/tmp_home cargo build
HOME=$(CURDIR)/debian/tmp_home cargo xtask dist-data phrog.toml --greetd-vt 7 --greetd-user _greetd
override_dh_auto_install:
install -D -m0755 target/$(DEB_HOST_RUST_TYPE)/debug/phrog \
$(INSTALL_DIR)/usr/bin/phrog
install -D -m0755 data/phrog-greetd-session \
$(INSTALL_DIR)/usr/libexec/phrog-greetd-session
override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
mkdir -p $(CURDIR)/debian/tmp_home $(CURDIR)/debian/tmp_run
LC_ALL=C.UTF-8 XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp_run \
HOME=$(CURDIR)/debian/tmp_home dbus-run-session xvfb-run -a \
phoc -C $(CURDIR)/debian/config/phoc.ini -E "cargo test"
endif
execute_after_dh_auto_clean:
rm -rf $(CURDIR)/debian/tmp_home $(CURDIR)/debian/tmp_run