#!/usr/bin/make -f
include /usr/share/dh-php/pkg-pecl.mk

# Added by ubuntu-dbgsym-deb when this source package was made for an Ubuntu
# release; it is not in the packaging repository. Ubuntu's debhelper names
# debug packages NAME-dbgsym_VERSION_ARCH.ddeb, and the archive these builds
# are published from takes only .deb files. Rename them once they are built
# and correct debian/files, from which the .changes file is written.
.PHONY: execute_after_dh_builddeb-arch dbgsym-ddeb-to-deb
execute_after_dh_builddeb-arch: dbgsym-ddeb-to-deb
dbgsym-ddeb-to-deb:
	@for f in $$(sed -n 's/^\([^ ]*\)\.ddeb .*/\1/p' debian/files 2>/dev/null); do \
		if mv "../$$f.ddeb" "../$$f.deb"; then \
			sed -i "s/^$$f\.ddeb /$$f.deb /" debian/files; \
			echo "dbgsym-ddeb-to-deb: renamed $$f.ddeb to $$f.deb"; \
		fi; \
	done
