#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

DISTRO := $(shell lsb_release -si)

# Anyway, defaults to Debian
ifeq ($(DISTRO),)
DISTRO := Debian
endif

clean::
	@echo "=== Building for distribution: $(DISTRO) ==="
	if [ -d debian/$(DISTRO) ]; then \
	    find debian/$(DISTRO) -name '*.png' | xargs rm -fv; \
	fi

makebuilddir/human-icon-theme::
	./autogen.sh --prefix=/usr

build:
	@echo "=== Installing distribution specific overrides ==="
	if [ -d debian/$(DISTRO) ]; then \
	    find debian/$(DISTRO) -name '*.sng' | xargs sng; \
	fi

binary-post-install/human-icon-theme::
	# replace the Ubuntu logos with the distribution overrides
	if [ -d debian/$(DISTRO) ]; then \
	    cp -rvf debian/$(DISTRO)/* debian/human-icon-theme/usr/share/icons/Human/; \
	fi

