Gentoo Archives: gentoo-commits

From: "Torsten Veller (tove)" <tove@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: perl-helper.eclass perl-module.eclass
Date: Thu, 22 Apr 2010 11:43:35
Message-Id: 20100422114331.1BDA828AEE@corvid.gentoo.org
1 tove 10/04/22 11:43:31
2
3 Modified: perl-helper.eclass perl-module.eclass
4 Log:
5 Add PERL_EXPORT_PHASE_FUNCTIONS and move perl-helper functions back to perl-module
6
7 Revision Changes Path
8 1.2 eclass/perl-helper.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-helper.eclass?rev=1.2&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-helper.eclass?rev=1.2&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-helper.eclass?r1=1.1&r2=1.2
13
14 Index: perl-helper.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/perl-helper.eclass,v
17 retrieving revision 1.1
18 retrieving revision 1.2
19 diff -u -r1.1 -r1.2
20 --- perl-helper.eclass 17 Apr 2010 19:56:27 -0000 1.1
21 +++ perl-helper.eclass 22 Apr 2010 11:43:30 -0000 1.2
22 @@ -1,130 +1,8 @@
23 # Copyright 1999-2010 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/perl-helper.eclass,v 1.1 2010/04/17 19:56:27 tove Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/perl-helper.eclass,v 1.2 2010/04/22 11:43:30 tove Exp $
27
28 -[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
29 +# @DEAD
30
31 -perlinfo() {
32 - debug-print-function $FUNCNAME "$@"
33 - perl_set_version
34 -}
35 -
36 -perl_set_version() {
37 - debug-print-function $FUNCNAME "$@"
38 - debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
39 - ${perlinfo_done} && return 0
40 - perlinfo_done=true
41 -
42 - local f version install{{site,vendor}{arch,lib},archlib}
43 - eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"
44 - PERL_VERSION=${version}
45 - SITE_ARCH=${installsitearch}
46 - SITE_LIB=${installsitelib}
47 - ARCH_LIB=${installarchlib}
48 - VENDOR_LIB=${installvendorlib}
49 - VENDOR_ARCH=${installvendorarch}
50 -}
51 -
52 -fixlocalpod() {
53 - debug-print-function $FUNCNAME "$@"
54 - perl_delete_localpod
55 -}
56 -
57 -perl_delete_localpod() {
58 - debug-print-function $FUNCNAME "$@"
59 -
60 - find "${D}" -type f -name perllocal.pod -delete
61 - find "${D}" -depth -mindepth 1 -type d -empty -delete
62 -}
63 -
64 -perl_fix_osx_extra() {
65 - debug-print-function $FUNCNAME "$@"
66 -
67 - local f
68 - find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
69 - einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"
70 - rm -f "${f}"
71 - f=${f#${S}/}
72 - # f=${f//\//\/}
73 - # f=${f//\./\.}
74 - # sed -i "/${f}/d" "${S}"/MANIFEST || die
75 - grep -q "${f}" "${S}"/MANIFEST && \
76 - elog "AppleDouble encoded Macintosh file in MANIFEST: ${f}"
77 - done
78 -}
79 -
80 -perl_delete_module_manpages() {
81 - debug-print-function $FUNCNAME "$@"
82 -
83 - perl_set_eprefix
84 -
85 - if [[ -d "${ED}"/usr/share/man ]] ; then
86 -# einfo "Cleaning out stray man files"
87 - find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
88 - find "${ED}"/usr/share/man -depth -type d -empty -delete
89 - fi
90 -}
91 -
92 -
93 -perl_delete_packlist() {
94 - debug-print-function $FUNCNAME "$@"
95 - perl_set_version
96 - if [[ -d ${D}/${VENDOR_LIB} ]] ; then
97 - find "${D}/${VENDOR_LIB}" -type f -a \( -name .packlist \
98 - -o \( -name '*.bs' -a -empty \) \) -delete
99 - find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete
100 - fi
101 -}
102 -
103 -perl_remove_temppath() {
104 - debug-print-function $FUNCNAME "$@"
105 -
106 - find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
107 - if file "${f}" | grep -q -i " text" ; then
108 - grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"
109 - sed -i -e "s:${D}:/:g" "${f}"
110 - fi
111 - done
112 -}
113 -
114 -perl_link_duallife_scripts() {
115 - debug-print-function $FUNCNAME "$@"
116 - if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
117 - return 0
118 - fi
119 -
120 - perl_set_eprefix
121 -
122 - local i ff
123 - if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
124 - for i in "${DUALLIFESCRIPTS[@]}" ; do
125 - alternatives_auto_makesym "/usr/bin/${i}" "/usr/bin/${i}-[0-9]*"
126 - ff=`echo "${EROOT}"/usr/share/man/man1/${i}-${PV}-${P}.1*`
127 - ff=${ff##*.1}
128 - alternatives_auto_makesym "/usr/share/man/man1/${i}.1${ff}" "/usr/share/man/man1/${i}-[0-9]*"
129 - done
130 - else
131 - pushd "${ED}" > /dev/null
132 - for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
133 - mv ${i}{,-${PV}-${P}} || die
134 - DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
135 - if [[ -f usr/share/man/man1/${i##*/}.1 ]] ; then
136 - mv usr/share/man/man1/${i##*/}{.1,-${PV}-${P}.1} || die
137 - fi
138 - done
139 - popd > /dev/null
140 - fi
141 -}
142 -
143 -perl_set_eprefix() {
144 - debug-print-function $FUNCNAME "$@"
145 - case ${EAPI:-0} in
146 - 0|1|2)
147 - if ! use prefix; then
148 - EPREFIX=
149 - ED=${D}
150 - EROOT=${ROOT}
151 - fi
152 - ;;
153 - esac
154 -}
155 +PERL_EXPORT_PHASE_FUNCTIONS=no
156 +inherit perl-module
157
158
159
160 1.124 eclass/perl-module.eclass
161
162 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-module.eclass?rev=1.124&view=markup
163 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-module.eclass?rev=1.124&content-type=text/plain
164 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/perl-module.eclass?r1=1.123&r2=1.124
165
166 Index: perl-module.eclass
167 ===================================================================
168 RCS file: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v
169 retrieving revision 1.123
170 retrieving revision 1.124
171 diff -u -r1.123 -r1.124
172 --- perl-module.eclass 17 Apr 2010 19:56:27 -0000 1.123
173 +++ perl-module.eclass 22 Apr 2010 11:43:30 -0000 1.124
174 @@ -1,6 +1,6 @@
175 # Copyright 1999-2009 Gentoo Foundation
176 # Distributed under the terms of the GNU General Public License v2
177 -# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.123 2010/04/17 19:56:27 tove Exp $
178 +# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.124 2010/04/22 11:43:30 tove Exp $
179 #
180 # Author: Seemant Kulleen <seemant@g.o>
181
182 @@ -12,18 +12,19 @@
183 # The perl-module eclass is designed to allow easier installation of perl
184 # modules, and their incorporation into the Gentoo Linux system.
185
186 -inherit perl-helper eutils base
187 +inherit eutils base
188 +[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
189
190 PERL_EXPF="src_unpack src_compile src_test src_install"
191
192 case "${EAPI:-0}" in
193 0|1)
194 - PERL_EXPF="${PERL_EXPF} pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm"
195 + PERL_EXPF+=" pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm"
196 ;;
197 2|3)
198 - PERL_EXPF="${PERL_EXPF} src_prepare src_configure"
199 + PERL_EXPF+=" src_prepare src_configure"
200 [[ ${CATEGORY} == "perl-core" ]] && \
201 - PERL_EXPF="${PERL_EXPF} pkg_postinst pkg_postrm"
202 + PERL_EXPF+=" pkg_postinst pkg_postrm"
203
204 case "${GENTOO_DEPEND_ON_PERL:-yes}" in
205 yes)
206 @@ -37,7 +38,17 @@
207 ;;
208 esac
209
210 -EXPORT_FUNCTIONS ${PERL_EXPF}
211 +case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
212 + yes)
213 + EXPORT_FUNCTIONS ${PERL_EXPF}
214 + ;;
215 + no)
216 + debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
217 + ;;
218 + *)
219 + DEPEND+=" PERL_EXPORT_PHASE_FUNCTIONS-UNSUPPORTED"
220 + ;;
221 +esac
222
223 DESCRIPTION="Based on the $ECLASS eclass"
224
225 @@ -232,3 +243,129 @@
226 debug-print-function $FUNCNAME "$@"
227 perl_link_duallife_scripts
228 }
229 +
230 +perlinfo() {
231 + debug-print-function $FUNCNAME "$@"
232 + perl_set_version
233 +}
234 +
235 +perl_set_version() {
236 + debug-print-function $FUNCNAME "$@"
237 + debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
238 + ${perlinfo_done} && return 0
239 + perlinfo_done=true
240 +
241 + local f version install{{site,vendor}{arch,lib},archlib}
242 + eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"
243 + PERL_VERSION=${version}
244 + SITE_ARCH=${installsitearch}
245 + SITE_LIB=${installsitelib}
246 + ARCH_LIB=${installarchlib}
247 + VENDOR_LIB=${installvendorlib}
248 + VENDOR_ARCH=${installvendorarch}
249 +}
250 +
251 +fixlocalpod() {
252 + debug-print-function $FUNCNAME "$@"
253 + perl_delete_localpod
254 +}
255 +
256 +perl_delete_localpod() {
257 + debug-print-function $FUNCNAME "$@"
258 +
259 + find "${D}" -type f -name perllocal.pod -delete
260 + find "${D}" -depth -mindepth 1 -type d -empty -delete
261 +}
262 +
263 +perl_fix_osx_extra() {
264 + debug-print-function $FUNCNAME "$@"
265 +
266 + # Remove "AppleDouble encoded Macintosh file"
267 + local f
268 + find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
269 + einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"
270 + rm -f "${f}"
271 + f=${f#${S}/}
272 + # f=${f//\//\/}
273 + # f=${f//\./\.}
274 + # sed -i "/${f}/d" "${S}"/MANIFEST || die
275 + grep -q "${f}" "${S}"/MANIFEST && \
276 + elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}"
277 + done
278 +}
279 +
280 +perl_delete_module_manpages() {
281 + debug-print-function $FUNCNAME "$@"
282 +
283 + perl_set_eprefix
284 +
285 + if [[ -d "${ED}"/usr/share/man ]] ; then
286 +# einfo "Cleaning out stray man files"
287 + find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
288 + find "${ED}"/usr/share/man -depth -type d -empty -delete
289 + fi
290 +}
291 +
292 +
293 +perl_delete_packlist() {
294 + debug-print-function $FUNCNAME "$@"
295 + perl_set_version
296 + if [[ -d ${D}/${VENDOR_LIB} ]] ; then
297 + find "${D}/${VENDOR_LIB}" -type f -a \( -name .packlist \
298 + -o \( -name '*.bs' -a -empty \) \) -delete
299 + find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete
300 + fi
301 +}
302 +
303 +perl_remove_temppath() {
304 + debug-print-function $FUNCNAME "$@"
305 +
306 + find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
307 + if file "${f}" | grep -q -i " text" ; then
308 + grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"
309 + sed -i -e "s:${D}:/:g" "${f}"
310 + fi
311 + done
312 +}
313 +
314 +perl_link_duallife_scripts() {
315 + debug-print-function $FUNCNAME "$@"
316 + if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
317 + return 0
318 + fi
319 +
320 + perl_set_eprefix
321 +
322 + local i ff
323 + if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
324 + for i in "${DUALLIFESCRIPTS[@]}" ; do
325 + alternatives_auto_makesym "/usr/bin/${i}" "/usr/bin/${i}-[0-9]*"
326 + ff=`echo "${EROOT}"/usr/share/man/man1/${i}-${PV}-${P}.1*`
327 + ff=${ff##*.1}
328 + alternatives_auto_makesym "/usr/share/man/man1/${i}.1${ff}" "/usr/share/man/man1/${i}-[0-9]*"
329 + done
330 + else
331 + pushd "${ED}" > /dev/null
332 + for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
333 + mv ${i}{,-${PV}-${P}} || die
334 + DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
335 + if [[ -f usr/share/man/man1/${i##*/}.1 ]] ; then
336 + mv usr/share/man/man1/${i##*/}{.1,-${PV}-${P}.1} || die
337 + fi
338 + done
339 + popd > /dev/null
340 + fi
341 +}
342 +
343 +perl_set_eprefix() {
344 + debug-print-function $FUNCNAME "$@"
345 + case ${EAPI:-0} in
346 + 0|1|2)
347 + if ! use prefix; then
348 + EPREFIX=
349 + ED=${D}
350 + EROOT=${ROOT}
351 + fi
352 + ;;
353 + esac
354 +}