From 6e6d842c0f6863012be8d6428cdeda476a9040fd Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 19 Oct 2005 04:40:23 +0000 Subject: Split out the packlist-handling code from modules.mk into a separate packlist.mk file, and replace the custom code in perl5/Makefile that duplicated the same packlist handling to just use the routines in packlist.mk. --- lang/perl5/Makefile | 42 ++++++++++++-------------------- lang/perl5/module.mk | 43 ++------------------------------ lang/perl5/packlist.mk | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 68 deletions(-) create mode 100644 lang/perl5/packlist.mk (limited to 'lang') diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile index 878f51b490a..cd65d16d33b 100644 --- a/lang/perl5/Makefile +++ b/lang/perl5/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.104 2005/10/10 17:33:15 joerg Exp $ +# $NetBSD: Makefile,v 1.105 2005/10/19 04:40:23 jlam Exp $ # The following two variables should have empty values unless we're # building a perl snapshot or release candidate. @@ -268,12 +268,6 @@ SUBST_FILES.dirmode= installhtml installman installperl \ lib/ExtUtils/Install.pm SUBST_SED.dirmode= -e "s/755/${PKGDIRMODE}/g;/umask(/d" -USE_PKGINSTALL= yes -INSTALL_EXTRA_TMPL+= ${FILESDIR}/install.tmpl -DEINSTALL_EXTRA_TMPL+= ${FILESDIR}/deinstall.tmpl -FILES_SUBST+= PERL5_PACKLIST= -FILES_SUBST+= PERL5_COMMENT=\# - # It's tough to guess which hints file will be used, so add our modifications # to all of them: # @@ -308,23 +302,25 @@ pre-configure: done .endif -PLIST_SRC= ${WRKDIR}/.PLIST_SRC -PLIST_FILE_SED= -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," -PLIST_DIR_SED= ${PLIST_FILE_SED} \ - -e "s,^,@unexec \${RMDIR} -p %D/," \ - -e "s,/[^/]*$$, 2>/dev/null || ${TRUE}," \ - INSTALLATION_DIRS= bin man/man1 +PERL5_PACKLIST_DIR_cmd= eval `${PERL5} -V:installarchlib 2>/dev/null`; \ + echo $$installarchlib +PERL5_PACKLIST_DIR= ${PERL5_PACKLIST_DIR_cmd:sh} +PERL5_PACKLIST= .packlist +FILES_SUBST+= PERL5_COMMENT=\# +FILES_SUBST+= PERL5_PACKLIST= +PLIST_SRC= ${WRKDIR}/.PLIST_SRC post-build: @${SED} ${FILES_SUBST_SED} ${FILESDIR}/perllink.in \ > ${WRKDIR}/perllink -post-install: +post-install: perl5-post-install + +perl5-post-install: if ${TEST} -x ${PREFIX}/bin/a2p; then \ strip ${PREFIX}/bin/a2p; \ fi - eval `${PERL5} -V:installarchlib 2>/dev/null`; \ eval `${PERL5} -V:installsitearch 2>/dev/null`; \ eval `${PERL5} -V:installvendorarch 2>/dev/null`; \ ${RMDIR} -p $$installsitearch 2>/dev/null || ${TRUE}; \ @@ -336,18 +332,10 @@ post-install: ${RM} -f ${PREFIX}/bin/perllink ${PREFIX}/man/man1/perllink.1; \ ${LN} -s $$scriptdir/perllink ${PREFIX}/bin/perllink; \ ${LN} -s $$man1dir/perllink.1 ${PREFIX}/man/man1/perllink.1; \ - packlist="$$installarchlib/.packlist"; \ { ${CAT} ${PKGDIR}/PLIST; \ - ${ECHO} "@comment The following lines are automatically generated"; \ - ${ECHO} "@comment from the installed .packlist files."; \ - { ${ECHO} "$$packlist"; ${CAT} $$packlist; \ - ${ECHO} "$$scriptdir/perllink"; \ - ${ECHO} "$$man1dir/perllink.1"; \ - } | ${SED} ${PLIST_FILE_SED} | ${SORT} -u; \ - { ${ECHO} "$$packlist"; ${CAT} $$packlist; \ - ${ECHO} "$$scriptdir/perllink"; \ - ${ECHO} "$$man1dir/perllink.1"; \ - } | ${SED} ${PLIST_DIR_SED} | ${SORT} -ur; \ - } > ${PLIST_SRC} + ${ECHO} "$$scriptdir/perllink"; \ + ${ECHO} "$$man1dir/perllink.1"; \ + } | ${SED} -e "s,^"${PREFIX:Q}"/,," > ${PLIST_SRC} +.include "packlist.mk" .include "../../mk/bsd.pkg.mk" diff --git a/lang/perl5/module.mk b/lang/perl5/module.mk index 6a115f1b69c..f9f2aadd769 100644 --- a/lang/perl5/module.mk +++ b/lang/perl5/module.mk @@ -1,4 +1,4 @@ -# $NetBSD: module.mk,v 1.49 2005/08/12 19:59:03 jlam Exp $ +# $NetBSD: module.mk,v 1.50 2005/10/19 04:40:23 jlam Exp $ # # This Makefile fragment is intended to be included by packages that build # and install perl5 modules. @@ -175,45 +175,6 @@ FIX_RPATH+= PERL5_LDFLAGS LDFLAGS+= ${PERL5_LDFLAGS} .endif - -########################################################################### -### -### INSTALL/DEINSTALL scripts to manage symlinks -### - -USE_PKGINSTALL= yes -INSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/install.tmpl -DEINSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/deinstall.tmpl -FILES_SUBST+= PERL5_COMMENT= -FILES_SUBST+= PERL5_PACKLIST=${_PERL5_PACKLIST:Q} - - -########################################################################### -### -### Packlist -> PLIST generation -### - -# Generate the PLIST from the files listed in PERL5_PACKLIST. -.if defined(PERL5_PACKLIST) -PERL5_PACKLIST_DIR?= ${PERL5_INSTALLVENDORARCH} -_PERL5_PACKLIST= ${PERL5_PACKLIST:S/^/${PERL5_PACKLIST_DIR}\//} -PERL5_PLIST_COMMENT= \ - { ${ECHO} "@comment The following lines are automatically generated"; \ - ${ECHO} "@comment from the installed .packlist files."; } -PERL5_PLIST_FILES= \ - { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \ - | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \ - | ${SORT} -u -PERL5_PLIST_DIRS= \ - { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \ - | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \ - -e "s,^,@unexec \${RMDIR} -p %D/," \ - -e "s,/[^/]*$$, 2>/dev/null || ${TRUE}," \ - | ${SORT} -ur -PERL5_GENERATE_PLIST= ${PERL5_PLIST_COMMENT}; \ - ${PERL5_PLIST_FILES}; \ - ${PERL5_PLIST_DIRS} -GENERATE_PLIST+= ${PERL5_GENERATE_PLIST}; -.endif +.include "../../lang/perl5/packlist.mk" .endif # _PERL5_MODULE_MK diff --git a/lang/perl5/packlist.mk b/lang/perl5/packlist.mk new file mode 100644 index 00000000000..6ebe2217e0c --- /dev/null +++ b/lang/perl5/packlist.mk @@ -0,0 +1,66 @@ +# $NetBSD: packlist.mk,v 1.1 2005/10/19 04:40:23 jlam Exp $ +# +# This Makefile fragment is intended to be included by packages that +# create packlist files. This file is automatically included by +# perl5/module.mk, so it is typically not necessary to include this +# file. +# +# The following variables should be set prior to including this file: +# +# PERL5_PACKLIST_DIR "install*arch" directory under which packlist +# files are installed; defaults to +# ${PERL5_INSTALLVENDORARCH}. +# +# PERL5_PACKLIST list of packlist files relative to +# ${PERL5_PACKLIST_DIR}. + +.if !defined(_PERL5_PACKLIST_MK) +_PERL5_PACKLIST_MK= # defined + +.include "../../mk/bsd.prefs.mk" + +.if defined(PERL5_PACKLIST) +PERL5_PACKLIST_DIR?= ${PERL5_INSTALLVENDORARCH} +_PERL5_PACKLIST= ${PERL5_PACKLIST:S/^/${PERL5_PACKLIST_DIR}\//} +.endif + + +########################################################################### +### +### INSTALL/DEINSTALL scripts to manage symlinks +### + +USE_PKGINSTALL= yes +INSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/install.tmpl +DEINSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/deinstall.tmpl +FILES_SUBST+= PERL5_COMMENT= +FILES_SUBST+= PERL5_PACKLIST=${_PERL5_PACKLIST:Q} + + +########################################################################### +### +### Packlist -> PLIST generation +### + +# Generate the PLIST from the files listed in PERL5_PACKLIST. +.if defined(_PERL5_PACKLIST) +PERL5_PLIST_COMMENT= \ + { ${ECHO} "@comment The following lines are automatically generated"; \ + ${ECHO} "@comment from the installed .packlist files."; } +PERL5_PLIST_FILES= \ + { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \ + | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \ + | ${SORT} -u +PERL5_PLIST_DIRS= \ + { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \ + | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \ + -e "s,^,@unexec \${RMDIR} -p %D/," \ + -e "s,/[^/]*$$, 2>/dev/null || ${TRUE}," \ + | ${SORT} -ur +PERL5_GENERATE_PLIST= ${PERL5_PLIST_COMMENT}; \ + ${PERL5_PLIST_FILES}; \ + ${PERL5_PLIST_DIRS} +GENERATE_PLIST+= ${PERL5_GENERATE_PLIST}; +.endif + +.endif # _PERL5_PACKLIST_MK -- cgit v1.2.3