pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/perl5 Further improve packlist logic to handle DE...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/692554087488
branches:  trunk
changeset: 520958:692554087488
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Nov 03 10:48:05 2006 +0000

description:
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:

 lang/perl5/Makefile    |   3 ++-
 lang/perl5/packlist.mk |  26 ++++++++++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diffs (81 lines):

diff -r 3ea904a0eeef -r 692554087488 lang/perl5/Makefile
--- a/lang/perl5/Makefile       Fri Nov 03 10:42:48 2006 +0000
+++ b/lang/perl5/Makefile       Fri Nov 03 10:48:05 2006 +0000
@@ -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 @@
 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 -r 3ea904a0eeef -r 692554087488 lang/perl5/packlist.mk
--- a/lang/perl5/packlist.mk    Fri Nov 03 10:42:48 2006 +0000
+++ b/lang/perl5/packlist.mk    Fri Nov 03 10:48:05 2006 +0000
@@ -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 @@
 
 .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 @@
        { ${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 @@
 
 ###########################################################################
 ###
+### 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 @@
                        ${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;                            \



Home | Main Index | Thread Index | Old Index