/[gentoo-x86]/eclass/perl-module.eclass
Gentoo

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.157 - (hide annotations) (download)
Sat Nov 22 18:24:17 2014 UTC (6 days, 15 hours ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.156: +2 -2 lines
Make calling perl-module_pkg_prerm trigger a real warning

1 dilfridge 1.140 # Copyright 1999-2014 Gentoo Foundation
2 vapier 1.30 # Distributed under the terms of the GNU General Public License v2
3 dilfridge 1.157 # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.156 2014/11/21 01:21:44 dilfridge Exp $
4 tove 1.113
5     # @ECLASS: perl-module.eclass
6     # @MAINTAINER:
7     # perl@gentoo.org
8 vapier 1.131 # @AUTHOR:
9     # Seemant Kulleen <seemant@gentoo.org>
10 tove 1.113 # @BLURB: eclass for perl modules
11     # @DESCRIPTION:
12 seemant 1.1 # The perl-module eclass is designed to allow easier installation of perl
13     # modules, and their incorporation into the Gentoo Linux system.
14 seemant 1.3
15 zlogene 1.139 inherit eutils multiprocessing unpacker
16 tove 1.124 [[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
17 tove 1.117
18     PERL_EXPF="src_unpack src_compile src_test src_install"
19 tove 1.113
20     case "${EAPI:-0}" in
21 dilfridge 1.144 4|5)
22 tove 1.124 PERL_EXPF+=" src_prepare src_configure"
23 tove 1.117 [[ ${CATEGORY} == "perl-core" ]] && \
24 tove 1.124 PERL_EXPF+=" pkg_postinst pkg_postrm"
25 tove 1.113
26     case "${GENTOO_DEPEND_ON_PERL:-yes}" in
27 dilfridge 1.138 yes)
28     case "${EAPI:-0}" in
29     5)
30     case "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" in
31     yes)
32     DEPEND="dev-lang/perl:=[-build(-)]"
33     ;;
34     *)
35     DEPEND="dev-lang/perl[-build(-)]"
36     ;;
37     esac
38     ;;
39     *)
40 mattst88 1.137 DEPEND="|| ( >=dev-lang/perl-5.16 <dev-lang/perl-5.16[-build] )"
41 tove 1.113 ;;
42 dilfridge 1.138 esac
43     RDEPEND="${DEPEND}"
44     ;;
45 tove 1.113 esac
46     ;;
47 tove 1.123 *)
48 tove 1.127 die "EAPI=${EAPI} is not supported by perl-module.eclass"
49 tove 1.123 ;;
50 tove 1.113 esac
51 danarmak 1.13
52 dilfridge 1.147 case "${EAPI:-0}" in
53     5)
54     ;;
55     *)
56     ewarn
57     ewarn "******************************************************************"
58     ewarn "${EBUILD}:"
59     ewarn "Support for EAPI=${EAPI:-0} in perl-module.eclass will be removed"
60     ewarn "on 1/Feb/2015. Please fix your overlay ebuilds to use EAPI=5."
61     ewarn "******************************************************************"
62     ewarn
63     ;;
64     esac
65 dilfridge 1.142
66 tove 1.124 case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
67     yes)
68     EXPORT_FUNCTIONS ${PERL_EXPF}
69     ;;
70     no)
71     debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
72     ;;
73     *)
74 tove 1.127 die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
75 tove 1.124 ;;
76     esac
77 tove 1.117
78 hanno 1.122 LICENSE="${LICENSE:-|| ( Artistic GPL-1 GPL-2 GPL-3 )}"
79 robbat2 1.109
80 tove 1.127 if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
81     : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
82     S=${MY_S:-${WORKDIR}/${MY_P}}
83     fi
84 tove 1.130
85 robbat2 1.128 [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
86     MODULE_A="${MY_P:-${P}}.${MODULE_A_EXT:-tar.gz}"
87 tove 1.113 [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
88 tove 1.123 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
89 tove 1.113 [[ -z "${HOMEPAGE}" ]] && \
90 tove 1.118 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/"
91 mcummings 1.66
92 azarah 1.11 SRC_PREP="no"
93 rac 1.55 SRC_TEST="skip"
94 mcummings 1.97 PREFER_BUILDPL="yes"
95 azarah 1.11
96 mcummings 1.101 pm_echovar=""
97 tove 1.113 perlinfo_done=false
98 seemant 1.35
99 monsieurp 1.150 # @FUNCTION: perl-module_src_unpack
100     # @USAGE: perl-module_src_unpack
101     # @DESCRIPTION:
102     # Unpack the ebuild tarball(s).
103     # This function is to be called during the ebuild src_unpack() phase.
104 mcummings 1.102 perl-module_src_unpack() {
105 tove 1.123 debug-print-function $FUNCNAME "$@"
106 dilfridge 1.141
107 zlogene 1.139 unpacker_src_unpack
108 tove 1.117 has src_prepare ${PERL_EXPF} || perl-module_src_prepare
109 tove 1.113 }
110    
111 monsieurp 1.150 # @FUNCTION: perl-module_src_prepare
112     # @USAGE: perl-module_src_prepare
113     # @DESCRIPTION:
114     # Get the ebuild sources ready.
115     # This function is to be called during the ebuild src_prepare() phase.
116 tove 1.113 perl-module_src_prepare() {
117 tove 1.123 debug-print-function $FUNCNAME "$@"
118 zlogene 1.139 has src_prepare ${PERL_EXPF} && \
119     [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
120     debug-print "$FUNCNAME: applying user patches"
121     epatch_user
122 monsieurp 1.145 if [[ ${PERL_RM_FILES[@]} ]]; then
123     debug-print "$FUNCNAME: stripping unneeded files"
124     perl_rm_files "${PERL_RM_FILES[@]}"
125     fi
126 tove 1.123 perl_fix_osx_extra
127 tove 1.113 esvn_clean
128     }
129    
130 monsieurp 1.150 # @FUNCTION: perl-module_src_configure
131     # @USAGE: perl-module_src_configure
132     # @DESCRIPTION:
133     # Configure the ebuild sources.
134     # This function is to be called during the ebuild src_configure() phase.
135 tove 1.113 perl-module_src_configure() {
136 tove 1.123 debug-print-function $FUNCNAME "$@"
137 tove 1.113 perl-module_src_prep
138 mcummings 1.102 }
139    
140 monsieurp 1.150 # @FUNCTION: perl-module_src_prep
141     # @USAGE: perl-module_src_prep
142     # @DESCRIPTION:
143     # Configure the ebuild sources (bis).
144     #
145     # This function is still around for historical reasons
146     # and will be soon deprecated.
147     #
148     # Please use the function above instead, perl-module_src_configure().
149     #
150     # TODO: Move code to perl-module_src_configure().
151 aliz 1.15 perl-module_src_prep() {
152 tove 1.123 debug-print-function $FUNCNAME "$@"
153 tove 1.117 [[ ${SRC_PREP} = yes ]] && return 0
154 tove 1.113 SRC_PREP="yes"
155 rac 1.60
156 tove 1.123 perl_set_version
157 rac 1.60
158 tove 1.130 [[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
159 mcummings 1.90 # Disable ExtUtils::AutoInstall from prompting
160     export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
161 rac 1.64
162 tove 1.127 if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then
163     local myconf_local=(${myconf})
164     else
165     local myconf_local=("${myconf[@]}")
166     fi
167    
168     if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
169 mcummings 1.97 einfo "Using Module::Build"
170 tove 1.120 if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then
171 tove 1.126 eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
172     eqawarn " Add virtual/perl-Module-Build to DEPEND!"
173 tove 1.127 if [[ -n ${PERLQAFATAL} ]]; then
174     eerror "Bailing out due to PERLQAFATAL=1";
175     die;
176     fi
177 tove 1.120 fi
178 tove 1.123 set -- \
179 tove 1.113 --installdirs=vendor \
180     --libdoc= \
181     --destdir="${D}" \
182     --create_packlist=0 \
183 tove 1.127 "${myconf_local[@]}"
184 tove 1.123 einfo "perl Build.PL" "$@"
185     perl Build.PL "$@" <<< "${pm_echovar}" \
186 tove 1.127 || die "Unable to build!"
187 tove 1.113 elif [[ -f Makefile.PL ]] ; then
188 mcummings 1.85 einfo "Using ExtUtils::MakeMaker"
189 tove 1.123 set -- \
190     PREFIX=${EPREFIX}/usr \
191 tove 1.113 INSTALLDIRS=vendor \
192     INSTALLMAN3DIR='none' \
193     DESTDIR="${D}" \
194 tove 1.127 "${myconf_local[@]}"
195 tove 1.123 einfo "perl Makefile.PL" "$@"
196     perl Makefile.PL "$@" <<< "${pm_echovar}" \
197 tove 1.127 || die "Unable to build!"
198 mcummings 1.88 fi
199 tove 1.113 if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then
200 mcummings 1.88 einfo "No Make or Build file detected..."
201 mcummings 1.85 return
202 mcummings 1.43 fi
203 azarah 1.11 }
204    
205 monsieurp 1.150 # @FUNCTION: perl-module_src_compile
206     # @USAGE: perl-module_src_compile
207     # @DESCRIPTION:
208     # Compile the ebuild sources.
209     # This function is to be called during the ebuild src_compile() phase.
210 aliz 1.15 perl-module_src_compile() {
211 tove 1.123 debug-print-function $FUNCNAME "$@"
212     perl_set_version
213 tove 1.113
214 tove 1.117 has src_configure ${PERL_EXPF} || perl-module_src_prep
215 seemant 1.6
216 tove 1.127 if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
217     local mymake_local=(${mymake})
218     else
219     local mymake_local=("${mymake[@]}")
220     fi
221    
222 tove 1.113 if [[ -f Build ]] ; then
223     ./Build build \
224 tove 1.127 || die "Compilation failed"
225 tove 1.113 elif [[ -f Makefile ]] ; then
226 tove 1.127 set -- \
227 tove 1.113 OTHERLDFLAGS="${LDFLAGS}" \
228 tove 1.127 "${mymake_local[@]}"
229     einfo "emake" "$@"
230     emake "$@" \
231     || die "Compilation failed"
232 tove 1.113 # OPTIMIZE="${CFLAGS}" \
233 mcummings 1.43 fi
234 seemant 1.8 }
235    
236 monsieurp 1.150 # @FUNCTION: perl-module_src-test
237     # @USAGE: perl-module_src_test()
238     # @DESCRIPTION:
239     # This code attempts to work out your threadingness from MAKEOPTS
240     # and apply them to Test::Harness.
241 tove 1.117 #
242 monsieurp 1.150 # If you want more verbose testing, set TEST_VERBOSE=1
243     # in your bashrc | /etc/portage/make.conf | ENV
244 tove 1.117 #
245 monsieurp 1.150 # or ebuild writers:
246     # If you wish to enable default tests w/ 'make test' ,
247 tove 1.117 #
248 monsieurp 1.150 # SRC_TEST="do"
249 tove 1.117 #
250 monsieurp 1.150 # If you wish to have threads run in parallel ( using the users makeopts )
251     # all of the following have been tested to work.
252 tove 1.117 #
253 monsieurp 1.150 # SRC_TEST="do parallel"
254     # SRC_TEST="parallel"
255     # SRC_TEST="parallel do"
256     # SRC_TEST=parallel
257 tove 1.117 #
258 aliz 1.15 perl-module_src_test() {
259 tove 1.123 debug-print-function $FUNCNAME "$@"
260 tove 1.117 if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then
261     if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then
262 vapier 1.132 export HARNESS_OPTIONS=j$(makeopts_jobs)
263     einfo "Test::Harness Jobs=$(makeopts_jobs)"
264 tove 1.117 fi
265 tove 1.123 ${perlinfo_done} || perl_set_version
266 tove 1.113 if [[ -f Build ]] ; then
267 tove 1.117 ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed"
268 tove 1.113 elif [[ -f Makefile ]] ; then
269 tove 1.117 emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || die "test failed"
270 mcummings 1.68 fi
271 mcummings 1.43 fi
272 seemant 1.1 }
273    
274 monsieurp 1.150 # @FUNCTION: perl-module_src_install
275     # @USAGE: perl-module_src_install
276     # @DESCRIPTION:
277     # Install a Perl ebuild.
278     # This function is to be called during the ebuild src_install() phase.
279 aliz 1.15 perl-module_src_install() {
280 tove 1.123 debug-print-function $FUNCNAME "$@"
281    
282     perl_set_version
283    
284 tove 1.113 local f
285 swegener 1.76
286 tove 1.114 if [[ -z ${mytargets} ]] ; then
287     case "${CATEGORY}" in
288     dev-perl|perl-core) mytargets="pure_install" ;;
289     *) mytargets="install" ;;
290     esac
291     fi
292 swegener 1.76
293 tove 1.127 if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
294     local myinst_local=(${myinst})
295     else
296     local myinst_local=("${myinst[@]}")
297     fi
298    
299 tove 1.113 if [[ -f Build ]] ; then
300     ./Build ${mytargets} \
301     || die "./Build ${mytargets} failed"
302     elif [[ -f Makefile ]] ; then
303 tove 1.127 emake "${myinst_local[@]}" ${mytargets} \
304     || die "emake ${myinst_local[@]} ${mytargets} failed"
305 tove 1.113 fi
306    
307 tove 1.123 perl_delete_module_manpages
308     perl_delete_localpod
309     perl_delete_packlist
310     perl_remove_temppath
311 mcummings 1.20
312 tove 1.123 for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
313 tove 1.117 [[ -s ${f} ]] && dodoc ${f}
314 mcummings 1.98 done
315 mcummings 1.65
316 tove 1.123 perl_link_duallife_scripts
317 seemant 1.35 }
318    
319 monsieurp 1.150 # @FUNCTION: perl-module_pkg_setup
320     # @USAGE: perl-module_pkg_setup
321     # @DESCRIPTION:
322 dilfridge 1.153 # This function was to be called during the pkg_setup() phase.
323     # Deprecated, to be removed. Where it is called, place a call to perl_set_version instead.
324 seemant 1.35 perl-module_pkg_setup() {
325 tove 1.123 debug-print-function $FUNCNAME "$@"
326 dilfridge 1.154 ewarn "perl-modules.eclass: perl-module_pkg_setup is deprecated and will be removed. Please use perl_set_version instead."
327 tove 1.123 perl_set_version
328 seemant 1.35 }
329    
330 monsieurp 1.150 # @FUNCTION: perl-module_pkg_preinst
331     # @USAGE: perl-module_pkg_preinst
332     # @DESCRIPTION:
333 dilfridge 1.153 # This function was to be called during the pkg_preinst() phase.
334     # Deprecated, to be removed. Where it is called, place a call to perl_set_version instead.
335 seemant 1.35 perl-module_pkg_preinst() {
336 tove 1.123 debug-print-function $FUNCNAME "$@"
337 dilfridge 1.155 ewarn "perl-modules.eclass: perl-module_pkg_preinst is deprecated and will be removed. Please use perl_set_version instead."
338 tove 1.123 perl_set_version
339 seemant 1.35 }
340    
341 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postinst
342     # @USAGE: perl-module_pkg_postinst
343     # @DESCRIPTION:
344 dilfridge 1.156 # This function is to be called during the pkg_postinst() phase. It only does
345     # useful things for the perl-core category, where it handles the file renaming and symbolic
346     # links that prevent file collisions for dual-life packages installing scripts.
347     # In any other category it immediately exits.
348 tove 1.117 perl-module_pkg_postinst() {
349 tove 1.123 debug-print-function $FUNCNAME "$@"
350 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
351     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."
352     eqawarn " This does not do anything; the call can be safely removed."
353     return 0
354     fi
355 tove 1.123 perl_link_duallife_scripts
356 tove 1.117 }
357 seemant 1.35
358 monsieurp 1.150 # @FUNCTION: perl-module_pkg_prerm
359     # @USAGE: perl-module_pkg_prerm
360     # @DESCRIPTION:
361 dilfridge 1.156 # This function was to be called during the pkg_prerm() phase.
362     # It does not do anything. Deprecated, to be removed.
363 tove 1.123 perl-module_pkg_prerm() {
364     debug-print-function $FUNCNAME "$@"
365 dilfridge 1.157 ewarn "perl-module.eclass: perl-module_pkg_prerm does not do anything and will be removed. Please remove the call."
366 tove 1.123 }
367 seemant 1.35
368 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postrm
369     # @USAGE: perl-module_pkg_postrm
370     # @DESCRIPTION:
371 dilfridge 1.156 # This function is to be called during the pkg_postrm() phase. It only does
372     # useful things for the perl-core category, where it handles the file renaming and symbolic
373     # links that prevent file collisions for dual-life packages installing scripts.
374     # In any other category it immediately exits.
375 tove 1.117 perl-module_pkg_postrm() {
376 tove 1.123 debug-print-function $FUNCNAME "$@"
377 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
378     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."
379     eqawarn " This does not do anything; the call can be safely removed."
380     return 0
381     fi
382 tove 1.123 perl_link_duallife_scripts
383 tove 1.117 }
384 tove 1.124
385 dilfridge 1.148 # @FUNCTION: perl_set_version
386     # @USAGE: perl_set_version
387     # @DESCRIPTION:
388     # Extract version information and installation paths from the current Perl
389     # interpreter.
390     #
391     # This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB,
392     # ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
393     #
394     # This function used to be called perlinfo as well.
395 tove 1.124 perl_set_version() {
396     debug-print-function $FUNCNAME "$@"
397     debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
398     ${perlinfo_done} && return 0
399     perlinfo_done=true
400    
401     local f version install{{site,vendor}{arch,lib},archlib}
402     eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"
403     PERL_VERSION=${version}
404     SITE_ARCH=${installsitearch}
405     SITE_LIB=${installsitelib}
406     ARCH_LIB=${installarchlib}
407     VENDOR_LIB=${installvendorlib}
408     VENDOR_ARCH=${installvendorarch}
409     }
410    
411 monsieurp 1.149 # @FUNCTION: perlinfo
412     # @USAGE: perlinfo
413     # @DESCRIPTION:
414 monsieurp 1.150 # This function is deprecated.
415 monsieurp 1.149 #
416 monsieurp 1.150 # Please use the function above instead, perl_set_version().
417 monsieurp 1.149 perlinfo() {
418 tove 1.124 debug-print-function $FUNCNAME "$@"
419 dilfridge 1.151 ewarn "perl-modules.eclass: perlinfo is deprecated and will be removed. Please use perl_set_version instead."
420 monsieurp 1.149 perl_set_version
421 tove 1.124 }
422    
423 dilfridge 1.148 # @FUNCTION: perl_delete_localpod
424     # @USAGE: perl_delete_localpod
425     # @DESCRIPTION:
426     # Remove stray perllocal.pod files in the temporary install directory D.
427     #
428     # This function used to be called fixlocalpod as well.
429 tove 1.124 perl_delete_localpod() {
430     debug-print-function $FUNCNAME "$@"
431    
432     find "${D}" -type f -name perllocal.pod -delete
433     find "${D}" -depth -mindepth 1 -type d -empty -delete
434     }
435    
436 monsieurp 1.149 # @FUNCTION: fixlocalpod
437     # @USAGE: fixlocalpod
438     # @DESCRIPTION:
439     # This function is deprecated.
440     #
441 monsieurp 1.150 # Please use the function above instead, perl_delete_localpod().
442 monsieurp 1.149 fixlocalpod() {
443     debug-print-function $FUNCNAME "$@"
444 dilfridge 1.152 ewarn "perl-modules.eclass: fixlocalpod is deprecated and will be removed. Please use perl_delete_localpod instead."
445 monsieurp 1.149 perl_delete_localpod
446     }
447    
448     # @FUNCTION: perl_fix_osx_extra
449     # @USAGE: perl_fix_osx_extra
450     # @DESCRIPTION:
451 monsieurp 1.150 # Look through ${S} for AppleDouble encoded files and get rid of them.
452 tove 1.124 perl_fix_osx_extra() {
453     debug-print-function $FUNCNAME "$@"
454    
455     local f
456     find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
457     einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"
458     rm -f "${f}"
459     f=${f#${S}/}
460     grep -q "${f}" "${S}"/MANIFEST && \
461     elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}"
462     done
463     }
464    
465 monsieurp 1.149 # @FUNCTION: perl_delete_module_manpages
466     # @USAGE: perl_delete_module_manpages
467 monsieurp 1.150 # @DESCRIPTION:
468 monsieurp 1.149 # Bump off manpages installed by the current module such as *.3pm files as well
469     # as empty directories.
470 tove 1.124 perl_delete_module_manpages() {
471     debug-print-function $FUNCNAME "$@"
472    
473     if [[ -d "${ED}"/usr/share/man ]] ; then
474     find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
475     find "${ED}"/usr/share/man -depth -type d -empty -delete
476     fi
477     }
478    
479 monsieurp 1.150 # @FUNCTION: perl_delete_packlist
480     # @USAGE: perl_delete_packlist
481     # @DESCRIPTION:
482     # Look through ${D} for .packlist files, empty .bs files and empty directories,
483     # and get rid of items found.
484 tove 1.124 perl_delete_packlist() {
485     debug-print-function $FUNCNAME "$@"
486     perl_set_version
487 tove 1.125 if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
488     find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \
489 tove 1.124 -o \( -name '*.bs' -a -empty \) \) -delete
490 tove 1.125 find "${D}" -depth -mindepth 1 -type d -empty -delete
491 tove 1.124 fi
492     }
493    
494 monsieurp 1.150 # @FUNCTION: perl_remove_temppath
495     # @USAGE: perl_remove_temppath
496     # @DESCRIPTION:
497     # Look through ${D} for text files containing the temporary installation
498     # folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'.
499 tove 1.124 perl_remove_temppath() {
500     debug-print-function $FUNCNAME "$@"
501    
502     find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
503     if file "${f}" | grep -q -i " text" ; then
504     grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"
505     sed -i -e "s:${D}:/:g" "${f}"
506     fi
507     done
508     }
509    
510 monsieurp 1.145 # @FUNCTION: perl_rm_files
511     # @USAGE: perl_rm_files "file_1" "file_2"
512     # @DESCRIPTION:
513     # Remove certain files from a Perl release and remove them from the MANIFEST
514     # while we're there.
515     #
516     # Most useful in src_prepare for nuking bad tests, and is highly recommended
517     # for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they
518     # test is completely irrelevant to end users, and frequently fail simply
519     # because the authors of Test::Pod... changed their recommendations, and thus
520     # failures are only useful feedback to Authors, not users.
521     #
522     # Removing from MANIFEST also avoids needless log messages warning
523     # users about files "missing from their kit".
524     perl_rm_files() {
525     debug-print-function $FUNCNAME "$@"
526     local skipfile="${T}/.gentoo_makefile_skip"
527     local manifile="${S}/MANIFEST"
528     local manitemp="${T}/.gentoo_manifest_temp"
529     oldifs="$IFS"
530     IFS="\n"
531     for filename in "$@"; do
532     einfo "Removing un-needed ${filename}";
533     # Remove the file
534     rm -f "${S}/${filename}"
535     [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}"
536     done
537     if [[ -e "${manifile}" && -e "${skipfile}" ]]; then
538     einfo "Fixing Manifest"
539     grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}"
540     mv -f -- "${manitemp}" "${manifile}"
541     rm -- "${skipfile}";
542     fi
543     IFS="$oldifs"
544     }
545    
546 monsieurp 1.150 # @FUNCTION: perl_link_duallife_scripts
547     # @USAGE: perl_link_duallife_scripts
548     # @DESCRIPTION:
549 dilfridge 1.156 # Moves files and generates symlinks so dual-life packages installing scripts do not
550     # lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes
551     # only sense for perl-core packages.
552 tove 1.124 perl_link_duallife_scripts() {
553     debug-print-function $FUNCNAME "$@"
554     if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
555     return 0
556     fi
557    
558     local i ff
559     if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
560     for i in "${DUALLIFESCRIPTS[@]}" ; do
561 tove 1.130 alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"
562     done
563     for i in "${DUALLIFEMAN[@]}" ; do
564     ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`
565 tove 1.124 ff=${ff##*.1}
566 tove 1.130 alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"
567 tove 1.124 done
568     else
569     pushd "${ED}" > /dev/null
570     for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
571     mv ${i}{,-${PV}-${P}} || die
572 tove 1.130 #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
573     DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}
574     done
575     for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do
576     mv ${i} ${i%.1}-${PV}-${P}.1 || die
577     DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}
578 tove 1.124 done
579     popd > /dev/null
580     fi
581     }

  ViewVC Help
Powered by ViewVC 1.1.20