From 03cc34378c8332695b98c1d53376fc861eff4363 Mon Sep 17 00:00:00 2001 From: jlam Date: Sun, 22 Apr 2001 06:25:18 +0000 Subject: Update perl-mk to 1.1. Changes from version 1.0: * Instead of creating the bsd.perl.mk file at build-time, create it at install-time using the currently-installed perl executable. This change forces that bsd.perl.mk PERL5_* variables to be consistent with the version of the installed perl package, regardless of whether perl-mk is installed as a binary package or not. This fixes a problem noted on tech-pkg by manu@netbsd.org. --- pkgtools/perl-mk/Makefile | 43 ++++++++++++++++++++---------------------- pkgtools/perl-mk/pkg/DEINSTALL | 27 ++++++++++++++++++++++++++ pkgtools/perl-mk/pkg/INSTALL | 35 ++++++++++++++++++++++++++++++++++ pkgtools/perl-mk/pkg/PLIST | 4 ++-- 4 files changed, 84 insertions(+), 25 deletions(-) create mode 100644 pkgtools/perl-mk/pkg/DEINSTALL create mode 100644 pkgtools/perl-mk/pkg/INSTALL (limited to 'pkgtools') diff --git a/pkgtools/perl-mk/Makefile b/pkgtools/perl-mk/Makefile index 8a0ff68da48..ad146a0b13d 100644 --- a/pkgtools/perl-mk/Makefile +++ b/pkgtools/perl-mk/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.2 2001/02/26 07:27:27 jlam Exp $ +# $NetBSD: Makefile,v 1.3 2001/04/22 06:25:18 jlam Exp $ # -DISTNAME= perl-mk-1.0 +DISTNAME= perl-mk-1.1 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty @@ -10,7 +10,7 @@ MAINTAINER= wiz@netbsd.org COMMENT= Note installed perl version for bsd.pkg.mk speedup # for backwards compatibility, and since we want to be included by the -# perl meta-package, we can't just use USE_PERL +# perl meta-package, we can't just use USE_PERL5 DEPENDS+= perl-{5.0*,5.6.0nb[12],base-5.[6-9]*}:../../lang/perl5-base EXTRACT_ONLY= # empty @@ -19,26 +19,23 @@ NO_CONFIGURE= # defined NO_PATCH= # defined NO_BUILD= # defined -MKPATH= ${PREFIX}/share/mk -PLIST_SUBST+= MKPATH="share/mk" - +DEINSTALL_FILE= ${WRKDIR}/DEINSTALL +INSTALL_FILE= ${WRKDIR}/INSTALL + +pre-install: + ${SED} -e "s|@RM@|${RM}|g" \ + ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} + ${SED} -e "s|@RM@|${RM}|g" \ + -e "s|@PERL5@|${PERL5}|g" \ + ${PKGDIR}/INSTALL > ${INSTALL_FILE} + +# The argument to the INSTALL script is misnamed in this case. We are +# actually installing a bsd.perl.mk file, but we'd like to generate it at +# install-time to ensure that the values for the various PERL5_* variables +# are consistent with the installed Perl version. But there is no "INSTALL" +# target for the INSTALL script, so do the work in the "POST-INSTALL" target. +# do-install: - ${ECHO} PERL5_SITELIB=${PERL5_SITELIB} > ${MKPATH}/bsd.perl.mk - ${ECHO} PERL5_SITEARCH=${PERL5_SITEARCH} >> ${MKPATH}/bsd.perl.mk - ${ECHO} PERL5_ARCHLIB=${PERL5_ARCHLIB} >> ${MKPATH}/bsd.perl.mk + PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL .include "../../mk/bsd.pkg.mk" - -# needs PERL5 defined from bsd.pkg.mk -.if !defined(PERL5_SITELIB) -PERL5_SITELIB!= eval `${PERL5} -V:installsitelib 2>/dev/null`; \ - ${ECHO} $${installsitelib} -.endif -.if !defined(PERL5_SITEARCH) -PERL5_SITEARCH!= eval `${PERL5} -V:installsitearch 2>/dev/null`; \ - ${ECHO} $${installsitearch} -.endif -.if !defined(PERL5_ARCHLIB) -PERL5_ARCHLIB!= eval `${PERL5} -V:installarchlib 2>/dev/null`; \ - ${ECHO} $${installarchlib} -.endif diff --git a/pkgtools/perl-mk/pkg/DEINSTALL b/pkgtools/perl-mk/pkg/DEINSTALL new file mode 100644 index 00000000000..370c5bfc909 --- /dev/null +++ b/pkgtools/perl-mk/pkg/DEINSTALL @@ -0,0 +1,27 @@ +#!/bin/sh +# +# $NetBSD: DEINSTALL,v 1.1 2001/04/22 06:25:19 jlam Exp $ + +PKGNAME=$1 +STAGE=$2 + +RM="@RM@" + +BSD_PERL_MK=${PKG_PREFIX}/share/mk/bsd.perl.mk + +case ${STAGE} in +DEINSTALL) + # Remove generated bsd.perl.mk + # + ${RM} -f ${BSD_PERL_MK} + ;; + +POST-DEINSTALL) + ;; + +*) + echo "Unexpected argument: ${STAGE}" + exit 1 + ;; +esac +exit 0 diff --git a/pkgtools/perl-mk/pkg/INSTALL b/pkgtools/perl-mk/pkg/INSTALL new file mode 100644 index 00000000000..46a0e5793f3 --- /dev/null +++ b/pkgtools/perl-mk/pkg/INSTALL @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $NetBSD: INSTALL,v 1.1 2001/04/22 06:25:19 jlam Exp $ + +PKGNAME=$1 +STAGE=$2 + +PERL5="@PERL5@" +RM="@RM@" + +BSD_PERL_MK=${PKG_PREFIX}/share/mk/bsd.perl.mk + +case ${STAGE} in +PRE-INSTALL) + ;; + +POST-INSTALL) + # Generate bsd.perl.mk with hardcoded values for PERL5_* make + # variables for optimization purposes. + # + ${RM} -f ${BSD_PERL_MK} + eval `${PERL5} -V:installsitelib 2>/dev/null` + echo PERL5_SITELIB=${installsitelib} >> ${BSD_PERL_MK} + eval `${PERL5} -V:installsitearch 2>/dev/null` + echo PERL5_SITEARCH=${installsitearch} >> ${BSD_PERL_MK} + eval `${PERL5} -V:installarchlib 2>/dev/null` + echo PERL5_ARCHLIB=${installarchlib} >> ${BSD_PERL_MK} + ;; + +*) + echo "Unexpected argument: ${STAGE}" + exit 1 + ;; +esac +exit 0 diff --git a/pkgtools/perl-mk/pkg/PLIST b/pkgtools/perl-mk/pkg/PLIST index f34ea9e807f..f48f44adce3 100644 --- a/pkgtools/perl-mk/pkg/PLIST +++ b/pkgtools/perl-mk/pkg/PLIST @@ -1,2 +1,2 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2001/02/20 16:23:55 wiz Exp $ -${MKPATH}/bsd.perl.mk +@comment $NetBSD: PLIST,v 1.2 2001/04/22 06:25:19 jlam Exp $ +@comment this plist intentionally left empty -- cgit v1.2.3