#!/usr/bin/make -f

DEB_PYTHON_SUGAR_PACKAGES = $(DEB_SOURCE_PACKAGE)

include /usr/share/cdbs/1/class/python-sugar.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

# Fix favor ISO 639-1 when differing from ISO 639-2
binary-post-install/$(pkg)::
	mv debian/$(cdbs_curpkg)/usr/share/locale/aym \
		debian/$(cdbs_curpkg)/usr/share/locale/ay
	mv debian/$(cdbs_curpkg)/usr/share/locale/ibo \
		debian/$(cdbs_curpkg)/usr/share/locale/ig
	rm debian/*/usr/share/sugar/activities/ImageViewer.activity/COPYING.GPLv3

# Fix broken paths in desktop file
#  * TODO: drop when fixed in sugar-toolkit-gtk3
binary-fixup/$(pkg)::
	find $(cdbs_curdestdir)/usr/share -type f -name '*.desktop' \
		-execdir perl -pi -e 's,^\S+\s*=\s*\K\S*(?=/usr/share),,g' '{}' ';'
