/[gentoo-alt]/trunk/prefix/dev-lang/perl/perl-5.8.7-r1.ebuild
Gentoo

Contents of /trunk/prefix/dev-lang/perl/perl-5.8.7-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1166 - (show annotations) (download)
Sat Mar 25 22:08:50 2006 UTC (13 years, 2 months ago) by kito
File size: 19625 byte(s)
PREFIX->EPREFIX DEST->EDEST
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/perl/perl-5.8.7-r1.ebuild,v 1.5 2005/10/02 00:54:19 kloeri Exp $
4
5 EAPI="prefix"
6
7 inherit eutils flag-o-matic toolchain-funcs multilib
8
9 # The slot of this binary compat version of libperl.so
10 PERLSLOT="1"
11
12 SHORT_PV="${PV%.*}"
13 MY_P="perl-${PV/_rc/-RC}"
14 DESCRIPTION="Larry Wall's Practical Extraction and Reporting Language"
15 S="${WORKDIR}/${MY_P}"
16 SRC_URI="ftp://ftp.perl.org/pub/CPAN/src/${MY_P}.tar.bz2"
17 HOMEPAGE="http://www.perl.org/"
18 LIBPERL="libperl$(get_libname ${PERLSLOT}.${SHORT_PV})"
19
20 LICENSE="Artistic GPL-2"
21 SLOT="0"
22 KEYWORDS="alpha ~amd64 ~arm ~hppa ia64 ~mips ~ppc ~ppc-macos ppc64 ~s390 ~sh sparc ~x86"
23 IUSE="berkdb debug doc gdbm ithreads perlsuid build minimal"
24 PERL_OLDVERSEN="5.8.0 5.8.2 5.8.4 5.8.5 5.8.6"
25
26 DEPEND="berkdb? ( sys-libs/db )
27 gdbm? ( >=sys-libs/gdbm-1.8.3 )
28 >=sys-devel/libperl-${PV}
29 !<perl-core/ExtUtils-MakeMaker-6.17
30 !<perl-core/File-Spec-0.87
31 !<perl-core/Test-Simple-0.47-r1"
32
33 RDEPEND=">=sys-devel/libperl-${PV}
34 berkdb? ( sys-libs/db )
35 gdbm? ( >=sys-libs/gdbm-1.8.3 )"
36
37 PDEPEND="app-admin/perl-cleaner"
38
39 pkg_setup() {
40 # I think this should rather be displayed if you *have* 'ithreads'
41 # in USE if it could break things ...
42 if use ithreads
43 then
44 ewarn "PLEASE NOTE: You are compiling ${MY_P} with"
45 ewarn "interpreter-level threading enabled."
46 ewarn "Threading is not supported by all applications "
47 ewarn "that compile against perl. You use threading at "
48 ewarn "your own discretion. "
49 epause 5
50 fi
51
52 if use minimal
53 then
54 ewarn "You have the minimal USE flag set. The resulting"
55 ewarn "perl is stripped of most of its module functionality"
56 ewarn "and is intended for minmal use case where you need"
57 ewarn "just the perl interpreter, no extras."
58 fi
59
60 if [ ! -f "${ROOT}/usr/$(get_libdir)/${LIBPERL}" ]
61 then
62 # Make sure we have libperl installed ...
63 eerror "Cannot find ${ROOT}/usr/$(get_libdir)/${LIBPERL}! Make sure that you"
64 eerror "have sys-libs/libperl installed properly ..."
65 die "Cannot find ${ROOT}/usr/$(get_libdir)/${LIBPERL}!"
66 fi
67 }
68
69 src_unpack() {
70 unpack ${A}
71
72 # Get -lpthread linked before -lc. This is needed
73 # when using glibc >= 2.3, or else runtime signal
74 # handling breaks. Fixes bug #14380.
75 # <rac@gentoo.org> (14 Feb 2003)
76 # reinstated to try to avoid sdl segfaults 03.10.02
77 cd ${S}; epatch ${FILESDIR}/${PN}-prelink-lpthread.patch
78
79 # Patch perldoc to not abort when it attempts to search
80 # nonexistent directories; fixes bug #16589.
81 # <rac@gentoo.org> (28 Feb 2003)
82
83 cd ${S}; epatch ${FILESDIR}/${PN}-perldoc-emptydirs.patch
84
85 # this lays the groundwork for solving the issue of what happens
86 # when people (or ebuilds) install different versiosn of modules
87 # that are in the core, by rearranging the @INC directory to look
88 # site -> vendor -> core.
89 cd ${S}; epatch ${FILESDIR}/${PN}-reorder-INC.patch
90
91 # some well-intentioned stuff in http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=Pine.SOL.4.10.10205231231200.5399-100000%40maxwell.phys.lafayette.edu
92 # attempts to avoid bringing cccdlflags to bear on static
93 # extensions (like DynaLoader). i believe this is
94 # counterproductive on a Gentoo system which has both a shared
95 # and static libperl, so effectively revert this here.
96 cd ${S}; epatch ${FILESDIR}/${PN}-picdl.patch
97
98 # Configure makes an unwarranted assumption that /bin/ksh is a
99 # good shell. This patch makes it revert to using /bin/sh unless
100 # /bin/ksh really is executable. Should fix bug 42665.
101 # rac 2004.06.09
102 cd ${S}; epatch ${FILESDIR}/${PN}-noksh.patch
103
104 # this one only affects sparc64, as best weeve and rac can tell,
105 # but seems sane for all linux. we don't have to worry about
106 # drifting into obscure SysV non-posix semantics, and the current
107 # code in IO.xs that checks for this sort of thing dies in LDAP on
108 # sparc64.
109
110 #epatch ${FILESDIR}/${PN}-nonblock.patch
111
112 # since we build in non-world-writeable portage directories, none
113 # of the .t sections of the original version of this patch matter
114 # much. the PPPort section is apparently obsolete, because i see
115 # no /tmp in there now. ditto on perlbug.SH, which has secure
116 # tempfile handling if resources are present. originally from bug
117 # 66360.
118
119 epatch ${FILESDIR}/${P}-tempfiles.patch
120
121 # We do not want the build root in the linked perl module's RUNPATH, so
122 # strip paths containing PORTAGE_TMPDIR if its set. This is for the
123 # MakeMaker module, bug #105054.
124 epatch ${FILESDIR}/${PN}-5.8.7-MakeMaker-RUNPATH.patch
125
126 # Starting and hopefully ending with 5.8.7 we observe stack
127 # corruption with the regexp handling in perls DynaLoader code
128 # with ssp enabled. This become fatal during compile time so we
129 # temporally disable ssp on two regexp files till upstream has a
130 # chance to work it out. Bug #97452
131 use userland_Darwin || epatch "${FILESDIR}"/${P}-regexp-nossp.patch
132 }
133
134 src_configure() {
135
136 # some arches and -O do not mix :)
137 use arm && replace-flags -O? -O1
138 use ppc && replace-flags -O? -O1
139 use ia64 && replace-flags -O? -O1
140 # Perl has problems compiling with -Os in your flags with glibc
141 use elibc_uclibc || replace-flags "-Os" "-O2"
142 # This flag makes compiling crash in interesting ways
143 filter-flags -malign-double
144 # Fixes bug #97645
145 use ppc && filter-flags -mpowerpc-gpopt
146
147 export LC_ALL="C"
148 local myconf=""
149
150 if [[ ${KERNEL} == "FreeBSD" && "${ELIBC}" = "FreeBSD" ]]; then
151 osname="freebsd"
152 elif [[ ${USERLAND} == "Darwin" ]]; then
153 osname="darwin"
154 else
155 # Default setting
156 osname="linux"
157 fi
158
159 if use ithreads
160 then
161 einfo "using ithreads"
162 mythreading="-multi"
163 myconf="-Dusethreads ${myconf}"
164 myarch=$(get_abi_CHOST)
165 myarch="${myarch%%-*}-${osname}-thread"
166 else
167 myarch=$(get_abi_CHOST)
168 myarch="${myarch%%-*}-${osname}"
169 fi
170
171 local inclist=$(for v in $PERL_OLDVERSEN; do echo -n "$v $v/$myarch$mythreading "; done)
172
173 # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
174
175 myndbm='U'
176 mygdbm='U'
177 mydb='U'
178
179 if use gdbm
180 then
181 mygdbm='D'
182 myndbm='D'
183 fi
184 if use berkdb
185 then
186 mydb='D'
187 has_version '=sys-libs/db-1*' && myndbm='D'
188 fi
189
190 myconf="${myconf} -${myndbm}i_ndbm -${mygdbm}i_gdbm -${mydb}i_db"
191
192 if use mips
193 then
194 # this is needed because gcc 3.3-compiled kernels will hang
195 # the machine trying to run this test - check with `Kumba
196 # <rac@gentoo.org> 2003.06.26
197 myconf="${myconf} -Dd_u32align"
198 fi
199
200 if use perlsuid
201 then
202 myconf="${myconf} -Dd_dosuid"
203 ewarn "You have enabled Perl's suid compile. Please"
204 ewarn "read http://perldoc.com/perl5.8.2/INSTALL.html#suidperl"
205 epause 3
206 fi
207
208 if use debug
209 then
210 CFLAGS="${CFLAGS} -g"
211 fi
212
213 if use sparc
214 then
215 myconf="${myconf} -Ud_longdbl"
216 fi
217
218 if use alpha && "$(tc-getCC)" == "ccc"
219 then
220 ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
221 myconf="${myconf} -Ui_db -Ui_ndbm"
222 fi
223
224 [ -n "${ABI}" ] && myconf="${myconf} -Dusrinc=$(get_ml_incdir)"
225
226 [[ ${ELIBC} == "FreeBSD" ]] && myconf="${myconf} -Dlibc=/usr/lib/libc.a"
227
228 if [[ $(get_libdir) != "lib" ]] ; then
229 myconf="${myconf} -Dlibpth='/usr/local/$(get_libdir) /$(get_libdir) \
230 /usr/$(get_libdir)'"
231 fi
232
233 sh Configure -des \
234 -Darchname="${myarch}" \
235 -Dcccdlflags='-fPIC' \
236 -Dccdlflags='-rdynamic' \
237 -Dcc="$(tc-getCC)" \
238 -Dprefix="${EPREFIX}/usr" \
239 -Dvendorprefix="${EPREFIX}/usr" \
240 -Dsiteprefix="${EPREFIX}/usr" \
241 -Dlocincpth=' ' \
242 -Doptimize="${CFLAGS}" \
243 -Duselargefiles \
244 -Dd_semctl_semun \
245 -Dscriptdir="${EPREFIX}/usr/bin" \
246 -Dman1dir="${EPREFIX}/usr/share/man/man1" \
247 -Dman3dir="${EPREFIX}/usr/share/man/man3" \
248 -Dinstallman1dir=${D}/usr/share/man/man1 \
249 -Dinstallman3dir=${D}/usr/share/man/man3 \
250 -Dman1ext='1' \
251 -Dman3ext='3pm' \
252 -Dinc_version_list="$inclist" \
253 -Dcf_by='Gentoo' \
254 -Ud_csh \
255 ${myconf} || die "Unable to configure"
256 }
257
258 src_compile() {
259
260 # would like to bracket this with a test for the existence of a
261 # dotfile, but can't clean it automatically now.
262
263 src_configure
264
265 emake -j1 || die "Unable to make"
266 }
267
268 src_test() {
269 use elibc_uclibc && export MAKEOPTS="${MAKEOPTS} -j1"
270 emake -i test CCDLFLAGS= || die "test failed"
271 }
272
273 src_install() {
274
275 export LC_ALL="C"
276
277 # Need to do this, else apps do not link to dynamic version of
278 # the library ...
279 local coredir="/usr/lib/perl5/${PV}/${myarch}${mythreading}/CORE"
280 dodir ${coredir}
281 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/${LIBPERL}
282 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname ${PERLSLOT})
283 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname)
284
285 # Fix for "stupid" modules and programs
286 dodir /usr/lib/perl5/site_perl/${PV}/${myarch}${mythreading}
287
288 local installtarget=install
289 if use minimal || use build ; then
290 installtarget=install.perl
291 fi
292 make DESTDIR="${EDEST}" ${installtarget} || die "Unable to make ${installtarget}"
293
294 # 2004.07.28 rac
295
296 # suidperl has had a history of security trouble, and the
297 # perldelta has recommended against using it for a while. genone
298 # alerted me to the fact that the hardlinks aren't carrying
299 # through the staging directory, and we end up with four copies of
300 # perl, basically. two normal, two suid. fix this up here, and
301 # delete suidperl entirely. if this causes outrage, here's where
302 # to fix.
303
304 # Moved to a use flag enablement - bug 64823 - mcummings
305 #rm ${D}/usr/bin/sperl${PV}
306 #rm ${D}/usr/bin/suidperl
307 rm ${D}/usr/bin/perl
308 ln -s perl${PV} ${D}/usr/bin/perl
309
310 cp -f utils/h2ph utils/h2ph_patched
311 epatch ${FILESDIR}/${PN}-h2ph-ansi-header.patch
312
313 LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. ./perl -Ilib utils/h2ph_patched \
314 -a -d ${D}/usr/lib/perl5/${PV}/${myarch}${mythreading} <<EOF
315 asm/termios.h
316 syscall.h
317 syslimits.h
318 syslog.h
319 sys/ioctl.h
320 sys/socket.h
321 sys/time.h
322 wait.h
323 EOF
324
325 # This is to fix a missing c flag for backwards compat
326 for i in `find ${D}/usr/lib/perl5 -iname "Config.pm"`;do
327 sed -e "s:ccflags=':ccflags='-DPERL5 :" \
328 -e "s:cppflags=':cppflags='-DPERL5 :" \
329 ${i} > ${i}.new &&\
330 mv ${i}.new ${i} || die "Sed failed"
331 done
332
333 # A poor fix for the miniperl issues
334 dosed "s:./miniperl:${EPREFIX}/usr/bin/perl:" ${EPREFIX}/usr/lib/perl5/${PV}/ExtUtils/xsubpp
335 fperms 0444 /usr/lib/perl5/${PV}/ExtUtils/xsubpp
336 dosed "s:./miniperl:${EPREFIX}/usr/bin/perl:" ${EPREFIX}/usr/bin/xsubpp
337 fperms 0755 /usr/bin/xsubpp
338
339 # This removes ${D} from Config.pm and .packlist
340 for i in `find ${D} -iname "Config.pm"` `find ${D} -iname ".packlist"`;do
341 einfo "Removing ${D} from ${i}..."
342 sed -e "s:${D}::" ${i} > ${i}.new &&\
343 mv ${i}.new ${i} || die "Sed failed"
344 done
345
346 # Note: find out from psm why we would need/want this.
347 # ( use berkdb && has_version '=sys-libs/db-1*' ) ||
348 # find ${D} -name "*NDBM*" | xargs rm -f
349
350 dodoc Changes* Artistic Copying README Todo* AUTHORS
351
352 if use doc
353 then
354 # HTML Documentation
355 # We expect errors, warnings, and such with the following.
356
357 dodir /usr/share/doc/${PF}/html
358 ./perl installhtml \
359 --podroot='.' \
360 --podpath='lib:ext:pod:vms' \
361 --recurse \
362 --htmldir="${D}/usr/share/doc/${PF}/html" \
363 --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
364 fi
365 cd `find ${D} -name Path.pm|sed -e 's/Path.pm//'`
366 # CAN patch in bug 79685
367 epatch ${FILESDIR}/${P}-CAN-2005-0448-rmtree.patch
368
369 if use minimal || use build ; then
370 src_remove_extra_files
371 fi
372
373 }
374
375 src_remove_extra_files()
376 {
377 local prefix="./usr" # ./ is important
378 local bindir="${prefix}/bin"
379 local perlroot="${prefix}/lib/perl5" # perl installs per-arch dirs
380 local prV="${perlroot}/${PV}"
381 # myarch and mythreading are defined inside src_configure()
382 local prVA="${prV}/${myarch}${mythreading}"
383
384 # I made this list from the Mandr*, Debian and ex-Connectiva perl-base list
385 # Then, I added several files to get GNU autotools running
386 # FIXME: should this be in a separated file to be sourced?
387 local MINIMAL_PERL_INSTALL="
388 ${bindir}/h2ph
389 ${bindir}/perl
390 ${bindir}/perl${PV}
391 ${bindir}/pod2man
392 ${prV}/attributes.pm
393 ${prV}/AutoLoader.pm
394 ${prV}/autouse.pm
395 ${prV}/base.pm
396 ${prV}/bigint.pm
397 ${prV}/bignum.pm
398 ${prV}/bigrat.pm
399 ${prV}/blib.pm
400 ${prV}/bytes_heavy.pl
401 ${prV}/bytes.pm
402 ${prV}/Carp/Heavy.pm
403 ${prV}/Carp.pm
404 ${prV}/charnames.pm
405 ${prV}/Class/Struct.pm
406 ${prV}/constant.pm
407 ${prV}/diagnostics.pm
408 ${prV}/DirHandle.pm
409 ${prV}/Exporter/Heavy.pm
410 ${prV}/Exporter.pm
411 ${prV}/ExtUtils/Command.pm
412 ${prV}/ExtUtils/Constant.pm
413 ${prV}/ExtUtils/Embed.pm
414 ${prV}/ExtUtils/Installed.pm
415 ${prV}/ExtUtils/Install.pm
416 ${prV}/ExtUtils/Liblist.pm
417 ${prV}/ExtUtils/MakeMaker.pm
418 ${prV}/ExtUtils/Manifest.pm
419 ${prV}/ExtUtils/Mkbootstrap.pm
420 ${prV}/ExtUtils/Mksymlists.pm
421 ${prV}/ExtUtils/MM_Any.pm
422 ${prV}/ExtUtils/MM_MacOS.pm
423 ${prV}/ExtUtils/MM.pm
424 ${prV}/ExtUtils/MM_Unix.pm
425 ${prV}/ExtUtils/MY.pm
426 ${prV}/ExtUtils/Packlist.pm
427 ${prV}/ExtUtils/testlib.pm
428 ${prV}/ExtUtils/Miniperl.pm
429 ${prV}/ExtUtils/Command/MM.pm
430 ${prV}/ExtUtils/Constant/Base.pm
431 ${prV}/ExtUtils/Constant/Utils.pm
432 ${prV}/ExtUtils/Constant/XS.pm
433 ${prV}/ExtUtils/Liblist/Kid.pm
434 ${prV}/ExtUtils/MakeMaker/bytes.pm
435 ${prV}/ExtUtils/MakeMaker/vmsish.pm
436 ${prV}/fields.pm
437 ${prV}/File/Basename.pm
438 ${prV}/File/Compare.pm
439 ${prV}/File/Copy.pm
440 ${prV}/File/Find.pm
441 ${prV}/FileHandle.pm
442 ${prV}/File/Path.pm
443 ${prV}/File/Spec.pm
444 ${prV}/File/Spec/Unix.pm
445 ${prV}/File/stat.pm
446 ${prV}/filetest.pm
447 ${prVA}/attrs.pm
448 ${prVA}/auto/attrs
449 ${prVA}/auto/Cwd/Cwd.$(get_libname)
450 ${prVA}/auto/Data/Dumper/Dumper.$(get_libname)
451 ${prVA}/auto/DynaLoader/dl_findfile.al
452 ${prVA}/auto/Fcntl/Fcntl.$(get_libname)
453 ${prVA}/auto/File/Glob/Glob.$(get_libname)
454 ${prVA}/auto/IO/IO.$(get_libname)
455 ${prVA}/auto/POSIX/autosplit.ix
456 ${prVA}/auto/POSIX/fstat.al
457 ${prVA}/auto/POSIX/load_imports.al
458 ${prVA}/auto/POSIX/POSIX.bs
459 ${prVA}/auto/POSIX/POSIX.$(get_libname)
460 ${prVA}/auto/POSIX/stat.al
461 ${prVA}/auto/POSIX/tmpfile.al
462 ${prVA}/auto/re/re.$(get_libname)
463 ${prVA}/auto/Socket/Socket.$(get_libname)
464 ${prVA}/auto/Storable/autosplit.ix
465 ${prVA}/auto/Storable/_retrieve.al
466 ${prVA}/auto/Storable/retrieve.al
467 ${prVA}/auto/Storable/Storable.$(get_libname)
468 ${prVA}/auto/Storable/_store.al
469 ${prVA}/auto/Storable/store.al
470 ${prVA}/B/Deparse.pm
471 ${prVA}/B.pm
472 ${prVA}/Config.pm
473 ${prVA}/Config_heavy.pl
474 ${prVA}/CORE/libperl$(get_libname)
475 ${prVA}/Cwd.pm
476 ${prVA}/Data/Dumper.pm
477 ${prVA}/DynaLoader.pm
478 ${prVA}/encoding.pm
479 ${prVA}/Errno.pm
480 ${prVA}/Fcntl.pm
481 ${prVA}/File/Glob.pm
482 ${prVA}/_h2ph_pre.ph
483 ${prVA}/IO/File.pm
484 ${prVA}/IO/Handle.pm
485 ${prVA}/IO/Pipe.pm
486 ${prVA}/IO.pm
487 ${prVA}/IO/Seekable.pm
488 ${prVA}/IO/Select.pm
489 ${prVA}/IO/Socket.pm
490 ${prVA}/lib.pm
491 ${prVA}/NDBM_File.pm
492 ${prVA}/ops.pm
493 ${prVA}/POSIX.pm
494 ${prVA}/re.pm
495 ${prVA}/Socket.pm
496 ${prVA}/Storable.pm
497 ${prVA}/threads
498 ${prVA}/threads.pm
499 ${prVA}/XSLoader.pm
500 ${prV}/Getopt/Long.pm
501 ${prV}/Getopt/Std.pm
502 ${prV}/if.pm
503 ${prV}/integer.pm
504 ${prV}/IO/Socket/INET.pm
505 ${prV}/IO/Socket/UNIX.pm
506 ${prV}/IPC/Open2.pm
507 ${prV}/IPC/Open3.pm
508 ${prV}/less.pm
509 ${prV}/List/Util.pm
510 ${prV}/locale.pm
511 ${prV}/open.pm
512 ${prV}/overload.pm
513 ${prV}/Pod/InputObjects.pm
514 ${prV}/Pod/Man.pm
515 ${prV}/Pod/ParseLink.pm
516 ${prV}/Pod/Parser.pm
517 ${prV}/Pod/Select.pm
518 ${prV}/Pod/Text.pm
519 ${prV}/Pod/Usage.pm
520 ${prV}/PerlIO.pm
521 ${prV}/Scalar/Util.pm
522 ${prV}/SelectSaver.pm
523 ${prV}/sigtrap.pm
524 ${prV}/sort.pm
525 ${prV}/stat.pl
526 ${prV}/strict.pm
527 ${prV}/subs.pm
528 ${prV}/Symbol.pm
529 ${prV}/Text/ParseWords.pm
530 ${prV}/Text/Tabs.pm
531 ${prV}/Text/Wrap.pm
532 ${prV}/Time/Local.pm
533 ${prV}/unicore/Canonical.pl
534 ${prV}/unicore/Exact.pl
535 ${prV}/unicore/lib/gc_sc/Digit.pl
536 ${prV}/unicore/lib/gc_sc/Word.pl
537 ${prV}/unicore/PVA.pl
538 ${prV}/unicore/To/Fold.pl
539 ${prV}/unicore/To/Lower.pl
540 ${prV}/unicore/To/Upper.pl
541 ${prV}/utf8_heavy.pl
542 ${prV}/utf8.pm
543 ${prV}/vars.pm
544 ${prV}/vmsish.pm
545 ${prV}/warnings
546 ${prV}/warnings.pm
547 ${prV}/warnings/register.pm"
548
549 # Catch the headers in CORE
550 if use minimal ; then
551 for header in `find ${D}${prVA} -name "*.h"|sed -e "s:${D}::g"`; do
552 #header=`echo $head|sed -e "s:${D}::g"`
553 MINIMAL_PERL_INSTALL="${MINIMAL_PERL_INSTALL}
554 $header"
555 done
556 fi
557
558 if use perlsuid ; then
559 MINIMAL_PERL_INSTALL="${MINIMAL_PERL_INSTALL}
560 ${bindir}/suidperl
561 ${bindir}/sperl${PV}"
562 fi
563
564 pushd ${D} > /dev/null
565 # Remove cruft
566 einfo "Removing files that are not in the minimal install"
567 echo "${MINIMAL_PERL_INSTALL}"
568 sleep 120
569 for f in $(find . -type f); do
570 has ${f} ${MINIMAL_PERL_INSTALL} || rm -f ${f}
571 done
572 # Remove empty directories
573 find . -depth -type d | xargs -r rmdir &> /dev/null
574 popd > /dev/null
575 }
576
577 pkg_postinst() {
578 # Make sure we do not have stale/invalid libperl.so 's ...
579 if [ -f "${ROOT}/usr/$(get_libdir)/libperl$(get_libname)" -a ! -L "${ROOT}/usr/$(get_libdir)/libperl$(get_libname)" ]
580 then
581 mv -f ${ROOT}/usr/$(get_libdir)/libperl$(get_libname) ${ROOT}/usr/$(get_libdir)/libperl$(get_libname).old
582 fi
583
584 local perllib="`readlink -f ${ROOT}/usr/$(get_libdir)/libperl$(get_libname) | sed -e 's:^.*/::'`"
585
586 # If we are installing perl, we need the /usr/lib/libperl.so symlink to
587 # point to the version of perl we are running, else builing something
588 # against libperl.so will break ...
589 if [ "${perllib}" != "${LIBPERL}" ]
590 then
591 # Delete stale symlinks
592 rm -f ${ROOT}/usr/$(get_libdir)/libperl$(get_libname)
593 rm -f ${ROOT}/usr/$(get_libdir)/libperl$(get_libname ${PERLSLOT})
594 # Regenerate libperl.so.${PERLSLOT}
595 ln -snf ${LIBPERL} ${ROOT}/usr/$(get_libdir)/libperl$(get_libname ${PERLSLOT})
596 # Create libperl.so (we use the *soname* versioned lib here ..)
597 ln -snf libperl$(get_libname ${PERLSLOT}) ${ROOT}usr/$(get_libdir)/libperl$(get_libname)
598 fi
599
600 INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${PV}'|etc|local|perl$/; print "$line\n" }')
601 if [ "${ROOT}" = "/" ]
602 then
603 ebegin "Removing old .ph files"
604 for DIR in $INC; do
605 if [ -d ${ROOT}/$DIR ]; then
606 for file in $(find ${ROOT}/$DIR -name "*.ph" -type f); do
607 rm ${ROOT}/$file
608 einfo "<< $file"
609 done
610 fi
611 done
612 # Silently remove the now empty dirs
613 for DIR in $INC; do
614 if [ -d ${ROOT}/$DIR ]; then
615 find ${ROOT}/$DIR -depth -type d | xargs -r rmdir &> /dev/null
616 fi
617 done
618 ebegin "Converting C header files to the corresponding Perl format"
619 cd /usr/include;
620 h2ph * sys/* arpa/* netinet/* bits/* security/* asm/* gnu/* linux/*
621 cd /usr/include/linux;
622 h2ph *
623 fi
624
625 # This has been moved into a function because rumor has it that a future release
626 # of portage will allow us to check what version was just removed - which means
627 # we will be able to invoke this only as needed :)
628 # Tried doing this via -z, but $INC is too big...
629 if [ "${INC}x" != "x" ]; then
630 cleaner_msg
631 epause 5
632 fi
633 }
634
635 cleaner_msg() {
636 eerror "You have had multiple versions of perl. It is recommended"
637 eerror "that you run perl-cleaner now. perl-cleaner will"
638 eerror "assist with this transition. This script is capable"
639 eerror "of cleaning out old .ph files, rebuilding modules for "
640 eerror "your new version of perl, as well as re-emerging"
641 eerror "applications that compiled against your old libperl$(get_libname)"
642 eerror
643 eerror "PLEASE DO NOT INTERRUPT THE RUNNING OF THIS SCRIPT."
644 eerror "Part of the rebuilding of applications compiled against "
645 eerror "your old libperl involves temporarily unmerging"
646 eerror "them - interruptions could leave you with unmerged"
647 eerror "packages before they can be remerged."
648 eerror ""
649 eerror "If you have run perl-cleaner and a package still gives"
650 eerror "you trouble, and re-emerging it fails to correct"
651 eerror "the problem, please check http://bugs.gentoo.org/"
652 eerror "for more information or to report a bug."
653 eerror ""
654 eerror ""
655
656 }

  ViewVC Help
Powered by ViewVC 1.1.20