Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/
Date: Tue, 30 May 2017 21:12:38
Message-Id: 1496178736.8269609a0ae39382be5d7e0f666951e02e5a9d29.dilfridge@gentoo
1 commit: 8269609a0ae39382be5d7e0f666951e02e5a9d29
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 30 21:11:52 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Tue May 30 21:12:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8269609a
7
8 dev-lang/perl: Version bump, masked for testing
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 dev-lang/perl/perl-5.26.0.ebuild | 595 +++++++++++++++++++++++++++++++++++++++
13 1 file changed, 595 insertions(+)
14
15 diff --git a/dev-lang/perl/perl-5.26.0.ebuild b/dev-lang/perl/perl-5.26.0.ebuild
16 new file mode 100644
17 index 00000000000..a029104e4dc
18 --- /dev/null
19 +++ b/dev-lang/perl/perl-5.26.0.ebuild
20 @@ -0,0 +1,595 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
25 +
26 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
27 +
28 +PATCH_VER=1
29 +CROSS_VER=1.1.4
30 +PATCH_BASE="perl-5.25.11-patches-${PATCH_VER}"
31 +
32 +DIST_AUTHOR=XSAWYERX
33 +
34 +# Greatest first, don't include yourself
35 +# Devel point-releases are not ABI-intercompatible, but stable point releases are
36 +# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
37 +PERL_BIN_OLDVERSEN=""
38 +# Don't add more -RC values, its historical bungling
39 +PERL_OLDVERSEN="5.26.0-RC1 5.25.12 5.25.11 5.24.2 5.24.1 5.24.0 5.22.3 5.22.2 5.22.1 5.22.0"
40 +if [[ "${PV##*.}" == "9999" ]]; then
41 + DIST_VERSION=5.26.0
42 +else
43 + DIST_VERSION="${PV/_rc/-RC}"
44 +fi
45 +SHORT_PV="${DIST_VERSION%.*}"
46 +# Even numbered major versions are ABI intercompatible
47 +# Odd numbered major versions are not
48 +if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
49 + SUBSLOT="${DIST_VERSION%-RC*}"
50 +else
51 + SUBSLOT="${DIST_VERSION%.*}"
52 +fi
53 +# Used only in tar paths
54 +MY_P="perl-${DIST_VERSION}"
55 +# Used in library paths
56 +MY_PV="${DIST_VERSION%-RC*}"
57 +
58 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
59 +
60 +SRC_URI="
61 + mirror://cpan/src/5.0/${MY_P}.tar.xz
62 + mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
63 + https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
64 + mirror://gentoo/${PATCH_BASE}.tar.xz
65 + https://dev.gentoo.org/~kentnl/distfiles/${PATCH_BASE}.tar.xz
66 + https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
67 +"
68 +HOMEPAGE="http://www.perl.org/"
69 +
70 +LICENSE="|| ( Artistic GPL-1+ )"
71 +SLOT="0/${SUBSLOT}"
72 +
73 +if [[ "${PV##*.}" != "9999" ]]; then
74 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
75 +fi
76 +
77 +IUSE="berkdb debug doc gdbm ithreads"
78 +
79 +RDEPEND="
80 + berkdb? ( sys-libs/db:= )
81 + gdbm? ( >=sys-libs/gdbm-1.8.3 )
82 + app-arch/bzip2
83 + sys-libs/zlib
84 +"
85 +DEPEND="${RDEPEND}
86 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
87 +"
88 +PDEPEND="
89 + >=app-admin/perl-cleaner-2.5
90 + >=virtual/perl-File-Temp-0.230.400-r2
91 + >=virtual/perl-Data-Dumper-2.154.0
92 + virtual/perl-Test-Harness
93 +"
94 +# bug 390719, bug 523624
95 +# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
96 +
97 +S="${WORKDIR}/${MY_P}"
98 +
99 +dual_scripts() {
100 + src_remove_dual perl-core/Archive-Tar 2.240.0 ptar ptardiff ptargrep
101 + src_remove_dual perl-core/CPAN 2.180.0 cpan
102 + src_remove_dual perl-core/Digest-SHA 5.960.0 shasum
103 + src_remove_dual perl-core/Encode 2.880.0 enc2xs piconv
104 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.240.0 instmodsh
105 + src_remove_dual perl-core/ExtUtils-ParseXS 3.340.0 xsubpp
106 + src_remove_dual perl-core/IO-Compress 2.74.0 zipdetails
107 + src_remove_dual perl-core/JSON-PP 2.274.0.200_rc json_pp
108 + src_remove_dual perl-core/Module-CoreList 5.201.705.300 corelist
109 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
110 + src_remove_dual perl-core/Pod-Perldoc 3.280.0 perldoc
111 + src_remove_dual perl-core/Test-Harness 3.380.0 prove
112 + src_remove_dual perl-core/podlators 4.90.0 pod2man pod2text
113 + src_remove_dual_man perl-core/podlators 4.90.0 /usr/share/man/man1/perlpodstyle.1
114 +}
115 +
116 +check_rebuild() {
117 + # Fresh install
118 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
119 + return 0;
120 + # Major Upgrade
121 + # doesn't matter if there's multiple copies, it still needs a rebuild
122 + # if the string is anything other than "5.CURRENTMAJOR"
123 + elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
124 + echo ""
125 + ewarn "UPDATE THE PERL MODULES:"
126 + ewarn "After updating dev-lang/perl the installed Perl modules"
127 + ewarn "have to be re-installed. In most cases, this is done automatically"
128 + ewarn "by the package manager, but subsequent steps are still recommended"
129 + ewarn "to ensure system consistency."
130 + ewarn
131 + ewarn "You should start with a depclean to remove any unused perl dependencies"
132 + ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
133 + ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
134 + ewarn "Recommended: emerge --depclean -va"
135 + ewarn
136 + ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
137 + ewarn "remaining rebuilds portage may have missed."
138 + ewarn "Use: perl-cleaner --all"
139 + return 0;
140 +
141 + # Reinstall w/ USE Change
142 + elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
143 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
144 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
145 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
146 + echo ""
147 + ewarn "TOGGLED USE-FLAGS WARNING:"
148 + ewarn "You changed one of the use-flags ithreads or debug."
149 + ewarn "You must rebuild all perl-modules installed."
150 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
151 + fi
152 +}
153 +
154 +pkg_setup() {
155 + case ${CHOST} in
156 + *-freebsd*) osname="freebsd" ;;
157 + *-dragonfly*) osname="dragonfly" ;;
158 + *-netbsd*) osname="netbsd" ;;
159 + *-openbsd*) osname="openbsd" ;;
160 + *-darwin*) osname="darwin" ;;
161 + *-interix*) osname="interix" ;;
162 + *-aix*) osname="aix" ;;
163 + *-cygwin*) osname="cygwin" ;;
164 + *) osname="linux" ;;
165 + esac
166 +
167 + myarch="${CHOST%%-*}-${osname}"
168 + if use debug ; then
169 + myarch+="-debug"
170 + fi
171 + if use ithreads ; then
172 + mythreading="-multi"
173 + myarch+="-thread"
174 + fi
175 +
176 + LIBPERL="libperl$(get_libname ${MY_PV} )"
177 + PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
178 + ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
179 + SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
180 + SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
181 + VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
182 + VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
183 +
184 + dual_scripts
185 +}
186 +
187 +src_remove_dual_file() {
188 + local i pkg ver
189 + pkg="$1"
190 + ver="$2"
191 + shift 2
192 + case "${EBUILD_PHASE:-none}" in
193 + postinst|postrm)
194 + for i in "$@" ; do
195 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
196 + done
197 + ;;
198 + setup)
199 + for i in "$@" ; do
200 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
201 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
202 + break
203 + fi
204 + done
205 + ;;
206 + install)
207 + for i in "$@" ; do
208 + if ! [[ -f "${ED}"${i} ]] ; then
209 + ewarn "${i} does not exist!"
210 + continue
211 + fi
212 + mv "${ED}"${i}{,-${ver}-${P}} || die
213 + done
214 + ;;
215 + esac
216 +}
217 +
218 +src_remove_dual_man() {
219 + local i pkg ver ff
220 + pkg="$1"
221 + ver="$2"
222 + shift 2
223 + case "${EBUILD_PHASE:-none}" in
224 + postinst|postrm)
225 + for i in "$@" ; do
226 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
227 + ff=${ff##*${i#${i%.[0-9]}}}
228 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
229 + done
230 + ;;
231 + install)
232 + for i in "$@" ; do
233 + if ! [[ -f "${ED}"${i} ]] ; then
234 + ewarn "${i} does not exist!"
235 + continue
236 + fi
237 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
238 + done
239 + ;;
240 + esac
241 +}
242 +
243 +src_remove_dual() {
244 + local i pkg ver
245 + pkg="$1"
246 + ver="$2"
247 + shift 2
248 + for i in "$@" ; do
249 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
250 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
251 + done
252 +}
253 +
254 +src_prepare_update_patchlevel_h() {
255 + # Copied and modified from debian:
256 + # Copyright 2011 Niko Tyni
257 + # This program is free software; you can redistribute it and/or modify
258 + # it under the same terms as Perl itself.
259 + local patchdir="${WORKDIR}/patches"
260 + local prefix
261 + local patchoutput="patchlevel-gentoo.h"
262 +
263 + [[ -f ${patchdir}/series ]] || return 0
264 +
265 +while read patch
266 +do
267 + patchname=$(echo $patch | sed 's/\.diff$//')
268 + < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e '
269 +
270 + # massage the patch headers
271 + s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend;
272 + s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend;
273 + s|^Bug-Gentoo: ||; tprepend;
274 + s/^\(Subject\|Description\): //; tappend;
275 + s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend;
276 +
277 + # post-process at the end of input
278 + $ { x;
279 + # include the version number in the patchlevel.h description (if available)
280 + s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/;
281 +
282 + # escape any backslashes and double quotes
283 + s|\\|\\\\|g; s|"|\\"|g;
284 +
285 + # add a prefix
286 + s|^|\t,"'"$prefix$patchname"' - |;
287 + # newlines away
288 + s/\n/ /g; s/ */ /g;
289 + # add a suffix
290 + s/ *$/"/; p
291 + };
292 + # stop all processing
293 + d;
294 + # label: append to the hold space
295 + :append H; d;
296 + # label: prepend to the hold space
297 + :prepend x; H; d;
298 + '
299 +done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}"
300 +echo "${patchoutput}" >> "${S}/MANIFEST"
301 +}
302 +
303 +src_prepare_perlcross() {
304 + cp -a ../perl-cross-${CROSS_VER}/* . || die
305 +
306 + sed -i \
307 + -e 's/(15 + $CLEANUP)/(13 + $CLEANUP)/' \
308 + cnf/diffs/perl5-${PV}/makemaker-test.patch || die
309 +
310 + sed -i \
311 + -e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \
312 + -e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \
313 + cnf/diffs/perl5-${PV}/customized.patch || die
314 +
315 + sed -i \
316 + -e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
317 + Makefile || die
318 +
319 + # bug 604072
320 + MAKEOPTS+=" -j1"
321 + export MAKEOPTS
322 +}
323 +src_prepare_dynamic() {
324 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
325 + ln -s ${LIBPERL} libperl$(get_libname ) || die
326 +}
327 +
328 +src_prepare() {
329 + local patch
330 + EPATCH_OPTS+=" -p1"
331 + einfo "Applying patches from ${PATCH_BASE} ..."
332 + while read patch ; do
333 + EPATCH_SINGLE_MSG=" ${patch} ..."
334 + epatch "${WORKDIR}"/patches/${patch}
335 + done < "${WORKDIR}"/patches/series
336 +
337 + src_prepare_update_patchlevel_h
338 +
339 + tc-is-cross-compiler && src_prepare_perlcross
340 +
341 + tc-is-static-only || src_prepare_dynamic
342 +
343 + if use gdbm; then
344 + sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
345 + ext/NDBM_File/Makefile.PL || die
346 + fi
347 +
348 + default
349 +}
350 +
351 +myconf() {
352 + # the myconf array is declared in src_configure
353 + myconf=( "${myconf[@]}" "$@" )
354 +}
355 +
356 +src_configure() {
357 + declare -a myconf
358 +
359 + export LC_ALL="C"
360 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
361 +
362 + # some arches and -O do not mix :)
363 + use ppc && replace-flags -O? -O1
364 +
365 + # Perl has problems compiling with -Os in your flags with glibc
366 + use elibc_uclibc || replace-flags "-Os" "-O2"
367 +
368 + # This flag makes compiling crash in interesting ways
369 + filter-flags "-malign-double"
370 +
371 + # Fixes bug #97645
372 + use ppc && filter-flags "-mpowerpc-gpopt"
373 +
374 + # Fixes bug #143895 on gcc-4.1.1
375 + filter-flags "-fsched2-use-superblocks"
376 +
377 + use sparc && myconf -Ud_longdbl
378 +
379 + export BUILD_BZIP2=0
380 + export BZIP2_INCLUDE=${EROOT}/usr/include
381 + export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
382 +
383 + export BUILD_ZLIB=False
384 + export ZLIB_INCLUDE=${EROOT}/usr/include
385 + export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
386 +
387 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
388 + myndbm='U'
389 + mygdbm='U'
390 + mydb='U'
391 + if use gdbm ; then
392 + mygdbm='D'
393 + if use berkdb ; then
394 + myndbm='D'
395 + fi
396 + fi
397 + if use berkdb ; then
398 + mydb='D'
399 + has_version '=sys-libs/db-1*' && myndbm='D'
400 + fi
401 +
402 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
403 +
404 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
405 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
406 + myconf -Ui_db -Ui_ndbm
407 + fi
408 +
409 + use ithreads && myconf -Dusethreads
410 +
411 + if use debug ; then
412 + append-cflags "-g"
413 + myconf -DDEBUGGING
414 + elif [[ ${CFLAGS} == *-g* ]] ; then
415 + myconf -DDEBUGGING=-g
416 + else
417 + myconf -DDEBUGGING=none
418 + fi
419 +
420 + if [[ -n ${PERL_OLDVERSEN} ]] ; then
421 + local inclist=$(
422 + for v in ${PERL_OLDVERSEN}; do
423 + has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} ";
424 + echo -n "${v} ";
425 + done )
426 + myconf -Dinc_version_list="${inclist}"
427 + fi
428 +
429 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
430 +
431 + # Make sure we can do the final link #523730, need to set deployment
432 + # target to override hardcoded 10.3 which breaks on modern OSX
433 + [[ ${CHOST} == *-darwin* ]] && \
434 + myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
435 +
436 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
437 + # Prefix itself we don't do multilib either, so make sure perl can find
438 + # something compatible.
439 + if use prefix ; then
440 + # Set a hook to check for each detected library whether it actually works.
441 + export libscheck="
442 + ( echo 'main(){}' > '${T}'/conftest.c &&
443 + $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
444 + ) || xxx=/dev/null"
445 +
446 + # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
447 + local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
448 + myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
449 + elif [[ $(get_libdir) != "lib" ]] ; then
450 + # We need to use " and not ', as the written config.sh use ' ...
451 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
452 + fi
453 +
454 + # don't try building ODBM, bug #354453
455 + disabled_extensions="ODBM_File"
456 +
457 + if ! use gdbm ; then
458 + # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
459 + disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
460 + fi
461 +
462 + myconf -Dnoextensions="${disabled_extensions}"
463 +
464 + [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
465 +
466 + [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
467 + # allow fiddling via EXTRA_ECONF, bug 558070
468 + eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
469 +
470 + myconf \
471 + -Duseshrplib \
472 + -Darchname="${myarch}" \
473 + -Dcc="$(tc-getCC)" \
474 + -Doptimize="${CFLAGS}" \
475 + -Dldflags="${LDFLAGS}" \
476 + -Dprefix="${EPREFIX}"'/usr' \
477 + -Dsiteprefix="${EPREFIX}"'/usr/local' \
478 + -Dvendorprefix="${EPREFIX}"'/usr' \
479 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
480 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
481 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
482 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
483 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
484 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
485 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
486 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
487 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
488 + -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
489 + -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
490 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
491 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
492 + -Dman1ext='1' \
493 + -Dman3ext='3pm' \
494 + -Dlibperl="${LIBPERL}" \
495 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
496 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
497 + -Duselargefiles \
498 + -Dd_semctl_semun \
499 + -Dcf_by='Gentoo' \
500 + -Dmyhostname='localhost' \
501 + -Dperladmin='root@localhost' \
502 + -Ud_csh \
503 + -Dsh="${EPREFIX}"/bin/sh \
504 + -Dtargetsh="${EPREFIX}"/bin/sh \
505 + -Uusenm \
506 + "${myconf[@]}" \
507 + "${EXTRA_ECONF[@]}"
508 +
509 + if tc-is-cross-compiler; then
510 + ./configure \
511 + --target="${CHOST}" \
512 + --build="${CBUILD}" \
513 + -Dinstallprefix='' \
514 + -Dinstallusrbinperl='undef' \
515 + -Dusevendorprefix='define' \
516 + "${myconf[@]}" \
517 + || die "Unable to configure"
518 + else
519 + sh Configure \
520 + -des \
521 + -Dinstallprefix="${EPREFIX}"'/usr' \
522 + -Dinstallusrbinperl='n' \
523 + "${myconf[@]}" \
524 + || die "Unable to configure"
525 + fi
526 +}
527 +
528 +src_test() {
529 + export NO_GENTOO_NETWORK_TESTS=1;
530 + if [[ ${EUID} == 0 ]] ; then
531 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
532 + return 0
533 + fi
534 + use elibc_uclibc && export MAKEOPTS+=" -j1"
535 + TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
536 +}
537 +
538 +src_install() {
539 + local i
540 + local coredir="${ARCH_LIB}/CORE"
541 +
542 + emake DESTDIR="${D}" install
543 +
544 + rm -f "${ED}/usr/bin/perl${MY_PV}"
545 + ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
546 +
547 + if ! tc-is-static-only ; then
548 + dolib.so "${ED}"${coredir}/${LIBPERL}
549 + rm -f "${ED}"${coredir}/${LIBPERL}
550 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
551 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
552 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
553 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
554 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
555 + fi
556 +
557 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
558 +
559 + # This removes ${D} from Config.pm
560 + for i in $(find "${D}" -iname "Config.pm" ) ; do
561 + einfo "Removing ${D} from ${i}..."
562 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
563 + done
564 +
565 + dodoc Changes* README AUTHORS
566 +
567 + if use doc ; then
568 + # HTML Documentation
569 + # We expect errors, warnings, and such with the following.
570 +
571 + dodir /usr/share/doc/${PF}/html
572 + LD_LIBRARY_PATH=. ./perl installhtml \
573 + --podroot='.' \
574 + --podpath='lib:ext:pod:vms' \
575 + --recurse \
576 + --htmldir="${ED}/usr/share/doc/${PF}/html"
577 + fi
578 +
579 + [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
580 +
581 + dual_scripts
582 +}
583 +
584 +pkg_preinst() {
585 + check_rebuild
586 +}
587 +
588 +pkg_postinst() {
589 + dual_scripts
590 +
591 + if [[ "${ROOT}" = "/" ]] ; then
592 + local INC DIR file
593 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
594 + einfo "Removing old .ph files"
595 + for DIR in ${INC} ; do
596 + if [[ -d "${DIR}" ]] ; then
597 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
598 + rm -f "${file}"
599 + einfo "<< ${file}"
600 + done
601 + fi
602 + done
603 + # Silently remove the now empty dirs
604 + for DIR in ${INC} ; do
605 + if [[ -d "${DIR}" ]] ; then
606 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
607 + fi
608 + done
609 +
610 + fi
611 +}
612 +
613 +pkg_postrm(){
614 + dual_scripts
615 +}