openbsd-ports/infrastructure/mk/cpan.port.mk

56 lines
1.5 KiB
Makefile
Raw Normal View History

# $OpenBSD: cpan.port.mk,v 1.9 2009/06/18 13:41:28 simon Exp $
2008-05-11 15:50:55 -04:00
PKGNAME ?= p5-${DISTNAME}
.if !defined(CPAN_AUTHOR)
2008-05-11 15:50:55 -04:00
MASTER_SITES ?= ${MASTER_SITE_PERL_CPAN:=${DISTNAME:C/-.*$//}/}
.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}/}
.endif
2008-05-11 15:50:55 -04:00
CATEGORIES += perl5
CONFIGURE_STYLE += perl
MODULES += perl
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 ?= *
.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=*)
2008-05-11 15:50:55 -04:00
REGRESS_DEPENDS += ::devel/p5-Test-Pod \
::devel/p5-Test-Pod-Coverage
2006-11-12 05:45:40 -05:00
.endif
2008-05-11 15:50:55 -04:00
CPAN_REPORT ?= No
.if ${CPAN_REPORT:L} == "yes"
2008-05-11 15:50:55 -04:00
REGRESS_DEPENDS += ::devel/p5-Test-Reporter
. if ${CONFIGURE_STYLE:L:Mmodbuild}
REGRESS_FLAGS += verbose=1
. else
2008-05-11 15:50:55 -04:00
REGRESS_FLAGS += TEST_VERBOSE=1
. endif
REGRESS_STATUS_IGNORE = -
. if !defined(CPAN_REPORT_DB)
2008-05-11 15:50:55 -04:00
ERRORS += "Fatal: CPAN_REPORT_DB must point to a directory"
. 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"
. 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} \
> ${CPAN_REPORT_DB}/${PKGNAME}
2008-05-11 15:50:55 -04:00
CPANTEST_PASS = -g pass ${CPANTEST_FLAGS}
CPANTEST_FAIL = -g fail ${CPANTEST_FLAGS}
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