#!/usr/bin/make -f

%:
	dh $@ --with gnome

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_EXTENSION=OFF -DUSE_DEBIAN_LAYOUT=ON \
		-DPython_ADDITIONAL_VERSIONS=3 -DCMAKE_INSTALL_LIBDIR=lib

# Use debian/postinst to install the Chrome conffile
# and debian/postrm to remove it since dpkg's automatic
# conffile handling doesn't handle the special /etc/opt/ directory
# https://bugs.debian.org/888549
override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/chrome-gnome-shell/usr/share/chrome-gnome-shell
	mv debian/chrome-gnome-shell/etc/opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json \
		debian/chrome-gnome-shell/usr/share/chrome-gnome-shell/org.gnome.chrome_gnome_shell.json
	rm -rf debian/chrome-gnome-shell/etc/opt
