
SUBDIR= backend bin

.include <bsd.subdir.mk> 

NAME=smtp-vilter
VERSION!=grep VERSION include/smtp-vilter.h | awk '{print $$3}' | tr -d \"

DIST=${NAME}-${VERSION}.tgz
MD5=${NAME}-${VERSION}.md5

PUBLISH_DIR=/var/www/ftp/pub/sources/smtp-vilter

PRINT=	a2ps
PFLAGS=	-E -g -C -T 4 --header="${NAME}-${VERSION}" -o -
LPR= lpr -o sides=two-sided-short-edge

OS!=uname -s

.if ${OS} == "OpenBSD"
.if !defined(WANT_LIBMILTER)
SUBDIR=
.END:
	@echo "Compiling smtp-vilter requires sendmail with milter support."
	@echo
	@echo "Please set WANT_LIBMILTER=1 in /etc/mk.conf and recompile"
	@echo "and reinstall sendmail before compiling smtp-vilter."
.endif
.endif

allclean: cleandir
	make -f Makefile.linux clean	

dist: allclean
	(cd ..; tar czvf ${DIST} `find ${NAME}-${VERSION} -type f | grep -v CVS`; md5 ${DIST} > ${MD5})

distfile: dist
	(cd ..; cp ${DIST} /usr/ports/distfiles)

publish: allclean
	(cd ..; tar czvf ${PUBLISH_DIR}/${DIST} `find ${NAME}-${VERSION} -type f | grep -v CVS`; md5 ${DIST} > ${PUBLISH_DIR}/${MD5})

print: allclean
	find . -type f -exec ${PRINT} ${PFLAGS} {} \| ${LPR}\;

