2011-10-22 03:42:24 -04:00
|
|
|
# $OpenBSD: cpan.port.mk,v 1.15 2011/10/22 07:42:24 espie Exp $
|
2006-11-12 05:29:15 -05:00
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
PKGNAME ?= p5-${DISTNAME}
|
2006-11-25 08:14:40 -05:00
|
|
|
.if !defined(CPAN_AUTHOR)
|
2008-05-11 15:50:55 -04:00
|
|
|
MASTER_SITES ?= ${MASTER_SITE_PERL_CPAN:=${DISTNAME:C/-.*$//}/}
|
2006-11-25 08:14:40 -05:00
|
|
|
.else
|
2008-05-11 15:50:55 -04:00
|
|
|
MASTER_SITES ?= ${MASTER_SITE_PERL_CPAN:=../by-authors/id/${CPAN_AUTHOR:C/^(.).*/\1/}/${CPAN_AUTHOR:C/^(..).*/\1/}/${CPAN_AUTHOR}/}
|
2006-11-25 08:14:40 -05:00
|
|
|
.endif
|
|
|
|
|
2010-12-03 06:43:05 -05:00
|
|
|
HOMEPAGE ?= http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/
|
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
CATEGORIES += perl5
|
|
|
|
CONFIGURE_STYLE += perl
|
|
|
|
MODULES += perl
|
2006-11-12 05:29:15 -05:00
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
REGRESS_DEPENDS += ${RUN_DEPENDS}
|
2006-11-12 05:45:40 -05:00
|
|
|
|
2006-11-12 05:48:17 -05:00
|
|
|
.if !defined(SHARED_ONLY) || ${SHARED_ONLY:L} != "yes"
|
2008-05-11 15:50:55 -04:00
|
|
|
PKG_ARCH ?= *
|
2006-11-12 05:29:15 -05:00
|
|
|
.endif
|
2006-11-12 05:45:40 -05:00
|
|
|
|
2006-11-12 05:48:17 -05:00
|
|
|
.if defined(MAKE_ENV) && !empty(MAKE_ENV:MTEST_POD=*)
|
2010-11-20 14:56:47 -05:00
|
|
|
REGRESS_DEPENDS += devel/p5-Test-Pod \
|
|
|
|
devel/p5-Test-Pod-Coverage
|
2006-11-12 05:45:40 -05:00
|
|
|
.endif
|
2008-01-27 18:28:25 -05:00
|
|
|
|
2010-10-01 17:55:20 -04:00
|
|
|
MODCPAN_POST_INSTALL = ${INSTALL_DATA_DIR} ${MODCPAN_EXAMPLES_DIR}; \
|
2010-10-23 07:58:33 -04:00
|
|
|
cd ${WRKSRC}/${MODCPAN_EXAMPLES_DIST}/ && pax -rw . ${MODCPAN_EXAMPLES_DIR};\
|
2011-10-22 03:42:24 -04:00
|
|
|
chown -R ${SHAREOWN}:${SHAREGRP} ${MODCPAN_EXAMPLES_DIR}
|
2010-10-01 17:55:20 -04:00
|
|
|
|
|
|
|
.if defined(MODCPAN_EXAMPLES) && ${MODCPAN_EXAMPLES:L} == "yes"
|
|
|
|
MODCPAN_EXAMPLES_DIR ?= ${PREFIX}/share/examples/p5-${DISTNAME:C/-([0-9]+\.[0-9]+).*$//g}
|
|
|
|
MODCPAN_EXAMPLES_DIST ?= examples
|
|
|
|
. if !target(post-install)
|
|
|
|
post-install:
|
2011-10-03 10:21:02 -04:00
|
|
|
${MODCPAN_POST_INSTALL}
|
2010-10-01 17:55:20 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
CPAN_REPORT ?= No
|
2008-01-27 18:28:25 -05:00
|
|
|
|
|
|
|
.if ${CPAN_REPORT:L} == "yes"
|
2010-11-20 14:56:47 -05:00
|
|
|
REGRESS_DEPENDS += devel/p5-Test-Reporter
|
2009-06-18 09:41:28 -04:00
|
|
|
. if ${CONFIGURE_STYLE:L:Mmodbuild}
|
|
|
|
REGRESS_FLAGS += verbose=1
|
|
|
|
. else
|
2008-05-11 15:50:55 -04:00
|
|
|
REGRESS_FLAGS += TEST_VERBOSE=1
|
2009-06-18 09:41:28 -04:00
|
|
|
. endif
|
2008-08-20 06:33:50 -04:00
|
|
|
REGRESS_STATUS_IGNORE = -
|
2008-01-27 18:28:25 -05:00
|
|
|
. if !defined(CPAN_REPORT_DB)
|
2008-05-11 15:50:55 -04:00
|
|
|
ERRORS += "Fatal: CPAN_REPORT_DB must point to a directory"
|
2008-01-27 18:28:25 -05:00
|
|
|
. endif
|
|
|
|
. if !defined(CPAN_REPORT_FROM) || empty(CPAN_REPORT_FROM)
|
2008-05-11 15:50:55 -04:00
|
|
|
ERRORS += "Fatal: CPAN_REPORT_FROM needs an email address"
|
2008-01-27 18:28:25 -05:00
|
|
|
. endif
|
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
CPANTEST = perl ${PORTSDIR}/infrastructure/build/cpanreport
|
|
|
|
CPANTEST_FLAGS =-f ${REGRESS_LOGFILE} -s ${CPAN_REPORT_FROM:Q} ${DISTNAME} \
|
2008-01-27 18:28:25 -05:00
|
|
|
> ${CPAN_REPORT_DB}/${PKGNAME}
|
2008-05-11 15:50:55 -04:00
|
|
|
CPANTEST_PASS = -g pass ${CPANTEST_FLAGS}
|
|
|
|
CPANTEST_FAIL = -g fail ${CPANTEST_FLAGS}
|
2008-01-27 18:28:25 -05:00
|
|
|
|
|
|
|
post-regress:
|
|
|
|
@mkdir -p ${CPAN_REPORT_DB}
|
|
|
|
@if grep -q FAILED ${REGRESS_LOGFILE}; then \
|
|
|
|
${CPANTEST} ${CPANTEST_FAIL}; \
|
|
|
|
exit 1; \
|
|
|
|
else ${CPANTEST} ${CPANTEST_PASS}; fi
|
|
|
|
|
|
|
|
.endif
|