#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DESTDIR = $(shell pwd)/debian/tmp
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

clean:
	rm -rf *~ *.o *.so *.lo *.la *.slo *.loT .libs/
build:
	apxs2 -c mod_log_ipmask.c
binary:
	dh_testdir
	dh_auto_configure
	dh_auto_build
	dh_auto_test
	dh_testroot
	dh_prep
	dh_installdirs
	dh_auto_install

	mkdir -p "$(DESTDIR)$(shell apxs2 -q LIBEXECDIR)/"
	apxs2 -i -S LIBEXECDIR=$(DESTDIR)$(shell apxs2 -q LIBEXECDIR)/ -n mod_log_ipmask.so mod_log_ipmask.la
	mkdir -p "$(DESTDIR)/etc/apache2/mods-available/"
	echo "LoadModule log_ipmask_module $(shell apxs2 -q LIBEXECDIR)/mod_log_ipmask.so" > "$(DESTDIR)/etc/apache2/mods-available/log_ipmask.load"

	dh_install
	dh_installdocs
	dh_installchangelogs
	dh_installexamples
	dh_installman
	dh_installcatalogs
	dh_installcron
	dh_installdebconf
	dh_installemacsen
	dh_installifupdown
	dh_installinfo
	dh_installinit
	dh_installmenu
	dh_installmime
	dh_installmodules
	dh_installlogcheck
	dh_installlogrotate
	dh_installpam
	dh_installppp
	dh_installudev
	dh_installwm
	dh_installxfonts
	dh_installgsettings
	dh_bugfiles
	dh_ucf
	dh_lintian
	dh_gconf
	dh_icons
	dh_perl
	dh_usrlocal
	dh_link
	dh_compress
	dh_fixperms
	dh_strip
	dh_makeshlibs
	dh_shlibdeps
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb
build-arch: build
build-indep: build
binary-indep:
binary-arch:
