summaryrefslogtreecommitdiff
path: root/lang/perl5/packlist.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-10-19 04:40:23 +0000
committerjlam <jlam@pkgsrc.org>2005-10-19 04:40:23 +0000
commitcd4158806cd5516cad2436ee75e99afb9bcaf505 (patch)
tree065a3e4065d8160ba4cf8d26cd4bde4d4be2e4bb /lang/perl5/packlist.mk
parenta31bbae10c7e003aa491ea42b2ead37c1b083b0b (diff)
downloadpkgsrc-cd4158806cd5516cad2436ee75e99afb9bcaf505.tar.gz
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 (limited to 'lang/perl5/packlist.mk')
-rw-r--r--lang/perl5/packlist.mk66
1 files changed, 66 insertions, 0 deletions
diff --git a/lang/perl5/packlist.mk b/lang/perl5/packlist.mk
new file mode 100644
index 00000000000..6ebe2217e0c
--- /dev/null
+++ b/lang/perl5/packlist.mk
@@ -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