#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

PACKAGE := bluefish

DEB_VENDOR := $(shell dpkg-vendor --query vendor)

CPPFLAGS ?= $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS  ?= $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed

%:
	dh $@ --with autoreconf,python2 --parallel

override_dh_auto_test:
override_dh_auto_configure: configure
	dh_auto_configure -- \
	    --with-icon-path=\$${prefix}/share/pixmaps \
	    --with-theme-path=\$${prefix}/share/icons/hicolor \
	    --with-freedesktop_org-menu=\$${prefix}/share/applications \
	    --with-freedesktop_org-mime=\$${prefix}/share/mime \
	    --with-xml-catalog=\$${sysconfdir}/xml/catalog \
	    --disable-static \
	    --disable-xml-catalog-update \
	    --disable-update-databases \
	    CPPFLAGS="$(CPPFLAGS)" \
	    CFLAGS="$(CFLAGS)" \
	    LDFLAGS="$(LDFLAGS)"

override_dh_install:
	dh_install --list-missing

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_strip:
	dh_strip --dbg-package=$(PACKAGE)-dbg

override_dh_python2:
	dh_python2 -pbluefish-data usr/share/bluefish/plugins/zencoding/ usr/share/bluefish/lipsum/

override_dh_gencontrol:
ifneq (,$(filter Ubuntu,$(DEB_VENDOR)))
	dh_gencontrol -- -Vvendor:Browser='firefox | abrowser'
else
	dh_gencontrol -- -Vvendor:Browser='iceweasel | iceape'
endif

