Sun May 9 18:46:34 2010 UTC ()
Fix issue with PLIST generation by not reading existing .packlist.


(morr)
diff -r1.61 -r1.62 pkgsrc/lang/perl5/module.mk

cvs diff -r1.61 -r1.62 pkgsrc/lang/perl5/module.mk (switch to unified diff)

--- pkgsrc/lang/perl5/module.mk 2010/01/16 15:02:14 1.61
+++ pkgsrc/lang/perl5/module.mk 2010/05/09 18:46:34 1.62
@@ -1,229 +1,230 @@ @@ -1,229 +1,230 @@
1# $NetBSD: module.mk,v 1.61 2010/01/16 15:02:14 sno Exp $ 1# $NetBSD: module.mk,v 1.62 2010/05/09 18:46:34 morr Exp $
2# 2#
3# This Makefile fragment is intended to be included by packages that build 3# This Makefile fragment is intended to be included by packages that build
4# and install perl5 modules. 4# and install perl5 modules.
5# 5#
6# The following targets are provided by this file: 6# The following targets are provided by this file:
7# 7#
8# perl5-configure runs the standard perl configuration in 8# perl5-configure runs the standard perl configuration in
9# each of the directories specified in 9# each of the directories specified in
10# ${PERL5_CONFIGURE_DIRS}. 10# ${PERL5_CONFIGURE_DIRS}.
11# 11#
12# do-configure runs the perl5-configure target; if PERL5_CONFIGURE 12# do-configure runs the perl5-configure target; if PERL5_CONFIGURE
13# is set to "YES", then this target overrides the 13# is set to "YES", then this target overrides the
14# default do-configure provided by bsd.pkg.mk. 14# default do-configure provided by bsd.pkg.mk.
15# 15#
16# The following variables may be set prior to including this file: 16# The following variables may be set prior to including this file:
17# 17#
18# PERL5_CONFIGURE if "YES", then for do-configure, run the standard 18# PERL5_CONFIGURE if "YES", then for do-configure, run the standard
19# perl configuration assuming Makefile.PL exists; 19# perl configuration assuming Makefile.PL exists;
20# defaults to "YES". 20# defaults to "YES".
21# 21#
22# PERL5_CONFIGURE_DIRS list of directories in which to run the 22# PERL5_CONFIGURE_DIRS list of directories in which to run the
23# standard perl configuration; defaults to 23# standard perl configuration; defaults to
24# ${CONFIGURE_DIRS}. 24# ${CONFIGURE_DIRS}.
25# 25#
26# PERL5_LDFLAGS extra linker flags to pass on to the build 26# PERL5_LDFLAGS extra linker flags to pass on to the build
27# process. 27# process.
28# 28#
29# PERL5_MODULE_TYPE "MakeMaker", "Module::Build" or "Module::Install" 29# PERL5_MODULE_TYPE "MakeMaker", "Module::Build" or "Module::Install"
30# depending on which framework is used to build/install 30# depending on which framework is used to build/install
31# the module. 31# the module.
32 32
33.include "../../lang/perl5/license.mk" 33.include "../../lang/perl5/license.mk"
34 34
35.if !defined(_PERL5_MODULE_MK) 35.if !defined(_PERL5_MODULE_MK)
36_PERL5_MODULE_MK= # defined 36_PERL5_MODULE_MK= # defined
37 37
38.include "../../mk/bsd.prefs.mk" 38.include "../../mk/bsd.prefs.mk"
39 39
40PERL5_MODULE_TYPE?= MakeMaker 40PERL5_MODULE_TYPE?= MakeMaker
41 41
42.if (${PERL5_MODULE_TYPE} != "MakeMaker") && \ 42.if (${PERL5_MODULE_TYPE} != "MakeMaker") && \
43 (${PERL5_MODULE_TYPE} != "Module::Build") && \ 43 (${PERL5_MODULE_TYPE} != "Module::Build") && \
44 (${PERL5_MODULE_TYPE} != "Module::Install") && \ 44 (${PERL5_MODULE_TYPE} != "Module::Install") && \
45 (${PERL5_MODULE_TYPE} != "Module::Install::Bundled") 45 (${PERL5_MODULE_TYPE} != "Module::Install::Bundled")
46PKG_FAIL_REASON+= "\`\`${PERL5_MODULE_TYPE}'' is not a supported PERL5_MODULE_TYPE." 46PKG_FAIL_REASON+= "\`\`${PERL5_MODULE_TYPE}'' is not a supported PERL5_MODULE_TYPE."
47.endif 47.endif
48 48
49# Default test target for Perl modules 49# Default test target for Perl modules
50TEST_TARGET?= test 50TEST_TARGET?= test
51 51
52.include "../../mk/compiler.mk" 52.include "../../mk/compiler.mk"
53 53
54.if ${PERL5_MODULE_TYPE} == "Module::Build" 54.if ${PERL5_MODULE_TYPE} == "Module::Build"
55_PERL5_MODTYPE= modbuild 55_PERL5_MODTYPE= modbuild
56. if ${_USE_DESTDIR} != "no" 56. if ${_USE_DESTDIR} != "no"
57_PERL5_MODBUILD_DESTDIR_OPTION=--destdir ${DESTDIR:Q} 57_PERL5_MODBUILD_DESTDIR_OPTION=--destdir ${DESTDIR:Q}
58. else 58. else
59_PERL5_MODBUILD_DESTDIR_OPTION= 59_PERL5_MODBUILD_DESTDIR_OPTION=
60. endif 60. endif
61.elif ${PERL5_MODULE_TYPE} == "Module::Install" 61.elif ${PERL5_MODULE_TYPE} == "Module::Install"
62_PERL5_MODTYPE= modinst 62_PERL5_MODTYPE= modinst
63.elif ${PERL5_MODULE_TYPE} == "Module::Install::Bundled" 63.elif ${PERL5_MODULE_TYPE} == "Module::Install::Bundled"
64_PERL5_MODTYPE= modinst 64_PERL5_MODTYPE= modinst
65.elif ${PERL5_MODULE_TYPE} == "MakeMaker" 65.elif ${PERL5_MODULE_TYPE} == "MakeMaker"
66_PERL5_MODTYPE= makemaker 66_PERL5_MODTYPE= makemaker
67.endif 67.endif
68 68
69 69
70########################################################################### 70###########################################################################
71### 71###
72### Add the proper dependencies for using the specified module build 72### Add the proper dependencies for using the specified module build
73### system. 73### system.
74### 74###
75 75
76BUILDLINK_DEPMETHOD.perl+= full 76BUILDLINK_DEPMETHOD.perl+= full
77.include "../../lang/perl5/buildlink3.mk" 77.include "../../lang/perl5/buildlink3.mk"
78 78
79.if empty(PKGPATH:Mdevel/p5-Module-Build) && \ 79.if empty(PKGPATH:Mdevel/p5-Module-Build) && \
80 (${PERL5_MODULE_TYPE} == "Module::Build") 80 (${PERL5_MODULE_TYPE} == "Module::Build")
81BUILD_DEPENDS+= {perl>=5.10,p5-Module-Build>=0.2608nb1}:../../devel/p5-Module-Build 81BUILD_DEPENDS+= {perl>=5.10,p5-Module-Build>=0.2608nb1}:../../devel/p5-Module-Build
82.endif 82.endif
83 83
84.if empty(PKGPATH:Mdevel/p5-Module-Install) && \ 84.if empty(PKGPATH:Mdevel/p5-Module-Install) && \
85 (${PERL5_MODULE_TYPE} == "Module::Install") 85 (${PERL5_MODULE_TYPE} == "Module::Install")
86BUILD_DEPENDS+= p5-Module-Install>=0.91:../../devel/p5-Module-Install 86BUILD_DEPENDS+= p5-Module-Install>=0.91:../../devel/p5-Module-Install
87.endif 87.endif
88 88
89 89
90########################################################################### 90###########################################################################
91### 91###
92### Target definitions (configure, build, install, etc.) 92### Target definitions (configure, build, install, etc.)
93### 93###
94 94
95PERL5_CONFIGURE?= yes 95PERL5_CONFIGURE?= yes
96PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS} 96PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS}
97 97
98MAKE_ENV+= LC_ALL=C 98MAKE_ENV+= LC_ALL=C
99 99
100# All pkgsrc-installed Perl modules are installed into the "vendor" 100# All pkgsrc-installed Perl modules are installed into the "vendor"
101# directories. 101# directories.
102# 102#
103MAKE_PARAMS.makemaker+= INSTALLDIRS=vendor 103MAKE_PARAMS.makemaker+= INSTALLDIRS=vendor
104MAKE_PARAMS.modbuild+= installdirs=vendor 104MAKE_PARAMS.modbuild+= installdirs=vendor
105MAKE_PARAMS.modinst+= installdirs=vendor 105MAKE_PARAMS.modinst+= installdirs=vendor
106 106
107MAKE_PARAMS+= ${MAKE_PARAMS.${_PERL5_MODTYPE}} 107MAKE_PARAMS+= ${MAKE_PARAMS.${_PERL5_MODTYPE}}
108 108
109.PHONY: do-makemaker-configure 109.PHONY: do-makemaker-configure
110do-makemaker-configure: 110do-makemaker-configure:
111 ${RUN} \ 111 ${RUN} \
112 for dir in ${PERL5_CONFIGURE_DIRS}; do \ 112 for dir in ${PERL5_CONFIGURE_DIRS}; do \
113 cd ${WRKSRC}; \ 113 cd ${WRKSRC}; \
114 if ${TEST} -f "$$dir"/Makefile.PL; then \ 114 if ${TEST} -f "$$dir"/Makefile.PL; then \
115 cd "$$dir"; \ 115 cd "$$dir"; \
116 ${SETENV} ${MAKE_ENV} \ 116 ${SETENV} ${MAKE_ENV} \
117 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL ${MAKE_PARAMS}; \ 117 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL ${MAKE_PARAMS}; \
118 fi; \ 118 fi; \
119 done 119 done
120 120
121.PHONY: do-modbuild-configure 121.PHONY: do-modbuild-configure
122do-modbuild-configure: 122do-modbuild-configure:
123 ${RUN} \ 123 ${RUN} \
124 for dir in ${PERL5_CONFIGURE_DIRS}; do \ 124 for dir in ${PERL5_CONFIGURE_DIRS}; do \
125 cd ${WRKSRC}; \ 125 cd ${WRKSRC}; \
126 if ${TEST} -f "$$dir"/Build.PL; then \ 126 if ${TEST} -f "$$dir"/Build.PL; then \
127 cd "$$dir"; \ 127 cd "$$dir"; \
128 ${SETENV} ${MAKE_ENV} \ 128 ${SETENV} ${MAKE_ENV} \
129 ${BUILDLINK_PREFIX.perl}/bin/perl Build.PL ${MAKE_PARAMS}; \ 129 ${BUILDLINK_PREFIX.perl}/bin/perl Build.PL ${MAKE_PARAMS}; \
130 fi; \ 130 fi; \
131 done 131 done
132 132
133.PHONY: do-modinst-configure 133.PHONY: do-modinst-configure
134do-modinst-configure: 134do-modinst-configure:
135.if ${PERL5_MODULE_TYPE} == "Module::Install" 135.if ${PERL5_MODULE_TYPE} == "Module::Install"
136 ${RUN} \ 136 ${RUN} \
137 for dir in ${PERL5_CONFIGURE_DIRS}; do \ 137 for dir in ${PERL5_CONFIGURE_DIRS}; do \
138 cd ${WRKSRC}; \ 138 cd ${WRKSRC}; \
139 if ${TEST} -d "$$dir"/inc/Module; then \ 139 if ${TEST} -d "$$dir"/inc/Module; then \
140 ${RM} -rf "$$dir"/inc/Module; \ 140 ${RM} -rf "$$dir"/inc/Module; \
141 fi; \ 141 fi; \
142 if ${TEST} -f "$$dir"/Makefile.PL; then \ 142 if ${TEST} -f "$$dir"/Makefile.PL; then \
143 cd "$$dir"; \ 143 cd "$$dir"; \
144 ${SETENV} ${MAKE_ENV} \ 144 ${SETENV} ${MAKE_ENV} \
145 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \ 145 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \
146 fi; \ 146 fi; \
147 done 147 done
148.else 148.else
149 ${RUN} \ 149 ${RUN} \
150 for dir in ${PERL5_CONFIGURE_DIRS}; do \ 150 for dir in ${PERL5_CONFIGURE_DIRS}; do \
151 cd ${WRKSRC}; \ 151 cd ${WRKSRC}; \
152 if ${TEST} -f "$$dir"/Makefile.PL; then \ 152 if ${TEST} -f "$$dir"/Makefile.PL; then \
153 cd "$$dir"; \ 153 cd "$$dir"; \
154 ${SETENV} ${MAKE_ENV} \ 154 ${SETENV} ${MAKE_ENV} \
155 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \ 155 ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \
156 fi; \ 156 fi; \
157 done 157 done
158.endif 158.endif
159 159
160.PHONY: perl5-configure 160.PHONY: perl5-configure
161perl5-configure: do-${_PERL5_MODTYPE}-configure 161perl5-configure: do-${_PERL5_MODTYPE}-configure
162 162
163.if !empty(PERL5_CONFIGURE:M[yY][eE][sS]) 163.if !empty(PERL5_CONFIGURE:M[yY][eE][sS])
164do-configure: perl5-configure 164do-configure: perl5-configure
165.endif 165.endif
166 166
167.PHONY: do-modbuild-build 167.PHONY: do-modbuild-build
168do-modbuild-build: 168do-modbuild-build:
169 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build 169 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build
170 170
171.PHONY: do-modbuild-test 171.PHONY: do-modbuild-test
172do-modbuild-test: 172do-modbuild-test:
173 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build test 173 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build test
174 174
175.PHONY: do-modbuild-install 175.PHONY: do-modbuild-install
176do-modbuild-install: 176do-modbuild-install:
177 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install ${_PERL5_MODBUILD_DESTDIR_OPTION} 177 @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install ${_PERL5_MODBUILD_DESTDIR_OPTION}
178 178
179.if target(do-${_PERL5_MODTYPE}-build) && !defined(NO_BUILD) 179.if target(do-${_PERL5_MODTYPE}-build) && !defined(NO_BUILD)
180do-build: do-${_PERL5_MODTYPE}-build 180do-build: do-${_PERL5_MODTYPE}-build
181do-test: do-${_PERL5_MODTYPE}-test 181do-test: do-${_PERL5_MODTYPE}-test
182.endif 182.endif
183.if target(do-${_PERL5_MODTYPE}-install) 183.if target(do-${_PERL5_MODTYPE}-install)
184do-install: do-${_PERL5_MODTYPE}-install 184do-install: do-${_PERL5_MODTYPE}-install
185.endif 185.endif
186 186
187 187
188########################################################################### 188###########################################################################
189### 189###
190### Make variable overrides 190### Make variable overrides
191### 191###
192 192
193# MakeMaker provides two hooks, OPTIMIZE and OTHERLDFLAGS, to 193# MakeMaker provides two hooks, OPTIMIZE and OTHERLDFLAGS, to
194# customize the arguments passed to the preprocessor and linker, 194# customize the arguments passed to the preprocessor and linker,
195# respectively. 195# respectively.
196# 196#
197PERL5_MAKE_FLAGS.makemaker+= OPTIMIZE=${CFLAGS:Q}" "${CPPFLAGS:Q} 197PERL5_MAKE_FLAGS.makemaker+= OPTIMIZE=${CFLAGS:Q}" "${CPPFLAGS:Q}
198.if ${OBJECT_FMT} == "a.out" 198.if ${OBJECT_FMT} == "a.out"
199PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:S/-Wl,//g:Q} 199PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:S/-Wl,//g:Q}
200.else 200.else
201PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:Q} 201PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:Q}
202.endif 202.endif
203 203
204# Repoint all of the vendor-specific variables to be under the perl5 204# Repoint all of the vendor-specific variables to be under the perl5
205# module's ${PREFIX}. 205# module's ${PREFIX}.
206# 206#
207.include "../../lang/perl5/vars.mk" 207.include "../../lang/perl5/vars.mk"
208.for _var_ in ${_PERL5_VARS} 208.for _var_ in ${_PERL5_VARS}
209PERL5_MAKE_FLAGS.makemaker+= ${_var_}=${PERL5_${_var_}:Q} 209PERL5_MAKE_FLAGS.makemaker+= ${_var_}=${PERL5_${_var_}:Q}
210.endfor 210.endfor
211# 211#
212# The PREFIX in the generated Makefile will point to ${_PERL5_PREFIX}, 212# The PREFIX in the generated Makefile will point to ${_PERL5_PREFIX},
213# so override its value to the module's ${PREFIX}. 213# so override its value to the module's ${PREFIX}.
 214# Also, set VENDORARCHEXP, so existing .packlist won't be read.
214# 215#
215PERL5_MAKE_FLAGS.makemaker+= PREFIX=${PREFIX:Q} 216PERL5_MAKE_FLAGS.makemaker+= PREFIX=${PREFIX:Q} VENDORARCHEXP=${DESTDIR}${PERL5_INSTALLVENDORARCH}
216 217
217PERL5_MAKE_FLAGS+= ${PERL5_MAKE_FLAGS.${_PERL5_MODTYPE}} 218PERL5_MAKE_FLAGS+= ${PERL5_MAKE_FLAGS.${_PERL5_MODTYPE}}
218MAKE_FLAGS+= ${PERL5_MAKE_FLAGS} 219MAKE_FLAGS+= ${PERL5_MAKE_FLAGS}
219 220
220.if defined(PERL5_LDFLAGS) && !empty(PERL5_LDFLAGS) 221.if defined(PERL5_LDFLAGS) && !empty(PERL5_LDFLAGS)
221FIX_RPATH+= PERL5_LDFLAGS 222FIX_RPATH+= PERL5_LDFLAGS
222LDFLAGS+= ${PERL5_LDFLAGS} 223LDFLAGS+= ${PERL5_LDFLAGS}
223.endif 224.endif
224 225
225.include "../../lang/perl5/packlist.mk" 226.include "../../lang/perl5/packlist.mk"
226 227
227.include "../../mk/pthread.buildlink3.mk" 228.include "../../mk/pthread.buildlink3.mk"
228 229
229.endif # _PERL5_MODULE_MK 230.endif # _PERL5_MODULE_MK