#!/usr/bin/make -f

DEB_PYTHON3_MODULE_PACKAGES := gutsy-wallpapers

include /usr/share/cdbs/1/rules/debhelper.mk
# cdbs 0.4.182 起上游移除了 class/python-distutils.mk 等全部 class 文件，
# 以下用等价的显式钩子实现 setup.py 的 build/install/clean 流程
# （原 python-distutils.mk 的 build/install/clean 钩子行为）

build/gutsy-wallpapers::
	python3 setup.py build

install/gutsy-wallpapers::
	python3 setup.py install --root="$(DEB_DESTDIR)" --install-layout=deb --no-compile -O0

binary-post-install/gutsy-wallpapers::
	# Grab the values from ubuntu-wallpapers.xml
	xsltproc --novalid -o debian/gconf-defaults debian/wallpapers2gconf.xsl gutsy-wallpapers.xml.in
	# desktop-base from Debian uses priority 15, override its settings
	if command -v dh_gconf >/dev/null 2>&1; then dh_gconf --priority=16; fi

clean ::
	$(RM) debian/gconf-defaults
	-python3 setup.py clean -a

install/gutsy-wallpapers::
	rm -rf $(DEB_DESTDIR)/usr/lib/