summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-10-19 05:01:52 +0000
committerjlam <jlam@pkgsrc.org>2005-10-19 05:01:52 +0000
commit99b59c7da95b5a98eb2eedae70604d5239c86f35 (patch)
tree6db5fa4a17742fe5c094dd74990cf897bab876b4 /lang
parentc115a517c9e6d40a4b23c0c230573ed894bdd6e5 (diff)
downloadpkgsrc-99b59c7da95b5a98eb2eedae70604d5239c86f35.tar.gz
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.
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5/packlist.mk35
1 files changed, 34 insertions, 1 deletions
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