#!/usr/bin/make -f

export NO_PNG_PKG_MANGLE=1

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
	mkdir -p globaltheme/build
	cd globaltheme/build && cmake .. && make
	find globaltheme -name "*.qml" -o -name "*.css"

override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/tmp/usr/share/config/themeconfig/token/
	find globaltheme -name "*.qml" -exec cp {} debian/tmp/usr/share/config/themeconfig/token/ \;
	find globaltheme -name "*.css" -exec cp {} debian/tmp/usr/share/config/themeconfig/token/ \;
	ls -l debian/tmp/usr/share/config/themeconfig/token/

override_dh_install:
	# Step 1: Create the standard directory structure for the ukui-themes package.
	mkdir -p debian/ukui-themes/usr/share/config/themeconfig/token/
	# Step 2: Copy only the globaltheme-related files without touching anything else.
	cp -r debian/tmp/usr/share/config/themeconfig/token/* debian/ukui-themes/usr/share/config/themeconfig/token/
	# Run dh_install and process only the files we need.
	dh_install -X.sass-cache || true

override_dh_missing:
	dh_missing --fail-missing=false || true
