#!/usr/bin/make -f

ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
	SUBSTVARS = -Vdist:Recommends="libavformat-extra-55, libavutil-extra-53"
else
	SUBSTVARS = -Vdist:Recommends="libavformat55, libavutil53"
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -lgmodule-2.0 -lm
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --with autoreconf

override_dh_auto_install:
	dh_auto_install
	dh_installman -pimagination debian/imagination.1
	dh_installchangelogs -pimagination-common ChangeLog

override_dh_gencontrol:
	dh_gencontrol -pimagination -- $(SUBSTVARS)
	dh_gencontrol -pimagination-common
