Gentoo Archives: gentoo-commits

From: Torsten Veller <tove@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/perl-overlay:master commit in: dev-lang/perl/
Date: Sun, 01 Apr 2012 13:32:01
Message-Id: 1333286847.113b08b3da4b483fc5389acf09147de8ebeb0f28.tove@gentoo
1 commit: 113b08b3da4b483fc5389acf09147de8ebeb0f28
2 Author: Torsten Veller <tove <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 1 13:27:27 2012 +0000
4 Commit: Torsten Veller <tove <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 1 13:27:27 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=113b08b3
7
8 Drop the build useflag
9
10 (Portage version: 2.2.0_alpha96/git/Linux x86_64, signed Manifest commit with key 0x4E046AEC)
11
12 ---
13 dev-lang/perl/perl-5.14.2-r1.ebuild | 527 +++++++++++++++++++++++++++++++++++
14 1 files changed, 527 insertions(+), 0 deletions(-)
15
16 diff --git a/dev-lang/perl/perl-5.14.2-r1.ebuild b/dev-lang/perl/perl-5.14.2-r1.ebuild
17 new file mode 100644
18 index 0000000..e210954
19 --- /dev/null
20 +++ b/dev-lang/perl/perl-5.14.2-r1.ebuild
21 @@ -0,0 +1,527 @@
22 +# Copyright 1999-2012 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/perl/perl-5.14.2.ebuild,v 1.4 2012/03/03 12:29:38 grobian Exp $
25 +
26 +EAPI=4
27 +
28 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib
29 +
30 +PATCH_VER=1
31 +
32 +PERL_OLDVERSEN="5.14.0 5.14.1"
33 +MODULE_AUTHOR=FLORA
34 +
35 +SHORT_PV="${PV%.*}"
36 +MY_P="perl-${PV/_rc/-RC}"
37 +MY_PV="${PV%_rc*}"
38 +
39 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
40 +
41 +SRC_URI="
42 + mirror://cpan/src/${MY_P}.tar.bz2
43 + mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MY_P}.tar.bz2
44 + mirror://gentoo/${MY_P}-${PATCH_VER}.tar.bz2
45 + http://dev.gentoo.org/~tove/distfiles/${CATEGORY}/${PN}/${MY_P}-${PATCH_VER}.tar.bz2"
46 +# mirror://cpan/src/${MY_P}.tar.bz2
47 +# mirror://gentoo/${MY_P}-${PATCH_VER}.tar.bz2
48 +HOMEPAGE="http://www.perl.org/"
49 +
50 +LICENSE="|| ( Artistic GPL-1 GPL-2 GPL-3 )"
51 +SLOT="0"
52 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
53 +IUSE="berkdb debug doc gdbm ithreads"
54 +
55 +COMMON_DEPEND="
56 + berkdb? ( sys-libs/db )
57 + gdbm? ( >=sys-libs/gdbm-1.8.3 )
58 + app-arch/bzip2
59 + sys-libs/zlib
60 +"
61 +DEPEND="${COMMON_DEPEND}
62 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
63 +"
64 +RDEPEND="${COMMON_DEPEND}
65 +"
66 +PDEPEND=">=app-admin/perl-cleaner-2.5"
67 +
68 +S="${WORKDIR}/${MY_P}"
69 +
70 +dual_scripts() {
71 + src_remove_dual perl-core/Archive-Tar 1.760.0 ptar ptardiff ptargrep
72 + src_remove_dual perl-core/Digest-SHA 5.610.0 shasum
73 + src_remove_dual perl-core/CPAN 1.960.1_rc cpan
74 + src_remove_dual perl-core/CPANPLUS 0.910.300 cpanp cpan2dist
75 + src_remove_dual_file perl-core/CPANPLUS 0.910.300 /usr/bin/cpanp-run-perl
76 + src_remove_dual perl-core/Encode 2.420.100_rc enc2xs piconv
77 + src_remove_dual perl-core/ExtUtils-MakeMaker 6.570.500_rc instmodsh
78 + src_remove_dual perl-core/ExtUtils-ParseXS 2.221.0 xsubpp
79 + src_remove_dual perl-core/JSON-PP 2.271.50 json_pp
80 + src_remove_dual perl-core/Module-Build 0.380.0 config_data
81 + src_remove_dual perl-core/Module-CoreList 2.490.200_rc corelist
82 + src_remove_dual perl-core/PodParser 1.370.0 pod2usage podchecker podselect
83 + src_remove_dual perl-core/Test-Harness 3.230.0 prove
84 + src_remove_dual perl-core/podlators 2.4.0 pod2man pod2text
85 + src_remove_dual_man perl-core/podlators 2.4.0 /usr/share/man/man1/perlpodstyle.1
86 +}
87 +
88 +pkg_pretend() {
89 + check_rebuild
90 +}
91 +
92 +pkg_setup() {
93 + case ${CHOST} in
94 + *-freebsd*) osname="freebsd" ;;
95 + *-dragonfly*) osname="dragonfly" ;;
96 + *-netbsd*) osname="netbsd" ;;
97 + *-openbsd*) osname="openbsd" ;;
98 + *-darwin*) osname="darwin" ;;
99 + *-interix*) osname="interix" ;;
100 + *) osname="linux" ;;
101 + esac
102 +
103 + if use ithreads ; then
104 + mythreading="-multi"
105 + myarch="${CHOST%%-*}-${osname}-thread"
106 + else
107 + myarch="${CHOST%%-*}-${osname}"
108 + fi
109 + if use debug ; then
110 + myarch="${myarch}-debug"
111 + fi
112 +
113 + LIBPERL="libperl$(get_libname ${MY_PV} )"
114 + PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
115 + ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
116 + SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
117 + SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
118 + VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
119 + VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
120 +
121 + if use ithreads ; then
122 + echo ""
123 + ewarn "THREADS WARNING:"
124 + ewarn "PLEASE NOTE: You are compiling ${MY_P} with"
125 + ewarn "interpreter-level threading enabled."
126 + ewarn "Threading is not supported by all applications "
127 + ewarn "that compile against perl. You use threading at "
128 + ewarn "your own discretion. "
129 + fi
130 + check_rebuild
131 + dual_scripts
132 +}
133 +
134 +check_rebuild() {
135 + if has_version "<dev-lang/perl-${SHORT_PV}" ; then
136 + echo ""
137 + ewarn "UPDATE THE PERL MODULES:"
138 + ewarn "After updating dev-lang/perl you must reinstall"
139 + ewarn "the installed perl modules."
140 + ewarn "Use: perl-cleaner --all"
141 + elif has_version dev-lang/perl ; then
142 + # doesnot work
143 + #if ! has_version dev-lang/perl[ithreads=,debug=] ; then
144 + #if ! has_version dev-lang/perl[ithreads=] || ! has_version dev-lang/perl[debug=] ; then
145 + if ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
146 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
147 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
148 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
149 + echo ""
150 + ewarn "TOGGLED USE-FLAGS WARNING:"
151 + ewarn "You changed one of the use-flags ithreads or debug."
152 + ewarn "You must rebuild all perl-modules installed."
153 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
154 + fi
155 + fi
156 +}
157 +
158 +src_prepare_update_patchlevel_h() {
159 + [[ -f ${WORKDIR}/perl-patch/series ]] || return 0
160 +
161 + while read patch level ; do
162 + sed -i -e "s/^\t,NULL$/ ,\"${patch//__/_}\"\n&/" "${S}"/patchlevel.h || die
163 + done < "${WORKDIR}"/perl-patch/series
164 +}
165 +
166 +src_prepare() {
167 + EPATCH_SOURCE="${WORKDIR}/perl-patch" \
168 + EPATCH_SUFFIX="diff" \
169 + EPATCH_FORCE="yes" \
170 + EPATCH_OPTS="-p1" \
171 + epatch
172 +
173 + src_prepare_update_patchlevel_h
174 +
175 + # pod/perltoc.pod fails
176 + # lib/ExtUtils/t/Embed.t fails
177 + if ! tc-is-static-only ; then
178 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
179 + ln -s ${LIBPERL} libperl$(get_libname ) || die
180 + fi
181 +
182 + epatch "${FILESDIR}"/${PN}-5.12.3-aix-soname.patch
183 + epatch "${FILESDIR}"/${PN}-5.8.8-solaris-relocation.patch
184 + epatch "${FILESDIR}"/${PN}-5.8.8-solaris11.patch
185 + epatch "${FILESDIR}"/${PN}-5.14.1-cleanup-paths.patch
186 + epatch "${FILESDIR}"/${PN}-5.8.8-usr-local.patch
187 + epatch "${FILESDIR}"/${PN}-5.10.1-hpux.patch
188 + epatch "${FILESDIR}"/${PN}-5.8.8-darwin-cc-ld.patch
189 + epatch "${FILESDIR}"/${PN}-5.12.3-mint.patch
190 + epatch "${FILESDIR}"/${PN}-5.12.3-interix.patch
191 +
192 + # rest of usr-local patch
193 + sed -i \
194 + -e '/^locincpth=/c\locincpth=""' \
195 + -e '/^loclibpth=/c\loclibpth=""' \
196 + -e '/^glibpth=.*\/local\//s: /usr/local/lib.*":":' \
197 + Configure || die
198 +}
199 +
200 +myconf() {
201 + # the myconf array is declared in src_configure
202 + myconf=( "${myconf[@]}" "$@" )
203 +}
204 +
205 +src_configure() {
206 + declare -a myconf
207 +
208 + export LC_ALL="C"
209 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
210 +
211 + # some arches and -O do not mix :)
212 + use ppc && replace-flags -O? -O1
213 + # Perl has problems compiling with -Os in your flags with glibc
214 + use elibc_uclibc || replace-flags "-Os" "-O2"
215 + # This flag makes compiling crash in interesting ways
216 + filter-flags "-malign-double"
217 + # Fixes bug #97645
218 + use ppc && filter-flags "-mpowerpc-gpopt"
219 + # Fixes bug #143895 on gcc-4.1.1
220 + filter-flags "-fsched2-use-superblocks"
221 +
222 + use sparc && myconf -Ud_longdbl
223 +
224 + # 266337
225 + export BUILD_BZIP2=0
226 + export BZIP2_INCLUDE=${EPREFIX}/usr/include
227 + export BZIP2_LIB=${EPREFIX}/usr/$(get_libdir)
228 + cat <<-EOF > "${S}/cpan/Compress-Raw-Zlib/config.in"
229 + BUILD_ZLIB = False
230 + INCLUDE = ${EPREFIX}/usr/include
231 + LIB = ${EPREFIX}/usr/$(get_libdir)
232 +
233 + OLD_ZLIB = False
234 + GZIP_OS_CODE = AUTO_DETECT
235 + EOF
236 +
237 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
238 +
239 + myndbm='U'
240 + mygdbm='U'
241 + mydb='U'
242 +
243 + if use gdbm ; then
244 + mygdbm='D'
245 + myndbm='D'
246 + fi
247 + if use berkdb ; then
248 + mydb='D'
249 + has_version '=sys-libs/db-1*' && myndbm='D'
250 + fi
251 +
252 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
253 +
254 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
255 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
256 + myconf -Ui_db -Ui_ndbm
257 + fi
258 +
259 + use ithreads && myconf -Dusethreads
260 +
261 + if use debug ; then
262 + append-cflags "-g"
263 + myconf -DDEBUGGING
264 + elif [[ ${CFLAGS} == *-g* ]] ; then
265 + myconf -DDEBUGGING=-g
266 + else
267 + myconf -DDEBUGGING=none
268 + fi
269 +
270 + if [[ -n ${PERL_OLDVERSEN} ]] ; then
271 + local inclist=$(for v in ${PERL_OLDVERSEN}; do echo -n "${v}/${myarch}${mythreading} ${v} "; done )
272 + myconf -Dinc_version_list="${inclist}"
273 + fi
274 +
275 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
276 +
277 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
278 + # Prefix itself we don't do multilib either, so make sure perl can find
279 + # something compatible.
280 + if use prefix ; then
281 + local ldir
282 + local llib
283 + local paths=""
284 + echo "int main() {}" > "${T}"/t.c
285 + # need to ensure dirs contain compatible libs, bug #358875
286 + for ldir in /lib /usr/lib /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 ; do
287 + [[ -d ${ldir} ]] || continue
288 + # find a random lib from here
289 + llib=( ${ldir}/*$(get_libname) )
290 + [[ -e ${llib[0]} ]] || continue
291 + $(tc-getCC) -o "${T}"/t "${T}"/t.c ${llib[0]} >& /dev/null \
292 + && paths="${paths} ${ldir}"
293 + done
294 + myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
295 + elif [[ $(get_libdir) != "lib" ]] ; then
296 + # We need to use " and not ', as the written config.sh use ' ...
297 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
298 + fi
299 +
300 + # don't try building ODBM, bug #354453
301 + myconf -Dnoextensions=ODBM_File
302 +
303 + sh Configure \
304 + -des \
305 + -Duseshrplib \
306 + -Darchname="${myarch}" \
307 + -Dcc="$(tc-getCC)" \
308 + -Doptimize="${CFLAGS}" \
309 + -Dldflags="${LDFLAGS}" \
310 + -Dprefix="${EPREFIX}"'/usr' \
311 + -Dinstallprefix="${EPREFIX}"'/usr' \
312 + -Dsiteprefix="${EPREFIX}"'/usr' \
313 + -Dvendorprefix="${EPREFIX}"'/usr' \
314 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
315 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
316 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
317 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
318 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
319 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
320 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
321 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
322 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
323 + -Dsiteman1dir="${EPREFIX}"/usr/share/man/man1 \
324 + -Dsiteman3dir="${EPREFIX}"/usr/share/man/man3 \
325 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
326 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
327 + -Dman1ext='1' \
328 + -Dman3ext='3pm' \
329 + -Dlibperl="${LIBPERL}" \
330 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
331 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
332 + -Duselargefiles \
333 + -Dd_semctl_semun \
334 + -Dcf_by='Gentoo' \
335 + -Dmyhostname='localhost' \
336 + -Dperladmin='root@localhost' \
337 + -Dinstallusrbinperl='n' \
338 + -Ud_csh \
339 + -Uusenm \
340 + "${myconf[@]}" || die "Unable to configure"
341 +}
342 +
343 +src_test() {
344 + if [[ ${EUID} == 0 ]] ; then
345 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
346 + return 0
347 + fi
348 + use elibc_uclibc && export MAKEOPTS+=" -j1"
349 + TEST_JOBS=$(echo -j1 ${MAKEOPTS} | sed -r 's/.*(-j[[:space:]]*|--jobs=)([[:digit:]]+).*/\2/' ) \
350 + make test_harness || die "test failed"
351 +}
352 +
353 +src_install() {
354 + local i
355 + local coredir="${ARCH_LIB}/CORE"
356 +
357 + emake DESTDIR="${D}" install
358 +
359 + rm -f "${ED}"/usr/bin/perl
360 + ln -s perl${MY_PV} "${ED}"/usr/bin/perl || die
361 +
362 + if ! tc-is-static-only ; then
363 + dolib.so "${ED}"${coredir}/${LIBPERL}
364 + rm -f "${ED}"${coredir}/${LIBPERL}
365 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
366 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
367 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
368 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
369 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
370 + fi
371 +
372 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
373 +
374 +# # A poor fix for the miniperl issues
375 +# dosed 's:./miniperl:/usr/bin/perl:' /usr/$(get_libdir)/perl5/${MY_PV}/ExtUtils/xsubpp
376 +# fperms 0444 /usr/$(get_libdir)/perl5/${MY_PV}/ExtUtils/xsubpp
377 +# dosed 's:./miniperl:/usr/bin/perl:' /usr/bin/xsubpp
378 +# fperms 0755 /usr/bin/xsubpp
379 +
380 + # This removes ${D} from Config.pm
381 + for i in $(find "${D}" -iname "Config.pm" ) ; do
382 + einfo "Removing ${D} from ${i}..."
383 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
384 + done
385 +
386 + find "${ED}" -type f -name .packlist -delete || die
387 +
388 + # Note: find out from psm why we would need/want this.
389 + # ( use berkdb && has_version '=sys-libs/db-1*' ) ||
390 + # find "${ED}" -name "*NDBM*" | xargs rm -f
391 +
392 + dodoc Changes* README AUTHORS
393 +
394 + if use doc ; then
395 + # HTML Documentation
396 + # We expect errors, warnings, and such with the following.
397 +
398 + dodir /usr/share/doc/${PF}/html
399 + LD_LIBRARY_PATH=. ./perl installhtml \
400 + --podroot='.' \
401 + --podpath='lib:ext:pod:vms' \
402 + --recurse \
403 + --htmldir="${ED}/usr/share/doc/${PF}/html" \
404 + --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
405 + fi
406 +
407 + dual_scripts
408 +}
409 +
410 +pkg_postinst() {
411 + dual_scripts
412 +
413 + if [[ "${ROOT}" = "/" ]] ; then
414 + local INC DIR file
415 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
416 + einfo "Removing old .ph files"
417 + for DIR in ${INC} ; do
418 + if [[ -d "${DIR}" ]] ; then
419 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
420 + rm -f "${file}"
421 + einfo "<< ${file}"
422 + done
423 + fi
424 + done
425 + # Silently remove the now empty dirs
426 + for DIR in ${INC} ; do
427 + if [[ -d "${DIR}" ]] ; then
428 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
429 + fi
430 + done
431 +
432 +# ebegin "Generating ConfigLocal.pm (ignore any error)"
433 +# enc2xs -C
434 +
435 + einfo "Converting C header files to the corresponding Perl format (ignore any error)"
436 + # Prefix note: unprefixed as this is all kernel/libc stuff that we never provide
437 + pushd /usr/include >/dev/null
438 + h2ph -Q -a -d "${EPREFIX}"${ARCH_LIB} \
439 + asm/termios.h syscall.h syslimits.h syslog.h sys/ioctl.h \
440 + sys/socket.h sys/time.h wait.h sysexits.h
441 + popd >/dev/null
442 +
443 +# This has been moved into a function because rumor has it that a future release
444 +# of portage will allow us to check what version was just removed - which means
445 +# we will be able to invoke this only as needed :)
446 + # Tried doing this via -z, but $INC is too big...
447 + #if [[ "${INC}x" != "x" ]]; then
448 + # cleaner_msg
449 + #fi
450 + fi
451 +}
452 +
453 +pkg_postrm(){
454 + dual_scripts
455 +
456 +# if [[ -e ${ARCH_LIB}/Encode/ConfigLocal.pm ]] ; then
457 +# ebegin "Removing ConfigLocal.pm"
458 +# rm "${ARCH_LIB}/Encode/ConfigLocal.pm"
459 +# fi
460 +}
461 +
462 +cleaner_msg() {
463 + eerror "You have had multiple versions of perl. It is recommended"
464 + eerror "that you run perl-cleaner now. perl-cleaner will"
465 + eerror "assist with this transition. This script is capable"
466 + eerror "of cleaning out old .ph files, rebuilding modules for "
467 + eerror "your new version of perl, as well as re-emerging"
468 + eerror "applications that compiled against your old libperl$(get_libname)"
469 + eerror
470 + eerror "PLEASE DO NOT INTERRUPT THE RUNNING OF THIS SCRIPT."
471 + eerror "Part of the rebuilding of applications compiled against "
472 + eerror "your old libperl involves temporarily unmerging"
473 + eerror "them - interruptions could leave you with unmerged"
474 + eerror "packages before they can be remerged."
475 + eerror ""
476 + eerror "If you have run perl-cleaner and a package still gives"
477 + eerror "you trouble, and re-emerging it fails to correct"
478 + eerror "the problem, please check http://bugs.gentoo.org/"
479 + eerror "for more information or to report a bug."
480 + eerror ""
481 +}
482 +
483 +src_remove_dual_file() {
484 + local i pkg ver
485 + pkg="$1"
486 + ver="$2"
487 + shift 2
488 + case "${EBUILD_PHASE:-none}" in
489 + postinst|postrm)
490 + for i in "$@" ; do
491 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
492 + done
493 + ;;
494 + setup)
495 + for i in "$@" ; do
496 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
497 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
498 + break
499 + fi
500 + done
501 + ;;
502 + install)
503 + for i in "$@" ; do
504 + if ! [[ -f "${ED}"${i} ]] ; then
505 + ewarn "${i} does not exist!"
506 + continue
507 + fi
508 + mv "${ED}"${i}{,-${ver}-${P}} || die
509 + done
510 + ;;
511 + esac
512 +}
513 +
514 +src_remove_dual_man() {
515 + local i pkg ver ff
516 + pkg="$1"
517 + ver="$2"
518 + shift 2
519 + case "${EBUILD_PHASE:-none}" in
520 + postinst|postrm)
521 + for i in "$@" ; do
522 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
523 + ff=${ff##*${i#${i%.[0-9]}}}
524 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
525 + done
526 + ;;
527 + install)
528 + for i in "$@" ; do
529 + if ! [[ -f "${ED}"${i} ]] ; then
530 + ewarn "${i} does not exist!"
531 + continue
532 + fi
533 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
534 + done
535 + ;;
536 + esac
537 +}
538 +
539 +src_remove_dual() {
540 + local i pkg ver
541 + pkg="$1"
542 + ver="$2"
543 + shift 2
544 + for i in "$@" ; do
545 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
546 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
547 + done
548 +}