#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Generating a xulrunner build id and other strings
include /usr/share/dpkg/pkg-info.mk
BUILDID := debian@$(DEBIAN_VERSION)_$(SOURCE_DATE_EPOCH)
US  = $(CURDIR)/debian/tmp/usr/share
USC = $(US)/conkeror

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
export CFLAGS+=$(LDFLAGS)

%:
	dh $@

override_dh_auto_install:
	dh_auto_install -- PREFIX=/usr
	rm -f $(US)/doc/conkeror/COPYING $(USC)/Info.plist

	# Add generated Build ID and Debian version to version output
	sed -e 's/BuildID=git/BuildID=${BUILDID}/;s/^Version=\(.*\)$$/Version=\1 (Debian-${DEBIAN_VERSION})/' \
	    -i $(USC)/application.ini
