From 6300e91e28288304d570d7b2d0857299bc4033fb Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 19 Oct 2005 05:01:52 +0000 Subject: Teach pkgsrc to modify the installed .packlist files so that if MANZ is "yes", then they list the compressed manpages. Implementation stolen from the PLIST MANZ-handling code in bsd.pkg.mk added by Stoned Elipot. This should fix pkg/31499. --- lang/perl5/packlist.mk | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'lang') diff --git a/lang/perl5/packlist.mk b/lang/perl5/packlist.mk index 6ebe2217e0c..ba294388c4b 100644 --- a/lang/perl5/packlist.mk +++ b/lang/perl5/packlist.mk @@ -1,4 +1,4 @@ -# $NetBSD: packlist.mk,v 1.1 2005/10/19 04:40:23 jlam Exp $ +# $NetBSD: packlist.mk,v 1.2 2005/10/19 05:01:52 jlam Exp $ # # This Makefile fragment is intended to be included by packages that # create packlist files. This file is automatically included by @@ -63,4 +63,37 @@ PERL5_GENERATE_PLIST= ${PERL5_PLIST_COMMENT}; \ GENERATE_PLIST+= ${PERL5_GENERATE_PLIST}; .endif +########################################################################### +### +### Packlist MANZ handling -- modify the .packlist so that it properly +### records either compressed or uncompressed manpages depending on +### how pkgsrc modifies them after installation. +### + +_PERL5_PACKLIST_MANPAGE_RE= \ + ^(\/[^ \/]*)*\/man(\/[^ \/]*)?\/(man[1-9ln]\/[^ \/]*\.[1-9ln]|cat[1-9ln]\/[^ \/]*\.[0-9]) + +_PERL5_PACKLIST_AWK_STRIP_MANZ= \ + /${_PERL5_PACKLIST_MANPAGE_RE}\.gz/ \ + { $$1 = substr($$1, 1, length($$1) - 3); } + +_PERL5_PACKLIST_AWK_ADD_MANZ.no= # empty +_PERL5_PACKLIST_AWK_ADD_MANZ.yes= \ + /${_PERL5_PACKLIST_MANPAGE_RE}/ { $$1 = $$1 ".gz"; } + +.if defined(_PERL5_PACKLIST) +post-install: perl-packlist +.endif + +perl-packlist: + ${_PKG_SILENT}${_PKG_DEBUG} \ + ${TEST} -n ${_PERL5_PACKLIST:Q}"" || exit 0; \ + for file in ${_PERL5_PACKLIST}; do \ + ${AWK} '${_PERL5_PACKLIST_AWK_STRIP_MANZ} \ + ${_PERL5_PACKLIST_AWK_ADD_MANZ.${_MANZ}} \ + { print $$0 }' \ + $$file > $$file.new; \ + ${MV} -f $$file.new $$file; \ + done + .endif # _PERL5_PACKLIST_MK -- cgit v1.2.3