#!/usr/bin/make -f

export DH_VERBOSE=1
export DEB_CFLAGS_MAINT_APPEND = -Wno-error=deprecated-declarations

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-spandsp=6 \
		--with-libnotify=yes \
		--with-cups=yes \
		--with-secret=yes \
		--with-ebook=yes \
		--with-gstreamer1=yes \
		--with-pulseaudio=yes \
		--with-portaudio=no \
		--with-faxophone=yes \
		--with-appindicator3=yes

override_dh_install:

	# do not ship *.la and *.a files
	find debian/ -name \*.la -delete
	find debian/ -name \*.a -delete

	dh_install --list-missing

override_dh_fixperms:
	dh_fixperms
	chmod 755 debian/roger-router-cli/usr/share/roger/roger-cups
	chmod 755 debian/roger-router-cli/usr/share/roger/install-fax.sh
	chown lp.fax debian/roger-router-cli/var/spool/roger
	chmod 2770 debian/roger-router-cli/var/spool/roger
