#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PLUGIN_VERSION = $(DEB_VERSION)

SVGS = debian/svgs
ICONS = debian/icons

%:
	dh $@

override_dh_auto_build:
	$(MAKE) -C skypeweb all

override_dh_auto_install:
	for i in 16 22 48; do \
		[ $$i -eq 16 ] && SVG=$(SVGS)/skype16.svg || SVG=$(SVGS)/skype.svg; \
		SVGOUT=$(SVGS)/skypeout.svg; \
		mkdir -p $(ICONS)/$${i}; \
		rsvg-convert -w $${i} -h $${i} $${SVG} \
			-o $(ICONS)/$${i}/skype.png; \
		rsvg-convert -w $${i} -h $${i} $${SVGOUT} \
			-o $(ICONS)/$${i}/skypeout.png; \
	done

override_dh_auto_clean:
	$(MAKE) -C skypeweb clean
	-rm -rf $(ICONS)
	dh_auto_clean

override_dh_strip:
	dh_strip --dbgsym-migration='pidgin-skype-dbg(<< 20230710+git5daf79d+dfsg-1~)'
