ports/55515: [patch] extract perl stuff from bsd.port.mk into
bsd.perl.mk
Sergey Matveychuk
sem at FreeBSD.org
Thu Aug 12 23:37:29 PDT 2004
Here is an adapted patch for modern bsd.port.mk and suitable bsd.perl.mk.
--
Sem.
-------------- next part --------------
--- bsd.port.mk.orig Fri Aug 13 10:12:06 2004
+++ bsd.port.mk Fri Aug 13 10:14:17 2004
@@ -208,33 +208,6 @@
# USE_ICONV - Says that the port uses libiconv.
# USE_GETTEXT - Says that the port uses GNU gettext (libintl).
##
-# USE_PERL5 - Says that the port uses perl5 in one or more of the extract,
-# patch, build, install or run phases.
-# USE_PERL5_BUILD - Says that the port uses perl5 in one or more of the extract,
-# patch, build or install phases.
-# 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.
-# PERL_MODBUILD - Use Module::Build to configure, build and install
-# port.
-#
# USE_GHOSTSCRIPT - Says that the port needs ghostscript to both
# build and run. Default: not set.
# USE_GHOSTSCRIPT_BUILD - Says that the port needs ghostscript to build.
@@ -288,6 +261,13 @@
# See bsd.autotools.mk for more details.
# XXX: not currently in active use - this is a placeholder.
##
+# USE_PERL5_BUILD - Says that the port uses perl5 in one or more of
+# the extract, patch, build or install phases.
+# USE_PERL5_RUN - Says that the port uses perl5 for running.
+# USE_PERL5 - Implements both USE_PERL5_BUILD and USE_PERL5_RUN.
+# (See bsd.perl.mk for full list of variables and
+# CONFIGURE_SCRIPT, CONFIGURE_ARGS defaults.)
+##
# USE_JAVA - Says that the port relies on the Java language.
# Implies inclusion of bsd.java.mk. (Also see
# that file for more information on USE_JAVA_*).
@@ -667,19 +647,14 @@
# configure stage will not do anything if this is not set.
# GNU_CONFIGURE - Set if you are using GNU configure (optional). Implies
# HAS_CONFIGURE.
-# PERL_CONFIGURE - Configure using Perl's MakeMaker. Implies USE_PERL5.
# CONFIGURE_WRKSRC - Directory to run configure in (default: ${WRKSRC}).
# CONFIGURE_SCRIPT - Name of configure script, relative to ${CONFIGURE_WRKSRC}
-# (default: "Makefile.PL" if PERL_CONFIGURE is set,
-# "configure" otherwise).
+# (default: "configure").
# CONFIGURE_TARGET - The name of target to call when GNU_CONFIGURE is
# defined (default: ${MACHINE_ARCH}-portbld-freebsd${OSREL}).
# CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set
# (default: "--prefix=${PREFIX} ${CONFIGURE_TARGET}" if
-# GNU_CONFIGURE is set, "CC=${CC} CCFLAGS=${CFLAGS}
-# PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
-# INSTALLARCHLIB=${PREFIX}/lib" if PERL_CONFIGURE is set,
-# empty otherwise).
+# GNU_CONFIGURE is set, empty otherwise).
# CONFIGURE_ENV - Pass these env (shell-like) to configure if
# ${HAS_CONFIGURE} is set.
# CONFIGURE_LOG - The name of configure log file (default: config.log).
@@ -1068,67 +1043,6 @@
RUN_DEPENDS+= ${APXS}:${PORTSDIR}/${APACHE_PORT}
.endif
-.if ${OSVERSION} >= 502100
-PERL_VERSION?= 5.8.5
-PERL_VER?= 5.8.5
-.else
-.if ${OSVERSION} >= 500032
-PERL_VERSION?= 5.6.1
-PERL_VER?= 5.6.1
-.else
-.if ${OSVERSION} >= 500007
-PERL_VERSION?= 5.6.0
-PERL_VER?= 5.6.0
-.else
-.if ${OSVERSION} >= 300000
-PERL_VERSION?= 5.00503
-.else
-PERL_VERSION?= 5.00502
-.endif
-PERL_VER?= 5.005
-.endif
-.endif
-.endif
-
-.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 ${PERL_LEVEL} >= 500600
-PERL_ARCH?= mach
-.else
-PERL_ARCH?= ${ARCH}-freebsd
-.endif
-
-.if ${PERL_LEVEL} >= 500800
-PERL_PORT?= perl5.8
-.else
-PERL_PORT?= perl5
-.endif
-
-SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
-SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
-
-.if ${PERL_LEVEL} < 500600
-PERL5= /usr/bin/perl${PERL_VERSION}
-PERL= /usr/bin/perl
-.else
-PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION}
-PERL= ${LOCALBASE}/bin/perl
-.endif
-
# XXX: (not yet): .if defined(USE_AUTOTOOLS)
# .include "${PORTSDIR}/Mk/bsd.autotools.mk"
# XXX: (not yet): .endif
@@ -1161,6 +1075,10 @@
.include "${PORTSDIR}/Mk/bsd.ruby.mk"
.endif
+.if defined(USE_PERL5) || defined(PERL_CONFIGURE) || defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) || defined(PERL_MODBUILD) || ${PORTNAME} == "perl"
+.include "${PORTSDIR}/Mk/bsd.perl.mk"
+.endif
+
.if defined(USE_QT) || defined(USE_QT2) || defined(USE_QT_VER) || defined(USE_KDELIBS_VER) || defined(USE_KDEBASE_VER)
.include "${PORTSDIR}/Mk/bsd.kde.mk"
.endif
@@ -1501,44 +1419,6 @@
.endif
.endif
-PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
- PERL_VER=${PERL_VER} \
- PERL_ARCH=${PERL_ARCH} \
- SITE_PERL=${SITE_PERL_REL}
-
-.if defined(PERL_MODBUILD)
-PERL_CONFIGURE= yes
-CONFIGURE_SCRIPT?= Build.PL
-.if ${PORTNAME} != Module-Build
-BUILD_DEPENDS+= ${SITE_PERL}/Module/Build.pm:${PORTSDIR}/devel/p5-Module-Build
-.endif
-ALL_TARGET?=
-PL_BUILD?= Build
-CONFIGURE_ARGS+= \
- install_path=lib="${PREFIX}/${SITE_PERL_REL}" \
- install_path=arch="${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}" \
- install_path=script="${PREFIX}/bin" \
- install_path=bin="${PREFIX}/bin" \
- install_path=libdoc="${MAN3PREFIX}/man/man3" \
- install_path=bindoc="${MAN1PREFIX}/man/man1"
-.endif
-
-.if defined(PERL_CONFIGURE)
-USE_PERL5= yes
-USE_REINPLACE=yes
-.endif
-
-.if ${PERL_LEVEL} >= 500600
-.if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
-EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
-PATCH_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
-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(USE_MYSQL)
DEFAULT_MYSQL_VER?= 40
# MySQL client version currently supported.
@@ -1597,6 +1477,10 @@
.include "${PORTSDIR}/Mk/bsd.python.mk"
.endif
+.if defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN)
+.include "${PORTSDIR}/Mk/bsd.perl.mk"
+.endif
+
.if exists(${PORTSDIR}/../Makefile.inc)
.include "${PORTSDIR}/../Makefile.inc"
USE_SUBMAKE= yes
@@ -2394,14 +2278,6 @@
LATEST_LINK?= ${PKGBASE}
PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${LATEST_LINK}${PKG_SUFX}
-.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
-
CONFIGURE_SCRIPT?= configure
CONFIGURE_TARGET?= ${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_LOG?= config.log
@@ -3109,19 +2985,6 @@
${FALSE}; \
fi)
.endif
-.if defined(PERL_CONFIGURE)
- @cd ${CONFIGURE_WRKSRC} && \
- ${SETENV} ${CONFIGURE_ENV} \
- ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
-.if !defined(PERL_MODBUILD)
- @cd ${CONFIGURE_WRKSRC} && \
- ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile
-.if ${PERL_LEVEL} <= 500503
- @cd ${CONFIGURE_WRKSRC} && \
- ${PERL5} -pi -e 's/^(INSTALLSITELIB|INSTALLSITEARCH|SITELIBEXP|SITEARCHEXP|INSTALLMAN1DIR|INSTALLMAN3DIR) = \/usr\/local/$$1 = \$$(PREFIX)/' Makefile
-.endif
-.endif
-.endif
.if defined(USE_IMAKE)
@(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
.endif
@@ -3134,13 +2997,9 @@
.if defined(USE_GMAKE)
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
.else
-.if defined(PERL_MODBUILD)
- @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${ALL_TARGET})
-.else
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
.endif
.endif
-.endif
# Check conflicts
@@ -3183,15 +3042,11 @@
.endif
.endif
.else # !defined(USE_GMAKE)
-.if defined(PERL_MODBUILD)
- @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${INSTALL_TARGET})
-.else
@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
.if ${XFREE86_HTML_MAN:L} == yes
@${MKHTMLINDEX} ${PREFIX}/lib/X11/doc/html
-.endif
.endif
.endif
.endif
-------------- next part --------------
# -*- mode: Makefile; tab-width: 4; -*-
# ex: ts=4
#
# bsd.perl.mk - Utility for perl related ports
#
# Created by: Sergey Matveychuk <sem at ciam.ru>
#
# $FreeBSD: $
#
##
# USE_PERL5_BUILD - Says that the port uses perl5 in one or more of
# the extract, patch, build or install phases.
# USE_PERL5_RUN - Says that the port uses perl5 for running.
# USE_PERL5 - Implements both USE_PERL5_BUILD and USE_PERL5_RUN.
# 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.
# PERL_MODBUILD - Use Module::Build to configure, build and install
# port.
#
# For configure:
# PERL_CONFIGURE - Configure using Perl's MakeMaker. Implies USE_PERL5.
# CONFIGURE_SCRIPT - Name of configure script (default: "Makefile.PL" or
# "Build.PL" if PERL_MODBUILD is set).
# CONFIGURE_ARGS - Pass these args to configure script
# (default: "CC=${CC} CCFLAGS=${CFLAGS} PREFIX=${PREFIX}
# INSTALLPRIVLIB=${PREFIX}/lib INSTALLARCHLIB=${PREFIX}/lib").
##
.if !defined(_POSTMKINCLUDED) && !defined(Perl_Pre_Include)
Perl_Pre_Include= bsd.perl.mk
.if ${OSVERSION} >= 502100
PERL_VERSION?= 5.8.5
PERL_VER?= 5.8.5
.else
.if ${OSVERSION} >= 500032
PERL_VERSION?= 5.6.1
PERL_VER?= 5.6.1
.else
.if ${OSVERSION} >= 500007
PERL_VERSION?= 5.6.0
PERL_VER?= 5.6.0
.else
.if ${OSVERSION} >= 300000
PERL_VERSION?= 5.00503
.else
PERL_VERSION?= 5.00502
.endif
PERL_VER?= 5.005
.endif
.endif
.endif
.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 ${PERL_LEVEL} >= 500600
PERL_ARCH?= mach
.else
PERL_ARCH?= ${ARCH}-freebsd
.endif
.if ${PERL_LEVEL} >= 500800
PERL_PORT?= perl5.8
.else
PERL_PORT?= perl5
.endif
SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
.if ${PERL_LEVEL} < 500600
PERL5= /usr/bin/perl${PERL_VERSION}
PERL= /usr/bin/perl
.else
PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION}
PERL= ${LOCALBASE}/bin/perl
.endif
PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
PERL_VER=${PERL_VER} \
PERL_ARCH=${PERL_ARCH} \
SITE_PERL=${SITE_PERL_REL}
.if defined(PERL_MODBUILD)
PERL_CONFIGURE= yes
CONFIGURE_SCRIPT?= Build.PL
.if ${PORTNAME} != Module-Build
BUILD_DEPENDS+= ${SITE_PERL}/Module/Build.pm:${PORTSDIR}/devel/p5-Module-Build
.endif
ALL_TARGET?=
PL_BUILD?= Build
CONFIGURE_ARGS+= \
install_path=lib="${PREFIX}/${SITE_PERL_REL}" \
install_path=arch="${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}" \
install_path=script="${PREFIX}/bin" \
install_path=bin="${PREFIX}/bin" \
install_path=libdoc="${MAN3PREFIX}/man/man3" \
install_path=bindoc="${MAN1PREFIX}/man/man1"
.endif
.if defined(USE_PERL5)
USE_PERL5_BUILD= yes
USE_PERL5_RUN= yes
.endif
.if defined(PERL_CONFIGURE)
USE_PERL5_BUILD= yes
.endif
.endif # !defined(_POSTMKINCLUDED) && !defined(Perl_Pre_Include)
.if defined(_POSTMKINCLUDED) && !defined(Perl_Post_Include)
Perl_Post_Include= bsd.perl.mk
.if ${PERL_LEVEL} >= 500600
.if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
PATCH_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
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 !target(do-configure) && defined(PERL_CONFIGURE)
do-configure:
@cd ${CONFIGURE_WRKSRC} && \
${SETENV} ${CONFIGURE_ENV} \
${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
.if !defined(PERL_MODBUILD)
@cd ${CONFIGURE_WRKSRC} && \
${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile
.if ${PERL_LEVEL} <= 500503
@cd ${CONFIGURE_WRKSRC} && \
${PERL5} -pi -e 's/^(INSTALLSITELIB|INSTALLSITEARCH|SITELIBEXP|SITEARCHEXP|INSTALLMAN1DIR|INSTALLMAN3DIR) = \/usr\/local/$$1 = \$$(PREFIX)/' Makefile
.endif
.endif
.endif
.if !target(do-build) && defined(PERL_MODBUILD)
do-build:
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${ALL_TARGET})
.endif
.if !target(do-install) && defined(PERL_MODBUILD)
do-install:
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${INSTALL_TARGET})
.endif
.endif # !defined(Perl_Include)
More information about the freebsd-perl
mailing list