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

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.163 - (hide annotations) (download)
Sat Mar 14 14:32:10 2015 UTC (3 years, 7 months ago) by dilfridge
Branch: MAIN
Changes since 1.162: +7 -12 lines
Turn deprecated functions into fatal errors

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

  ViewVC Help
Powered by ViewVC 1.1.20