#!/usr/bin/make -f
%:
	dh $@

DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')

binary:
	@# Both rename the deb and put it in the right place for distaddfile.
	@# Must be renamed because name doesn't match internal control file.
	@# This also reversions it to be our version
	dpkg-deb -x *.deb debian/tmp
	dpkg-deb -e *.deb debian/tmp/DEBIAN
	sed -i "s/^Version:.*/Version: $(DEBIAN_VERSION)/" debian/tmp/DEBIAN/control
	dpkg-deb -b debian/tmp ../skype_$(DEBIAN_VERSION)_i386.deb
	dpkg-distaddfile skype_$(DEBIAN_VERSION)_i386.deb non-free/net extra
