Subject: Perl Module::Build and installation to DESTDIR
To: None <tech-pkg@NetBSD.org>
From: Klaus Heinz <k.heinz.mai.sieben@kh-22.de>
List: tech-pkg
Date: 05/16/2007 23:31:11
--APlYHCtpeOhspHkB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
please test the appended patch for lang/perl5/module.mk. This should
enable DESTDIR support for Perl packages using Module::Build.
Worked here for package textproc/p5-Encode-Detect and a not-yet-committed
package.
ciao
Klaus
--APlYHCtpeOhspHkB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="module.mk.diff"
Index: module.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/perl5/module.mk,v
retrieving revision 1.54
diff -u -r1.54 module.mk
--- module.mk 21 Apr 2007 09:41:00 -0000 1.54
+++ module.mk 16 May 2007 21:20:29 -0000
@@ -55,6 +55,11 @@
.if ${PERL5_MODULE_TYPE} == "Module::Build"
_PERL5_MODTYPE= modbuild
+. if ${_USE_DESTDIR} != "no"
+_PERL5_MODBUILD_DESTDIR_OPTION=--destdir ${DESTDIR:Q}
+. else
+_PERL5_MODBUILD_DESTDIR_OPTION=
+. endif
.elif ${PERL5_MODULE_TYPE} == "MakeMaker"
_PERL5_MODTYPE= makemaker
.endif
@@ -134,7 +139,7 @@
.PHONY: do-modbuild-install
do-modbuild-install:
- @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install ${_PERL5_MODBUILD_DESTDIR_OPTION}
.if target(do-${_PERL5_MODTYPE}-build) && !defined(NO_BUILD)
do-build: do-${_PERL5_MODTYPE}-build
--APlYHCtpeOhspHkB--