/[gentoo-x86]/eclass/perl-module.eclass
Gentoo

Diff of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.126 Revision 1.127
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.126 2010/07/15 11:44:48 tove Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.127 2011/01/12 15:44:24 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:
32 RDEPEND="${DEPEND}" 32 RDEPEND="${DEPEND}"
33 ;; 33 ;;
34 esac 34 esac
35 ;; 35 ;;
36 *) 36 *)
37 DEPEND="EAPI-UNSUPPORTED" 37 die "EAPI=${EAPI} is not supported by perl-module.eclass"
38 ;; 38 ;;
39esac 39esac
40 40
41case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in 41case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
42 yes) 42 yes)
44 ;; 44 ;;
45 no) 45 no)
46 debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no" 46 debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
47 ;; 47 ;;
48 *) 48 *)
49 DEPEND+=" PERL_EXPORT_PHASE_FUNCTIONS-UNSUPPORTED" 49 die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
50 ;; 50 ;;
51esac 51esac
52 52
53DESCRIPTION="Based on the $ECLASS eclass" 53DESCRIPTION="Based on the $ECLASS eclass"
54 54
55LICENSE="${LICENSE:-|| ( Artistic GPL-1 GPL-2 GPL-3 )}" 55LICENSE="${LICENSE:-|| ( Artistic GPL-1 GPL-2 GPL-3 )}"
56 56
57if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
58 : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
59 S=${MY_S:-${WORKDIR}/${MY_P}}
60fi
57[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" 61[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz"
58[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ 62[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
59 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" 63 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
60[[ -z "${HOMEPAGE}" ]] && \ 64[[ -z "${HOMEPAGE}" ]] && \
61 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/" 65 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/"
95 99
96 export PERL_MM_USE_DEFAULT=1 100 export PERL_MM_USE_DEFAULT=1
97 # Disable ExtUtils::AutoInstall from prompting 101 # Disable ExtUtils::AutoInstall from prompting
98 export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" 102 export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
99 103
104 if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then
105 local myconf_local=(${myconf})
106 else
107 local myconf_local=("${myconf[@]}")
108 fi
109
100 if [[ ${PREFER_BUILDPL} == yes && -f Build.PL ]] ; then 110 if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
101 einfo "Using Module::Build" 111 einfo "Using Module::Build"
102 if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then 112 if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then
103 eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it." 113 eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
104 eqawarn " Add virtual/perl-Module-Build to DEPEND!" 114 eqawarn " Add virtual/perl-Module-Build to DEPEND!"
115 if [[ -n ${PERLQAFATAL} ]]; then
116 eerror "Bailing out due to PERLQAFATAL=1";
117 die;
118 fi
105 fi 119 fi
106 set -- \ 120 set -- \
107 --installdirs=vendor \ 121 --installdirs=vendor \
108 --libdoc= \ 122 --libdoc= \
109 --destdir="${D}" \ 123 --destdir="${D}" \
110 --create_packlist=0 \ 124 --create_packlist=0 \
111 ${myconf} 125 "${myconf_local[@]}"
112 einfo "perl Build.PL" "$@" 126 einfo "perl Build.PL" "$@"
113 perl Build.PL "$@" <<< "${pm_echovar}" \ 127 perl Build.PL "$@" <<< "${pm_echovar}" \
114 || die "Unable to build! (are you using USE=\"build\"?)" 128 || die "Unable to build!"
115 elif [[ -f Makefile.PL ]] ; then 129 elif [[ -f Makefile.PL ]] ; then
116 einfo "Using ExtUtils::MakeMaker" 130 einfo "Using ExtUtils::MakeMaker"
117 set -- \ 131 set -- \
118 PREFIX=${EPREFIX}/usr \ 132 PREFIX=${EPREFIX}/usr \
119 INSTALLDIRS=vendor \ 133 INSTALLDIRS=vendor \
120 INSTALLMAN3DIR='none' \ 134 INSTALLMAN3DIR='none' \
121 DESTDIR="${D}" \ 135 DESTDIR="${D}" \
122 ${myconf} 136 "${myconf_local[@]}"
123 einfo "perl Makefile.PL" "$@" 137 einfo "perl Makefile.PL" "$@"
124 perl Makefile.PL "$@" <<< "${pm_echovar}" \ 138 perl Makefile.PL "$@" <<< "${pm_echovar}" \
125 || die "Unable to build! (are you using USE=\"build\"?)" 139 || die "Unable to build!"
126 fi 140 fi
127 if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then 141 if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then
128 einfo "No Make or Build file detected..." 142 einfo "No Make or Build file detected..."
129 return 143 return
130 fi 144 fi
134 debug-print-function $FUNCNAME "$@" 148 debug-print-function $FUNCNAME "$@"
135 perl_set_version 149 perl_set_version
136 150
137 has src_configure ${PERL_EXPF} || perl-module_src_prep 151 has src_configure ${PERL_EXPF} || perl-module_src_prep
138 152
153 if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
154 local mymake_local=(${mymake})
155 else
156 local mymake_local=("${mymake[@]}")
157 fi
158
139 if [[ -f Build ]] ; then 159 if [[ -f Build ]] ; then
140 ./Build build \ 160 ./Build build \
141 || die "compilation failed" 161 || die "Compilation failed"
142 elif [[ -f Makefile ]] ; then 162 elif [[ -f Makefile ]] ; then
143 emake \ 163 set -- \
144 OTHERLDFLAGS="${LDFLAGS}" \ 164 OTHERLDFLAGS="${LDFLAGS}" \
145 ${mymake} \ 165 "${mymake_local[@]}"
166 einfo "emake" "$@"
167 emake "$@" \
146 || die "compilation failed" 168 || die "Compilation failed"
147# OPTIMIZE="${CFLAGS}" \ 169# OPTIMIZE="${CFLAGS}" \
148 fi 170 fi
149} 171}
150 172
151# For testers: 173# For testers:
198 dev-perl|perl-core) mytargets="pure_install" ;; 220 dev-perl|perl-core) mytargets="pure_install" ;;
199 *) mytargets="install" ;; 221 *) mytargets="install" ;;
200 esac 222 esac
201 fi 223 fi
202 224
225 if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
226 local myinst_local=(${myinst})
227 else
228 local myinst_local=("${myinst[@]}")
229 fi
230
203 if [[ -f Build ]] ; then 231 if [[ -f Build ]] ; then
204 ./Build ${mytargets} \ 232 ./Build ${mytargets} \
205 || die "./Build ${mytargets} failed" 233 || die "./Build ${mytargets} failed"
206 elif [[ -f Makefile ]] ; then 234 elif [[ -f Makefile ]] ; then
207 emake ${myinst} ${mytargets} \ 235 emake "${myinst_local[@]}" ${mytargets} \
208 || die "emake ${myinst} ${mytargets} failed" 236 || die "emake ${myinst_local[@]} ${mytargets} failed"
209 fi 237 fi
210 238
211 perl_delete_module_manpages 239 perl_delete_module_manpages
212 perl_delete_localpod 240 perl_delete_localpod
213 perl_delete_packlist 241 perl_delete_packlist

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.127

  ViewVC Help
Powered by ViewVC 1.1.20