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

-include /usr/share/dpkg/buildtools.mk
PKG_CONFIG ?= pkg-config
DBUS_CFLAGS = $(shell $(PKG_CONFIG) --cflags dbus-1)
DBUS_LIBS = $(shell $(PKG_CONFIG) --libs dbus-1)

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@ --with apache2

override_dh_clean:
	dh_clean
	rm -rf .libs
	rm -f *.so *.la *.o *.slo *.lo

override_dh_auto_build:
	apxs -c -Wc,"-Wall -pedantic -std=c99 ${DBUS_CFLAGS}" ${DBUS_LIBS} -lpam mod_lookup_identity.c

#override_dh_auto_install:
#	mkdir -p $(CURDIR)/debian/tmp/usr/lib/apache2/modules
#	install -m 755 .libs/mod_lookup_identity.so \
#		$(CURDIR)/debian/tmp/usr/lib/apache2/modules
