summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2006-11-03 10:48:05 +0000
committerjoerg <joerg@pkgsrc.org>2006-11-03 10:48:05 +0000
commitd5a346e1baa7eb4075ec6372f093b30eb731245b (patch)
tree2f220f874b72089c54c6c9480f2f2b1333c9bd0c /lang
parent1b5a5c3d148b5d36a30b3a0f0fa2f84abe7d02e2 (diff)
downloadpkgsrc-d5a346e1baa7eb4075ec6372f093b30eb731245b.tar.gz
Further improve packlist logic to handle DESTDIR for Perl modules
as well. Perl itself is special as the DESTDIR does *not* end up in the packlist, but for normal modules it does.
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5/Makefile3
-rw-r--r--lang/perl5/packlist.mk26
2 files changed, 24 insertions, 5 deletions
diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile
index efdf0c55f83..0c5ea50bbd3 100644
--- a/lang/perl5/Makefile
+++ b/lang/perl5/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.123 2006/11/03 07:09:45 joerg Exp $
+# $NetBSD: Makefile,v 1.124 2006/11/03 10:48:05 joerg Exp $
DISTNAME= perl-5.8.8
PKGREVISION= 3
@@ -325,6 +325,7 @@ INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
PERL5_PACKLIST_DIR_cmd= . ${WRKSRC}/config.sh; echo $$installarchlib
PERL5_PACKLIST_DIR= ${PERL5_PACKLIST_DIR_cmd:sh}
PERL5_PACKLIST= .packlist
+PERL5_PACKLIST_DESTDIR= no
FILES_SUBST+= PERL5_COMMENT=\#
FILES_SUBST+= PERL5_PACKLIST=
PLIST_SRC= ${WRKDIR}/.PLIST_SRC
diff --git a/lang/perl5/packlist.mk b/lang/perl5/packlist.mk
index 44c9f6af97f..f4abeb272f2 100644
--- a/lang/perl5/packlist.mk
+++ b/lang/perl5/packlist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: packlist.mk,v 1.9 2006/11/03 07:09:45 joerg Exp $
+# $NetBSD: packlist.mk,v 1.10 2006/11/03 10:48:05 joerg Exp $
#
# This Makefile fragment is intended to be included by packages that
# create packlist files. This file is automatically included by
@@ -19,6 +19,8 @@ _PERL5_PACKLIST_MK= # defined
.include "../../mk/bsd.prefs.mk"
+PERL5_PACKLIST_DESTDIR?= yes
+
.if defined(PERL5_PACKLIST)
PERL5_PACKLIST_DIR?= ${PERL5_INSTALLVENDORARCH}
_PERL5_REAL_PACKLIST= ${PERL5_PACKLIST:S/^/${PERL5_PACKLIST_DIR}\//}
@@ -48,11 +50,11 @@ PERL5_PLIST_COMMENT_CMD= \
{ ${ECHO} "@comment The following lines are automatically generated"; \
${ECHO} "@comment from the installed .packlist files."; }
PERL5_PLIST_FILES_CMD= \
- { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_REAL_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \
+ { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_REAL_PACKLIST}; do ${TEST} ! -f "${DESTDIR}$$f" || ${ECHO} "$$f"; done; } \
| ${SED} -e "s,[ ].*,," -e "s,/\\./,/,g" -e "s,${PREFIX}/,," \
| ${SORT} -u
PERL5_PLIST_DIRS_CMD= \
- { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_REAL_PACKLIST}; do ${TEST} ! -f "$$f" || ${ECHO} "$$f"; done; } \
+ { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_REAL_PACKLIST}; do ${TEST} ! -f "${DESTDIR}$$f" || ${ECHO} "$$f"; done; } \
| ${SED} -e "s,[ ].*,," -e "s,/\\./,/,g" -e "s,${PREFIX}/,," \
-e "s,^,@unexec "${RMDIR:Q}" -p %D/," \
-e "s,/[^/]*\$$, 2>/dev/null || "${TRUE:Q}"," \
@@ -65,6 +67,21 @@ GENERATE_PLIST+= ${PERL5_GENERATE_PLIST}
###########################################################################
###
+### Packlist DESTDIR handling -- strip off the DESTDIR from each entry.
+###
+
+.if !empty(PERL5_PACKLIST_DESTDIR:M[Yy][Ee][Ss])
+_PERL5_PACKLIST_AWK_STRIP_DESTDIR= \
+ BEGIN { destdir = "${DESTDIR}"; \
+ len_destdir = length(destdir); } \
+ { if (index($$1, destdir) == 1) \
+ $$1 = substr($$1, len_destdir + 1) }
+.else
+_PERL5_PACKLIST_AWK_STRIP_DESTDIR=
+.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.
@@ -94,7 +111,8 @@ perl-packlist:
${ECHO} 1>&2 "Perl packlist $$file is missing."; \
exit 1; \
fi; \
- ${AWK} '${_PERL5_PACKLIST_AWK_STRIP_MANZ} \
+ ${AWK} '${_PERL5_PACKLIST_AWK_STRIP_DESTDIR} \
+ ${_PERL5_PACKLIST_AWK_STRIP_MANZ} \
${_PERL5_PACKLIST_AWK_ADD_MANZ.${_MANZ}} \
{ print $$0 }' \
$$file > $$file.new; \