# $OpenBSD: Makefile.template,v 1.46 2005/11/12 00:07:22 sturm Exp $
# port by Pete Vickers (pete.vickers@computer.org), 
# based on application by Robert Segall (roseg@apsis.ch)
#

COMMENT=		"SSL reverse proxy and load balancer"

VERSION=		1.10
DISTNAME=		Pound-${VERSION}
PKGNAME=		pound-${VERSION}
CATEGORIES=		net
HOMEPAGE=		http://www.apsis.ch/pound
MAINTAINER=		Pete Vickers <pete.vickers@computer.org>

# need to get a copy of openssl to compile locally with +threads
SUPFILEVER=		0.9.8a
SUPDISTNAME=		openssl-${SUPFILEVER}
SUPDISTFILES=		${SUPDISTNAME}.tar.gz:0
BASEDISTFILE=		${DISTNAME}.tgz
DISTFILES=		${BASEDISTFILE} ${SUPDISTFILES}

# LICENSE=GPL
PERMIT_PACKAGE_CDROM=	Yes 
PERMIT_PACKAGE_FTP=	Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP=	Yes

MASTER_SITES=		http://www.apsis.ch/pound/
MASTER_SITES0=		http://www.openssl.org/source/

EXTRACT_SUFX=		.tgz

CONFIGURE_STYLE=	simple
CONFIGURE_ARGS+=	--sysconfdir=/etc \
			--with-ssl=../openssl-tmp \
			--with-log=LOG_DAEMON \
			--enable-daemon \
			--disable-msdav \
			--disable-unsafe

post-extract:
	@${ECHO_MSG} "===>  creating a temporary (threaded version) openssl to compile against"
	@mkdir ${WRKDIR}/openssl-tmp
	@cd ${WRKDIR}/${SUPDISTNAME} ; \
		./config no-hw threads --openssldir=${WRKDIR}/openssl-tmp ; \
		make install

pre-patch:
	@touch ${WRKSRC}/pound.cfg

post-install:
	@${INSTALL_DATA_DIR} ${PREFIX}/share/examples/pound 
	@${INSTALL_DATA} ${WRKSRC}/pound.cfg ${PREFIX}/share/examples/pound/pound.cfg

.include <bsd.port.mk>
