2001-08-25 07:23:46 -04:00
|
|
|
#-*- mode: Fundamental; tab-width: 4; -*-
|
|
|
|
# ex:ts=4 sw=4 filetype=make:
|
2013-03-11 07:50:17 -04:00
|
|
|
# $OpenBSD: perl.port.mk,v 1.21 2013/03/11 11:50:17 espie Exp $
|
2001-08-25 07:23:46 -04:00
|
|
|
# Based on bsd.port.mk, originally by Jordan K. Hubbard.
|
|
|
|
# This file is in the public domain.
|
|
|
|
|
2013-03-11 07:50:17 -04:00
|
|
|
TEST_TARGET ?= test
|
2004-05-26 07:20:26 -04:00
|
|
|
MODPERL_BUILD ?= Build
|
2010-11-26 15:24:36 -05:00
|
|
|
SHARED_ONLY ?= No
|
2004-05-26 07:20:26 -04:00
|
|
|
|
|
|
|
.if ${CONFIGURE_STYLE:L:Mmodbuild}
|
2008-05-11 15:50:55 -04:00
|
|
|
MODPERL_configure = \
|
2012-08-15 05:38:11 -04:00
|
|
|
arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
|
2004-05-26 07:20:26 -04:00
|
|
|
cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} ${CONFIGURE_ENV} \
|
2012-08-15 05:38:11 -04:00
|
|
|
perl Build.PL \
|
2004-05-26 07:20:26 -04:00
|
|
|
install_path=lib="${PREFIX}/libdata/perl5/site_perl" \
|
|
|
|
install_path=arch="${PREFIX}/libdata/perl5/site_perl/$$arch" \
|
2004-06-22 23:20:17 -04:00
|
|
|
install_path=libdoc="${PREFIX}/man/man3p" \
|
2004-05-26 07:20:26 -04:00
|
|
|
install_path=bindoc="${PREFIX}/man/man1" \
|
|
|
|
install_path=bin="${PREFIX}/bin" \
|
|
|
|
install_path=script="${PREFIX}/bin" ${CONFIGURE_ARGS}
|
|
|
|
.else
|
2012-08-15 05:38:11 -04:00
|
|
|
MODPERL_configure = ${_MODPERL_preconfig}; \
|
|
|
|
arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
|
2003-07-28 13:17:04 -04:00
|
|
|
cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} ${CONFIGURE_ENV} \
|
2007-04-08 12:16:06 -04:00
|
|
|
PERL_MM_USE_DEFAULT=Yes \
|
2012-08-15 05:38:11 -04:00
|
|
|
perl Makefile.PL \
|
2003-12-02 22:47:07 -05:00
|
|
|
PREFIX='${PREFIX}' \
|
|
|
|
INSTALLSITELIB='${PREFIX}/libdata/perl5/site_perl' \
|
2001-08-25 07:23:46 -04:00
|
|
|
INSTALLSITEARCH="\$${INSTALLSITELIB}/$$arch" \
|
2003-12-02 22:47:07 -05:00
|
|
|
INSTALLPRIVLIB='/usr/./libdata/perl5' \
|
2001-08-25 07:23:46 -04:00
|
|
|
INSTALLARCHLIB="\$${INSTALLPRIVLIB}/$$arch" \
|
2003-12-02 22:47:07 -05:00
|
|
|
INSTALLMAN1DIR='${PREFIX}/man/man1' \
|
|
|
|
INSTALLMAN3DIR='${PREFIX}/man/man3p' \
|
2001-08-25 07:23:46 -04:00
|
|
|
INSTALLBIN='$${PREFIX}/bin' \
|
2012-08-15 05:38:11 -04:00
|
|
|
INSTALLSCRIPT='$${INSTALLBIN}' ${CONFIGURE_ARGS}; \
|
|
|
|
if ! test -f ${WRKBUILD}/Makefile; then \
|
|
|
|
echo >&2 "Fatal: Makefile.PL did not produce a Makefile"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2009-08-12 18:36:48 -04:00
|
|
|
|
|
|
|
. if ${CONFIGURE_STYLE:L:Mmodinst}
|
2010-11-20 14:56:47 -05:00
|
|
|
BUILD_DEPENDS += devel/p5-Module-Install
|
2009-08-12 18:36:48 -04:00
|
|
|
CONFIGURE_ARGS += --skipdeps
|
2012-08-15 05:38:11 -04:00
|
|
|
_MODPERL_preconfig = rm -rf ${WRKSRC}/inc/Module/*Install*
|
|
|
|
. else
|
|
|
|
_MODPERL_preconfig = :
|
2009-08-12 18:36:48 -04:00
|
|
|
. endif
|
2004-05-26 07:20:26 -04:00
|
|
|
.endif
|
2001-08-25 07:23:46 -04:00
|
|
|
|
2008-05-11 15:50:55 -04:00
|
|
|
MODPERL_pre-fake = \
|
2012-08-15 05:38:11 -04:00
|
|
|
${SUDO} mkdir -p ${WRKINST}`perl -e 'use Config; print $$Config{installarchlib}, "\n";'`
|
2002-04-16 13:35:21 -04:00
|
|
|
|
2004-05-26 07:20:26 -04:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mmodbuild}
|
2012-08-15 05:38:11 -04:00
|
|
|
MODPERL_BUILD_TARGET = \
|
|
|
|
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
|
|
|
|
${MODPERL_BUILD} build
|
|
|
|
|
2013-03-11 07:50:17 -04:00
|
|
|
MODPERL_TEST_TARGET = \
|
2012-08-15 05:38:11 -04:00
|
|
|
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
|
2013-03-11 07:50:17 -04:00
|
|
|
${MODPERL_BUILD} ${TEST_TARGET}
|
2012-08-15 05:38:11 -04:00
|
|
|
MODPERL_INSTALL_TARGET = \
|
|
|
|
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
|
|
|
|
${MODPERL_BUILD} destdir=${WRKINST} ${FAKE_TARGET}
|
|
|
|
|
2004-05-26 07:20:26 -04:00
|
|
|
. if !target(do-build)
|
|
|
|
do-build:
|
2012-08-15 05:38:11 -04:00
|
|
|
@${MODPERL_BUILD_TARGET}
|
2004-05-26 07:20:26 -04:00
|
|
|
. endif
|
2013-03-11 07:50:17 -04:00
|
|
|
. if !target(do-test)
|
|
|
|
do-test:
|
|
|
|
@${MODPERL_TEST_TARGET}
|
2004-05-26 07:20:26 -04:00
|
|
|
. endif
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
2012-08-15 05:38:11 -04:00
|
|
|
@${MODPERL_INSTALL_TARGET}
|
2009-08-12 18:36:48 -04:00
|
|
|
. endif
|
2004-05-26 07:20:26 -04:00
|
|
|
.endif
|
|
|
|
|
2010-09-24 11:15:38 -04:00
|
|
|
.if ${SHARED_ONLY:L:Myes}
|
|
|
|
WANTLIB += perl
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 05:38:11 -04:00
|
|
|
P5SITE = libdata/perl5/site_perl
|
|
|
|
P5ARCH = ${P5SITE}/${MACHINE_ARCH}-openbsd
|
|
|
|
SUBST_VARS += P5ARCH P5SITE
|