#!/usr/bin/make -f

%:
	dh $@

#
#override_dh_auto_install:
#	dh_auto_install
#	for d in $$(find $(CURDIR)/debian/elementary-icon-theme/usr/share/icons -mindepth 2 -maxdepth 2 -type d) ; do \
#		(cd $$d; for c in *; do /usr/lib/icon-naming-utils/icon-name-mapping -c $$c; done); \
#	done
#	# Make lintian happy by not installing extra copyright files.
#	find . -name "COPYING" -delete
#	# Delete empty directories
#	find -type d -empty -delete
#	# Make sure svg files aren't executable.
#	find . -type f -executable -iname '*.svg' -exec chmod a-x '{}' ';'

#override_dh_builddeb:
#	dh_builddeb -- -Zxz

# Updates the PNG conversion of our theme
# Needs git, gcc, gtk+-2.0, libxfce4ui-1, gdk-pixbuf-2.0, librsvg2-common
#update-elementary-icons:
override_dh_install:
	dh_install
	make -C $(CURDIR)/debian/svgtopng
	ls -d $(CURDIR)
	pwd
	(cd $(CURDIR)/debian/svgtopng && mkdir wip && cp pngtheme.sh svgtopng ./wip)
	pwd
	mkdir -p $(CURDIR)/debian/xubuntu-icon-theme/usr/share/icons/
	for d in elementary-xfce-darkest elementary-xfce-darker elementary-xfce-dark elementary-xfce; do \
		ls -d $(CURDIR) && \
		pwd && \
		cp -a $(CURDIR)/$$d $(CURDIR)/debian/svgtopng/wip && \
		#make -C $(CURDIR)/debian/svgtopng convert ICONDIR=wip/$$d && \
		(cd $(CURDIR)/debian/svgtopng/wip && ./pngtheme.sh $$d) && \
		pwd && \
		rm -rf $(CURDIR)/debian/xubuntu-icon-theme/usr/share/icons/$$d && \
		rm -f $(CURDIR)/debian/svgtopng/wip/$$d/LICENSE && \
		cp -a $(CURDIR)/debian/svgtopng/wip/$$d $(CURDIR)/debian/xubuntu-icon-theme/usr/share/icons/. ; \
	done
	cp -a $(CURDIR)/debian/svgtopng/wip $(CURDIR)/debian/svgtopng/wip.bak
	rm -rf $(CURDIR)/debian/svgtopng/wip
	#make -C $(CURDIR)/debian/svgtopng clean
