# -*- mode: Makefile; tab-width: 4; -*- # ex: ts=4 # # $FreeBSD: $ # ## # USE_PERL5 - Says that the port uses perl5 for building and running. # USE_PERL5_BUILD - Says that the port uses perl5 for building. # USE_PERL5_RUN - Says that the port uses perl5 for running. # PERL5 - Set to full path of perl5, either in the system or # installed from a port. # PERL - Set to full path of perl5, either in the system or # installed from a port, but without the version number. # Use this if you need to replace "#!" lines in scripts. # PERL_VERSION - Full version of perl5 (see below for current value). # PERL_VER - Short version of perl5 (see below for current value). # PERL_LEVEL - Perl version as an integer of the form MNNNPP, where # M is major version, N is minor version, and P is # the patch level. E.g., PERL_VERSION=5.6.1 would give # a PERL_LEVEL of 500601. This can be used in comparisons # to determine if the version of perl is high enough, # whether a particular dependency is needed, etc. # PERL_ARCH - Directory name of architecture dependent libraries # (value: ${ARCH}-freebsd). # PERL_PORT - Name of the perl port that is installed # (value: perl5) # SITE_PERL - Directory name where site specific perl packages go. # This value is added to PLIST_SUB. ## .if !defined(Perl_Include) Perl_Include= bsd.perl.mk .if !defined(PERL_LEVEL) && defined(PERL_VERSION) perl_major= ${PERL_VERSION:C|^([1-9]+).*|\1|} _perl_minor= 00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|} perl_minor= ${_perl_minor:C|^.*(...)|\1|} .if ${perl_minor} >= 100 perl_minor= ${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|} perl_patch= ${PERL_VERSION:C|^.*(..)|\1|} .else # ${perl_minor} < 100 _perl_patch= 0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|} perl_patch= ${_perl_patch:C|^.*(..)|\1|} .endif # ${perl_minor} < 100 PERL_LEVEL= ${perl_major}${perl_minor}${perl_patch} .else PERL_LEVEL=0 .endif # !defined(PERL_LEVEL) && defined(PERL_VERSION) .if ${OSVERSION} >= 500032 PERL_VERSION?= 5.6.1 PERL_VER?= 5.6.1 PERL_ARCH?= mach .else .if ${OSVERSION} >= 500007 PERL_VERSION?= 5.6.0 PERL_VER?= 5.6.0 PERL_ARCH?= mach .else .if ${OSVERSION} >= 300000 PERL_VERSION?= 5.00503 .else PERL_VERSION?= 5.00502 .endif PERL_VER?= 5.005 PERL_ARCH?= ${ARCH}-freebsd .endif .endif .if ${PERL_LEVEL} >= 500800 PERL_PORT?= perl5.8 .else PERL_PORT?= perl5 .endif SITE_PERL?= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER} PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \ PERL_VER=${PERL_VER} \ PERL_ARCH=${PERL_ARCH} \ SITE_PERL=${SITE_PERL:S|^${LOCALBASE}/||} .if defined(PERL_CONFIGURE) USE_PERL5= yes USE_REINPLACE=yes .endif .if exists(/usr/bin/perl5) && ${OSVERSION} >= 300000 && ${OSVERSION} < 500036 .if !exists(/usr/bin/perl${PERL_VERSION}) && ( defined(USE_PERL5) || \ defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) ) pre-everything:: @${ECHO_CMD} "Error: you don't have the right version of perl in /usr/bin." @${FALSE} .endif PERL5= /usr/bin/perl${PERL_VERSION} PERL= /usr/bin/perl .else PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION} PERL= ${LOCALBASE}/bin/perl .if defined(USE_PERL5) || defined(USE_PERL5_BUILD) BUILD_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT} .endif .if defined(USE_PERL5) || defined(USE_PERL5_RUN) RUN_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT} .endif .endif .if defined(PERL_CONFIGURE) CONFIGURE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${PREFIX}" \ INSTALLPRIVLIB="${PREFIX}/lib" INSTALLARCHLIB="${PREFIX}/lib" CONFIGURE_SCRIPT?= Makefile.PL MAN3PREFIX?= ${PREFIX}/lib/perl5/${PERL_VERSION} .undef HAS_CONFIGURE .endif .if defined(PERL_CONFIGURE) .if !target(do-configure) do-configure: @if [ -f ${SCRIPTDIR}/configure ]; then \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ ${SCRIPTDIR}/configure; \ fi @cd ${CONFIGURE_WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} \ ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} @cd ${CONFIGURE_WRKSRC} && \ ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile .endif .endif .endif # !defined(Perl_Include)