aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel/p5-File-Temp/Makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/devel/p5-File-Temp/Makefile b/devel/p5-File-Temp/Makefile
index 67ca693e4446..18e99f631c04 100644
--- a/devel/p5-File-Temp/Makefile
+++ b/devel/p5-File-Temp/Makefile
@@ -15,8 +15,6 @@ PKGNAMEPREFIX= p5-
MAINTAINER= wjv@FreeBSD.org
-# This dependency is not required for Perl >= 5.6.0
-BUILD_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/File/Spec.pm:${PORTSDIR}/devel/p5-File-Spec
RUN_DEPENDS= ${BUILD_DEPENDS}
PERL_CONFIGURE= yes
@@ -24,4 +22,15 @@ PERL_CONFIGURE= yes
MAN3= File::Temp.3
MANPREFIX= ${PREFIX}/lib/perl5/${PERL_VERSION}
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+SITE_PERL?= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}
+
+PERL_MAJOR=${PERL_VER:C|^([1-9]+).*|\1|}
+PERL_MINOR=${PERL_VER:C|^[1-9]+\.0*([1-9]+).*|\1|}
+
+.if ${PERL_MAJOR} < 5 || ${PERL_MAJOR} == 5 && ${PERL_MINOR} < 8
+BUILD_DEPENDS+= ${SITE_PERL}/File/Spec.pm:${PORTSDIR}/devel/p5-File-Spec
+.endif # ${PERL_MAJOR} < 5 || ${PERL_MAJOR} == 5 && ${PERL_MINOR} < 8
+
+.include <bsd.port.post.mk>