#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
export DH_VERBOSE = 1

URL := https://gitlab.com/tikiwiki/tiki-manager/-/jobs/artifacts/master/raw/tiki-manager.tgz?job=compressed
DESTDIR := $(CURDIR)/debian/wikisuite-tikimanager

%:
	dh $@

override_dh_auto_clean:
	rm tiki-manager.tgz || :

override_dh_auto_test:
override_dh_auto_build:
override_dh_auto_install:
	curl -L "$(URL)" --output tiki-manager.tgz
	install -d $(DESTDIR)/opt/tiki-manager/app
	tar xzvf tiki-manager.tgz -C $(DESTDIR)/opt/tiki-manager/app
	find $(DESTDIR)/opt/tiki-manager/app -type f -exec chmod 664 {} \;
	find $(DESTDIR)/opt/tiki-manager/app -type d -exec chmod 775 {} \;
	chmod a+x $(DESTDIR)/opt/tiki-manager/app/tiki-manager

override_dh_builddeb:
	dh_builddeb -- -Zxz
