#!/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

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)


ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

build: build-stamp
build-stamp:  
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	dh_clean
	
install: build
	mkdir -p $(CURDIR)/debian/apticron/etc/apticron/
	mkdir -p $(CURDIR)/debian/apticron/usr/sbin/
	cp apticron.conf ${CURDIR}/debian/apticron/etc/apticron/
	cp apticron ${CURDIR}/debian/apticron/usr/sbin/
	chmod 0755 ${CURDIR}/debian/apticron/usr/sbin/apticron
	dh_testroot
	dh_installdirs
	dh_installdebconf	

# Build architecture-independent files here.
binary-indep: build install
	dh_installcron
	dh_installman apticron.1
	dh_installchangelogs
	dh_installdocs
	dh_installdeb
	dh_compress
	dh_fixperms
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: 

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install 
