Merge remote-tracking branch 'remotes/axelgenus/man-pages-it'
[gentoo.git] / dev-lang / perl / perl-5.20.2-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
8
9 PATCH_VER=2
10
11 PERL_OLDVERSEN="5.20.0 5.20.1"
12 MODULE_AUTHOR=SHAY
13
14 SHORT_PV="${PV%.*}"
15 MY_P="perl-${PV/_rc/-RC}"
16 MY_PV="${PV%_rc*}"
17
18 DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
19
20 SRC_URI="
21         mirror://cpan/src/5.0/${MY_P}.tar.bz2
22         mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MY_P}.tar.bz2
23         mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.xz
24         https://dev.gentoo.org/~dilfridge/distfiles/${MY_P}-patches-${PATCH_VER}.tar.xz
25 "
26 HOMEPAGE="http://www.perl.org/"
27
28 LICENSE="|| ( Artistic GPL-1+ )"
29 SLOT="0/${SHORT_PV}"
30 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~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"
31 IUSE="berkdb debug doc gdbm ithreads"
32
33 RDEPEND="
34         berkdb? ( sys-libs/db:* )
35         gdbm? ( >=sys-libs/gdbm-1.8.3 )
36         app-arch/bzip2
37         sys-libs/zlib
38 "
39 DEPEND="${RDEPEND}
40         !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
41 "
42 PDEPEND="
43         >=app-admin/perl-cleaner-2.5
44         >=virtual/perl-File-Temp-0.230.400-r2
45         >=virtual/perl-Data-Dumper-2.154.0
46 "
47 # bug 390719, bug 523624
48
49 S="${WORKDIR}/${MY_P}"
50
51 dual_scripts() {
52         src_remove_dual      perl-core/Archive-Tar        1.960.0      ptar ptardiff ptargrep
53         src_remove_dual      perl-core/Digest-SHA         5.880.0      shasum
54         src_remove_dual      perl-core/CPAN               2.50.0      cpan
55         src_remove_dual      perl-core/Encode             2.600.0      enc2xs piconv
56         src_remove_dual      perl-core/ExtUtils-MakeMaker 6.980.0      instmodsh
57         src_remove_dual      perl-core/ExtUtils-ParseXS   3.240.0      xsubpp
58         src_remove_dual      perl-core/IO-Compress        2.64.0       zipdetails
59         src_remove_dual      perl-core/JSON-PP            2.272.30      json_pp
60         src_remove_dual      perl-core/Module-CoreList    5.201.502.140 corelist
61         src_remove_dual      perl-core/Pod-Parser         1.620.0      pod2usage podchecker podselect
62         src_remove_dual      perl-core/Pod-Perldoc        3.230.0      perldoc
63         src_remove_dual      perl-core/Test-Harness       3.330.0      prove
64         src_remove_dual      perl-core/podlators          2.5.3        pod2man pod2text
65         src_remove_dual_man  perl-core/podlators          2.5.3        /usr/share/man/man1/perlpodstyle.1
66         if [[ ${EBUILD_PHASE} == "install" ]] ; then #553726
67                 rm "${ED}"/usr/bin/config_data "${ED}"/usr/share/man/man1/config_data.1 || die
68         fi
69 }
70
71 # eblit-include [--skip] <function> [version]
72 eblit-include() {
73         local skipable=false
74         [[ $1 == "--skip" ]] && skipable=true && shift
75         [[ $1 == pkg_* ]] && skipable=true
76
77         local e v func=$1 ver=$2
78         [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
79         for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
80                 e="${FILESDIR}/eblits/${func}${v}.eblit"
81                 if [[ -e ${e} ]] ; then
82                         . "${e}"
83                         return 0
84                 fi
85         done
86         ${skipable} && return 0
87         die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
88 }
89
90 # eblit-run-maybe <function>
91 # run the specified function if it is defined
92 eblit-run-maybe() {
93         [[ $(type -t "$@") == "function" ]] && "$@"
94 }
95
96 # eblit-run <function> [version]
97 # aka: src_unpack() { eblit-run src_unpack ; }
98 eblit-run() {
99         eblit-include --skip common "${*:2}"
100         eblit-include "$@"
101         eblit-run-maybe eblit-$1-pre
102         eblit-${PN}-$1
103         eblit-run-maybe eblit-$1-post
104 }
105
106 #src_unpack()   { eblit-run src_unpack    v50160001 ; }
107 src_prepare()   { eblit-run src_prepare   v50160001 ; }
108 src_configure() { eblit-run src_configure v50180002 ; }
109 #src_compile()  { eblit-run src_compile   v50160001 ; }
110 src_test()              {
111         export NO_GENTOO_NETWORK_TESTS=1;
112         eblit-run src_test      v50160001 ;
113 }
114 src_install()   { eblit-run src_install   v50200001 ; }
115
116 # FILESDIR might not be available during binpkg install
117 # FIXME: version passing
118 for x in setup {pre,post}{inst,rm} ; do
119         e="${FILESDIR}/eblits/pkg_${x}-v50160001.eblit"
120         if [[ -e ${e} ]] ; then
121                 . "${e}"
122                 eval "pkg_${x}() { eblit-run pkg_${x} v50160001 ; }"
123         fi
124 done