#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs

# those gstreamer plugins are in universe for Ubuntu
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
	DH_GENCONTROL_ARGS += -Vgst:Suggests="gstreamer1.0-libav, gstreamer1.0-plugins-ugly"
else
	DH_GENCONTROL_ARGS += -Vgst:Recommends="gstreamer1.0-libav, gstreamer1.0-plugins-ugly"
endif

%:
	dh $@

override_dh_gencontrol:
	dh_gencontrol -- $(DH_GENCONTROL_ARGS)

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dsystemd-user-units-dir=/usr/lib/systemd/user \
	        -Dapi-docs=true \
		-Dintrospection=disabled \
		-Dexamples=false \
		-Dplugins=external,gst-launch,localsearch,media-export,mpris,playbin,ruih

override_dh_makeshlibs:
	dh_makeshlibs -X /usr/lib/$(DEB_HOST_MULTIARCH)/rygel-2.8/

override_dh_installsystemduser:
	dh_installsystemduser --no-enable

override_dh_gnome_clean:
