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

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.162 - (hide annotations) (download)
Sun Feb 1 12:01:06 2015 UTC (3 weeks, 4 days ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.161: +7 -28 lines
Drop support for EAPI=4

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.162 # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.161 2014/12/17 16:40:53 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.160 ewarn "perl-modules.eclass: perl-module_src_prep is deprecated and will be removed. Please use perl-module_src_configure instead."
178 dilfridge 1.159 perl-module_src_configure
179     }
180    
181 monsieurp 1.150 # @FUNCTION: perl-module_src_compile
182     # @USAGE: perl-module_src_compile
183     # @DESCRIPTION:
184     # Compile the ebuild sources.
185     # This function is to be called during the ebuild src_compile() phase.
186 aliz 1.15 perl-module_src_compile() {
187 tove 1.123 debug-print-function $FUNCNAME "$@"
188     perl_set_version
189 tove 1.113
190 tove 1.127 if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
191     local mymake_local=(${mymake})
192     else
193     local mymake_local=("${mymake[@]}")
194     fi
195    
196 tove 1.113 if [[ -f Build ]] ; then
197     ./Build build \
198 tove 1.127 || die "Compilation failed"
199 tove 1.113 elif [[ -f Makefile ]] ; then
200 tove 1.127 set -- \
201 tove 1.113 OTHERLDFLAGS="${LDFLAGS}" \
202 tove 1.127 "${mymake_local[@]}"
203     einfo "emake" "$@"
204     emake "$@" \
205     || die "Compilation failed"
206 tove 1.113 # OPTIMIZE="${CFLAGS}" \
207 mcummings 1.43 fi
208 seemant 1.8 }
209    
210 monsieurp 1.150 # @FUNCTION: perl-module_src-test
211     # @USAGE: perl-module_src_test()
212     # @DESCRIPTION:
213     # This code attempts to work out your threadingness from MAKEOPTS
214     # and apply them to Test::Harness.
215 tove 1.117 #
216 monsieurp 1.150 # If you want more verbose testing, set TEST_VERBOSE=1
217     # in your bashrc | /etc/portage/make.conf | ENV
218 tove 1.117 #
219 monsieurp 1.150 # or ebuild writers:
220     # If you wish to enable default tests w/ 'make test' ,
221 tove 1.117 #
222 monsieurp 1.150 # SRC_TEST="do"
223 tove 1.117 #
224 monsieurp 1.150 # If you wish to have threads run in parallel ( using the users makeopts )
225     # all of the following have been tested to work.
226 tove 1.117 #
227 monsieurp 1.150 # SRC_TEST="do parallel"
228     # SRC_TEST="parallel"
229     # SRC_TEST="parallel do"
230     # SRC_TEST=parallel
231 tove 1.117 #
232 aliz 1.15 perl-module_src_test() {
233 tove 1.123 debug-print-function $FUNCNAME "$@"
234 tove 1.117 if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then
235     if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then
236 vapier 1.132 export HARNESS_OPTIONS=j$(makeopts_jobs)
237     einfo "Test::Harness Jobs=$(makeopts_jobs)"
238 tove 1.117 fi
239 tove 1.123 ${perlinfo_done} || perl_set_version
240 tove 1.113 if [[ -f Build ]] ; then
241 tove 1.117 ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed"
242 tove 1.113 elif [[ -f Makefile ]] ; then
243 tove 1.117 emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || die "test failed"
244 mcummings 1.68 fi
245 mcummings 1.43 fi
246 seemant 1.1 }
247    
248 monsieurp 1.150 # @FUNCTION: perl-module_src_install
249     # @USAGE: perl-module_src_install
250     # @DESCRIPTION:
251     # Install a Perl ebuild.
252     # This function is to be called during the ebuild src_install() phase.
253 aliz 1.15 perl-module_src_install() {
254 tove 1.123 debug-print-function $FUNCNAME "$@"
255    
256     perl_set_version
257    
258 tove 1.113 local f
259 swegener 1.76
260 tove 1.114 if [[ -z ${mytargets} ]] ; then
261     case "${CATEGORY}" in
262     dev-perl|perl-core) mytargets="pure_install" ;;
263     *) mytargets="install" ;;
264     esac
265     fi
266 swegener 1.76
267 tove 1.127 if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
268     local myinst_local=(${myinst})
269     else
270     local myinst_local=("${myinst[@]}")
271     fi
272    
273 tove 1.113 if [[ -f Build ]] ; then
274     ./Build ${mytargets} \
275     || die "./Build ${mytargets} failed"
276     elif [[ -f Makefile ]] ; then
277 tove 1.127 emake "${myinst_local[@]}" ${mytargets} \
278     || die "emake ${myinst_local[@]} ${mytargets} failed"
279 tove 1.113 fi
280    
281 tove 1.123 perl_delete_module_manpages
282     perl_delete_localpod
283     perl_delete_packlist
284     perl_remove_temppath
285 mcummings 1.20
286 tove 1.123 for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
287 tove 1.117 [[ -s ${f} ]] && dodoc ${f}
288 mcummings 1.98 done
289 mcummings 1.65
290 tove 1.123 perl_link_duallife_scripts
291 seemant 1.35 }
292    
293 monsieurp 1.150 # @FUNCTION: perl-module_pkg_setup
294     # @USAGE: perl-module_pkg_setup
295     # @DESCRIPTION:
296 dilfridge 1.153 # This function was to be called during the pkg_setup() phase.
297     # Deprecated, to be removed. Where it is called, place a call to perl_set_version instead.
298 seemant 1.35 perl-module_pkg_setup() {
299 tove 1.123 debug-print-function $FUNCNAME "$@"
300 dilfridge 1.154 ewarn "perl-modules.eclass: perl-module_pkg_setup is deprecated and will be removed. Please use perl_set_version instead."
301 tove 1.123 perl_set_version
302 seemant 1.35 }
303    
304 monsieurp 1.150 # @FUNCTION: perl-module_pkg_preinst
305     # @USAGE: perl-module_pkg_preinst
306     # @DESCRIPTION:
307 dilfridge 1.153 # This function was to be called during the pkg_preinst() phase.
308     # Deprecated, to be removed. Where it is called, place a call to perl_set_version instead.
309 seemant 1.35 perl-module_pkg_preinst() {
310 tove 1.123 debug-print-function $FUNCNAME "$@"
311 dilfridge 1.155 ewarn "perl-modules.eclass: perl-module_pkg_preinst is deprecated and will be removed. Please use perl_set_version instead."
312 tove 1.123 perl_set_version
313 seemant 1.35 }
314    
315 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postinst
316     # @USAGE: perl-module_pkg_postinst
317     # @DESCRIPTION:
318 dilfridge 1.156 # This function is to be called during the pkg_postinst() phase. It only does
319     # useful things for the perl-core category, where it handles the file renaming and symbolic
320     # links that prevent file collisions for dual-life packages installing scripts.
321     # In any other category it immediately exits.
322 tove 1.117 perl-module_pkg_postinst() {
323 tove 1.123 debug-print-function $FUNCNAME "$@"
324 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
325     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."
326     eqawarn " This does not do anything; the call can be safely removed."
327     return 0
328     fi
329 tove 1.123 perl_link_duallife_scripts
330 tove 1.117 }
331 seemant 1.35
332 monsieurp 1.150 # @FUNCTION: perl-module_pkg_prerm
333     # @USAGE: perl-module_pkg_prerm
334     # @DESCRIPTION:
335 dilfridge 1.156 # This function was to be called during the pkg_prerm() phase.
336     # It does not do anything. Deprecated, to be removed.
337 tove 1.123 perl-module_pkg_prerm() {
338     debug-print-function $FUNCNAME "$@"
339 dilfridge 1.157 ewarn "perl-module.eclass: perl-module_pkg_prerm does not do anything and will be removed. Please remove the call."
340 tove 1.123 }
341 seemant 1.35
342 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postrm
343     # @USAGE: perl-module_pkg_postrm
344     # @DESCRIPTION:
345 dilfridge 1.156 # This function is to be called during the pkg_postrm() phase. It only does
346     # useful things for the perl-core category, where it handles the file renaming and symbolic
347     # links that prevent file collisions for dual-life packages installing scripts.
348     # In any other category it immediately exits.
349 tove 1.117 perl-module_pkg_postrm() {
350 tove 1.123 debug-print-function $FUNCNAME "$@"
351 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
352     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."
353     eqawarn " This does not do anything; the call can be safely removed."
354     return 0
355     fi
356 tove 1.123 perl_link_duallife_scripts
357 tove 1.117 }
358 tove 1.124
359 dilfridge 1.148 # @FUNCTION: perl_set_version
360     # @USAGE: perl_set_version
361     # @DESCRIPTION:
362     # Extract version information and installation paths from the current Perl
363     # interpreter.
364     #
365     # This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB,
366     # ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
367     #
368     # This function used to be called perlinfo as well.
369 tove 1.124 perl_set_version() {
370     debug-print-function $FUNCNAME "$@"
371     debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
372     ${perlinfo_done} && return 0
373     perlinfo_done=true
374    
375     local f version install{{site,vendor}{arch,lib},archlib}
376     eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"
377     PERL_VERSION=${version}
378     SITE_ARCH=${installsitearch}
379     SITE_LIB=${installsitelib}
380     ARCH_LIB=${installarchlib}
381     VENDOR_LIB=${installvendorlib}
382     VENDOR_ARCH=${installvendorarch}
383     }
384    
385 monsieurp 1.149 # @FUNCTION: perlinfo
386     # @USAGE: perlinfo
387     # @DESCRIPTION:
388 monsieurp 1.150 # This function is deprecated.
389 monsieurp 1.149 #
390 monsieurp 1.150 # Please use the function above instead, perl_set_version().
391 monsieurp 1.149 perlinfo() {
392 tove 1.124 debug-print-function $FUNCNAME "$@"
393 dilfridge 1.151 ewarn "perl-modules.eclass: perlinfo is deprecated and will be removed. Please use perl_set_version instead."
394 monsieurp 1.149 perl_set_version
395 tove 1.124 }
396    
397 dilfridge 1.148 # @FUNCTION: perl_delete_localpod
398     # @USAGE: perl_delete_localpod
399     # @DESCRIPTION:
400     # Remove stray perllocal.pod files in the temporary install directory D.
401     #
402     # This function used to be called fixlocalpod as well.
403 tove 1.124 perl_delete_localpod() {
404     debug-print-function $FUNCNAME "$@"
405    
406     find "${D}" -type f -name perllocal.pod -delete
407     find "${D}" -depth -mindepth 1 -type d -empty -delete
408     }
409    
410 monsieurp 1.149 # @FUNCTION: fixlocalpod
411     # @USAGE: fixlocalpod
412     # @DESCRIPTION:
413     # This function is deprecated.
414     #
415 monsieurp 1.150 # Please use the function above instead, perl_delete_localpod().
416 monsieurp 1.149 fixlocalpod() {
417     debug-print-function $FUNCNAME "$@"
418 dilfridge 1.152 ewarn "perl-modules.eclass: fixlocalpod is deprecated and will be removed. Please use perl_delete_localpod instead."
419 monsieurp 1.149 perl_delete_localpod
420     }
421    
422     # @FUNCTION: perl_fix_osx_extra
423     # @USAGE: perl_fix_osx_extra
424     # @DESCRIPTION:
425 monsieurp 1.150 # Look through ${S} for AppleDouble encoded files and get rid of them.
426 tove 1.124 perl_fix_osx_extra() {
427     debug-print-function $FUNCNAME "$@"
428    
429     local f
430     find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
431     einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"
432     rm -f "${f}"
433     f=${f#${S}/}
434     grep -q "${f}" "${S}"/MANIFEST && \
435     elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}"
436     done
437     }
438    
439 monsieurp 1.149 # @FUNCTION: perl_delete_module_manpages
440     # @USAGE: perl_delete_module_manpages
441 monsieurp 1.150 # @DESCRIPTION:
442 monsieurp 1.149 # Bump off manpages installed by the current module such as *.3pm files as well
443     # as empty directories.
444 tove 1.124 perl_delete_module_manpages() {
445     debug-print-function $FUNCNAME "$@"
446    
447     if [[ -d "${ED}"/usr/share/man ]] ; then
448     find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
449     find "${ED}"/usr/share/man -depth -type d -empty -delete
450     fi
451     }
452    
453 monsieurp 1.150 # @FUNCTION: perl_delete_packlist
454     # @USAGE: perl_delete_packlist
455     # @DESCRIPTION:
456     # Look through ${D} for .packlist files, empty .bs files and empty directories,
457     # and get rid of items found.
458 tove 1.124 perl_delete_packlist() {
459     debug-print-function $FUNCNAME "$@"
460     perl_set_version
461 tove 1.125 if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
462     find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \
463 tove 1.124 -o \( -name '*.bs' -a -empty \) \) -delete
464 tove 1.125 find "${D}" -depth -mindepth 1 -type d -empty -delete
465 tove 1.124 fi
466     }
467    
468 monsieurp 1.150 # @FUNCTION: perl_remove_temppath
469     # @USAGE: perl_remove_temppath
470     # @DESCRIPTION:
471     # Look through ${D} for text files containing the temporary installation
472     # folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'.
473 tove 1.124 perl_remove_temppath() {
474     debug-print-function $FUNCNAME "$@"
475    
476     find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
477     if file "${f}" | grep -q -i " text" ; then
478     grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"
479     sed -i -e "s:${D}:/:g" "${f}"
480     fi
481     done
482     }
483    
484 monsieurp 1.145 # @FUNCTION: perl_rm_files
485     # @USAGE: perl_rm_files "file_1" "file_2"
486     # @DESCRIPTION:
487     # Remove certain files from a Perl release and remove them from the MANIFEST
488     # while we're there.
489     #
490     # Most useful in src_prepare for nuking bad tests, and is highly recommended
491     # for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they
492     # test is completely irrelevant to end users, and frequently fail simply
493     # because the authors of Test::Pod... changed their recommendations, and thus
494     # failures are only useful feedback to Authors, not users.
495     #
496     # Removing from MANIFEST also avoids needless log messages warning
497     # users about files "missing from their kit".
498     perl_rm_files() {
499     debug-print-function $FUNCNAME "$@"
500     local skipfile="${T}/.gentoo_makefile_skip"
501     local manifile="${S}/MANIFEST"
502     local manitemp="${T}/.gentoo_manifest_temp"
503     oldifs="$IFS"
504     IFS="\n"
505     for filename in "$@"; do
506     einfo "Removing un-needed ${filename}";
507     # Remove the file
508     rm -f "${S}/${filename}"
509     [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}"
510     done
511     if [[ -e "${manifile}" && -e "${skipfile}" ]]; then
512     einfo "Fixing Manifest"
513     grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}"
514     mv -f -- "${manitemp}" "${manifile}"
515     rm -- "${skipfile}";
516     fi
517     IFS="$oldifs"
518     }
519    
520 monsieurp 1.150 # @FUNCTION: perl_link_duallife_scripts
521     # @USAGE: perl_link_duallife_scripts
522     # @DESCRIPTION:
523 dilfridge 1.156 # Moves files and generates symlinks so dual-life packages installing scripts do not
524     # lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes
525     # only sense for perl-core packages.
526 tove 1.124 perl_link_duallife_scripts() {
527     debug-print-function $FUNCNAME "$@"
528     if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
529     return 0
530     fi
531    
532     local i ff
533     if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
534     for i in "${DUALLIFESCRIPTS[@]}" ; do
535 tove 1.130 alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"
536     done
537     for i in "${DUALLIFEMAN[@]}" ; do
538     ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`
539 tove 1.124 ff=${ff##*.1}
540 tove 1.130 alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"
541 tove 1.124 done
542     else
543     pushd "${ED}" > /dev/null
544     for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
545     mv ${i}{,-${PV}-${P}} || die
546 tove 1.130 #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
547     DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}
548     done
549     for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do
550     mv ${i} ${i%.1}-${PV}-${P}.1 || die
551     DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}
552 tove 1.124 done
553     popd > /dev/null
554     fi
555     }

  ViewVC Help
Powered by ViewVC 1.1.20