pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/perl5 Split out the packlist-handling code from m...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9626554c2017
branches:  trunk
changeset: 501221:9626554c2017
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Oct 19 04:40:23 2005 +0000

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

diffstat:

 lang/perl5/Makefile    |  42 +++++++++++--------------------
 lang/perl5/module.mk   |  43 +-------------------------------
 lang/perl5/packlist.mk |  66 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 68 deletions(-)

diffs (205 lines):

diff -r c7a9f42eac20 -r 9626554c2017 lang/perl5/Makefile
--- a/lang/perl5/Makefile       Wed Oct 19 03:39:43 2005 +0000
+++ b/lang/perl5/Makefile       Wed Oct 19 04:40:23 2005 +0000
@@ -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 @@
                        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 @@
        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 @@
        ${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 -r c7a9f42eac20 -r 9626554c2017 lang/perl5/module.mk
--- a/lang/perl5/module.mk      Wed Oct 19 03:39:43 2005 +0000
+++ b/lang/perl5/module.mk      Wed Oct 19 04:40:23 2005 +0000
@@ -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 @@
 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 -r c7a9f42eac20 -r 9626554c2017 lang/perl5/packlist.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/perl5/packlist.mk    Wed Oct 19 04:40:23 2005 +0000
@@ -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



Home | Main Index | Thread Index | Old Index