#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --with python2

override_dh_strip:
	# emptying the dependency_libs field in .la files
	sed -i "/dependency_libs/ s/'.*'/''/" `find debian/ -name '*.la'`
	dh_strip --dbgsym-migration='ccnet-dbg (<< 6.0.7-1), libccnet-dbg (<< 6.0.7-1)'

override_dh_install:
	help2man -n "ccnet daemon" -N --version-string=$(DEB_VERSION_UPSTREAM) $(CURDIR)/debian/tmp/usr/bin/ccnet > $(CURDIR)/debian/ccnet.1
	help2man -n "init ccnet configuration directory" -N --version-string=$(DEB_VERSION_UPSTREAM) $(CURDIR)/debian/tmp/usr/bin/ccnet-init > $(CURDIR)/debian/ccnet-init.1
	dh_install
