| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.117 2009/09/27 07:00:32 tove Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.121 2010/01/13 15:15:45 tove Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Seemant Kulleen <seemant@gentoo.org> |
5 | # Author: Seemant Kulleen <seemant@gentoo.org> |
| 6 | |
6 | |
| 7 | # @ECLASS: perl-module.eclass |
7 | # @ECLASS: perl-module.eclass |
| 8 | # @MAINTAINER: |
8 | # @MAINTAINER: |
| … | |
… | |
| 43 | |
43 | |
| 44 | [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" |
44 | [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" |
| 45 | [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ |
45 | [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ |
| 46 | SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION}/${MODULE_A}" |
46 | SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION}/${MODULE_A}" |
| 47 | [[ -z "${HOMEPAGE}" ]] && \ |
47 | [[ -z "${HOMEPAGE}" ]] && \ |
| 48 | HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}" |
48 | HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/" |
| 49 | |
49 | |
| 50 | SRC_PREP="no" |
50 | SRC_PREP="no" |
| 51 | SRC_TEST="skip" |
51 | SRC_TEST="skip" |
| 52 | PREFER_BUILDPL="yes" |
52 | PREFER_BUILDPL="yes" |
| 53 | |
53 | |
| … | |
… | |
| 60 | |
60 | |
| 61 | pm_echovar="" |
61 | pm_echovar="" |
| 62 | perlinfo_done=false |
62 | perlinfo_done=false |
| 63 | |
63 | |
| 64 | perl-module_src_unpack() { |
64 | perl-module_src_unpack() { |
| 65 | base_src_unpack unpack |
65 | base_src_unpack |
| 66 | has src_prepare ${PERL_EXPF} || perl-module_src_prepare |
66 | has src_prepare ${PERL_EXPF} || perl-module_src_prepare |
| 67 | } |
67 | } |
| 68 | |
68 | |
| 69 | perl-module_src_prepare() { |
69 | perl-module_src_prepare() { |
| 70 | if [[ -n ${PATCHES} ]] ; then |
70 | has src_prepare ${PERL_EXPF} && base_src_prepare |
| 71 | base_src_unpack autopatch |
|
|
| 72 | fi |
|
|
| 73 | esvn_clean |
71 | esvn_clean |
| 74 | } |
72 | } |
| 75 | |
73 | |
| 76 | perl-module_src_configure() { |
74 | perl-module_src_configure() { |
| 77 | perl-module_src_prep |
75 | perl-module_src_prep |
| … | |
… | |
| 87 | # Disable ExtUtils::AutoInstall from prompting |
85 | # Disable ExtUtils::AutoInstall from prompting |
| 88 | export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" |
86 | export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" |
| 89 | |
87 | |
| 90 | if [[ ${PREFER_BUILDPL} == yes && -f Build.PL ]] ; then |
88 | if [[ ${PREFER_BUILDPL} == yes && -f Build.PL ]] ; then |
| 91 | einfo "Using Module::Build" |
89 | einfo "Using Module::Build" |
|
|
90 | if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then |
|
|
91 | ewarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it." |
|
|
92 | ewarn " Add virtual/perl-Module-Build to DEPEND!" |
|
|
93 | fi |
| 92 | perl Build.PL \ |
94 | perl Build.PL \ |
| 93 | --installdirs=vendor \ |
95 | --installdirs=vendor \ |
| 94 | --libdoc= \ |
96 | --libdoc= \ |
| 95 | --destdir="${D}" \ |
97 | --destdir="${D}" \ |
| 96 | --create_packlist=0 \ |
98 | --create_packlist=0 \ |
| … | |
… | |
| 251 | find "${D}" -type f -name perllocal.pod -delete |
253 | find "${D}" -type f -name perllocal.pod -delete |
| 252 | find "${D}" -depth -mindepth 1 -type d -empty -delete |
254 | find "${D}" -depth -mindepth 1 -type d -empty -delete |
| 253 | } |
255 | } |
| 254 | |
256 | |
| 255 | linkduallifescripts() { |
257 | linkduallifescripts() { |
| 256 | if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.10.1" ; then |
258 | if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then |
| 257 | return 0 |
259 | return 0 |
| 258 | fi |
260 | fi |
| 259 | |
261 | |
| 260 | local i ff |
262 | local i ff |
| 261 | if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then |
263 | if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then |