# New ports collection makefile for:	mod_perl2
# Date created:				February 13th 2003
# Whom:					Lars Eggert <larse@isi.edu>
#
# $FreeBSD: ports/www/mod_perl2/Makefile,v 1.24 2003/02/21 14:01:21 knu Exp $
#

PORTNAME=	mod_perl
PORTVERSION=	1.99r08
CATEGORIES=	www perl5
MASTER_SITES=	http://perl.apache.org/dist/ \
		http://perl.apache.org/dist/old/
PKGNAMESUFFIX=	2
DISTNAME=	${PORTNAME}-${PORTVERSION:S/r/_/}

MAINTAINER=	larse@isi.edu
COMMENT=	Embeds a Perl interpreter in the Apache2 server

BUILD_DEPENDS=	${LOCALBASE}/sbin/apxs:${APACHE2_PORT}
RUN_DEPENDS=	${LOCALBASE}/sbin/apxs:${APACHE2_PORT}

USE_PERL5=	YES

INSTALLS_SHLIB=	YES
LDCONFIG_DIRS=	%%PREFIX%%/libexec/apache2/

MAN3=		APR::PerlIO.3 APR::Table.3 Apache::Build.3 Apache::Log.3 \
		Apache::Reload.3 Apache::RequestRec.3 Apache::ServerUtil.3 \
		Apache::SubProcess.3 Apache::Test.3 \
		Apache::TestSmoke.3 Apache::TestTrace.3 Apache::TestUtil.3 \
		Apache::compat.3 Bundle::ApacheTest.3 ModPerl::Code.3 \
		ModPerl::PerlRun.3 ModPerl::Registry.3 \
		ModPerl::RegistryCooker.3

MANPREFIX=	${PREFIX}/lib/perl5/${PERL_VERSION}
APACHE2_PORT?=	${PORTSDIR}/www/apache2

.include <bsd.port.pre.mk>

.if ${PERL_LEVEL} > 500600
MAN3+=		ModPerl::Config.3 Apache::TestConfig.3
.endif

##
## this port requires PERL 5.6.x or later
##
.if ${PERL_LEVEL} < 500600
IGNORE=		Port requires perl 5.6.x or later. Install lang/perl5 then try again
.endif

do-configure:
	@ cd ${WRKSRC}; \
	${PERL5} Makefile.PL MP_APXS=${LOCALBASE}/sbin/apxs \
		MP_INST_APACHE2=1 PREFIX=${PREFIX}

post-install:
	${MKDIR} ${PREFIX}/include/apache2/modules/perl
	${INSTALL_DATA} ${WRKSRC}/src/modules/perl/*.h \
		${PREFIX}/include/apache2/modules/perl
	${INSTALL_PROGRAM} ${WRKSRC}/src/modules/perl/mod_perl.so \
		${PREFIX}/libexec/apache2/mod_perl.so

.include <bsd.port.post.mk>
