/[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.127 Revision 1.132
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2011 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.127 2011/01/12 15:44:24 tove Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.132 2012/04/15 20:15:39 vapier Exp $
4#
5# Author: Seemant Kulleen <seemant@gentoo.org>
6 4
7# @ECLASS: perl-module.eclass 5# @ECLASS: perl-module.eclass
8# @MAINTAINER: 6# @MAINTAINER:
9# perl@gentoo.org 7# perl@gentoo.org
8# @AUTHOR:
9# Seemant Kulleen <seemant@gentoo.org>
10# @BLURB: eclass for perl modules 10# @BLURB: eclass for perl modules
11# @DESCRIPTION: 11# @DESCRIPTION:
12# The perl-module eclass is designed to allow easier installation of perl 12# The perl-module eclass is designed to allow easier installation of perl
13# modules, and their incorporation into the Gentoo Linux system. 13# modules, and their incorporation into the Gentoo Linux system.
14 14
19 19
20case "${EAPI:-0}" in 20case "${EAPI:-0}" in
21 0|1) 21 0|1)
22 PERL_EXPF+=" pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm" 22 PERL_EXPF+=" pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm"
23 ;; 23 ;;
24 2|3) 24 2|3|4)
25 PERL_EXPF+=" src_prepare src_configure" 25 PERL_EXPF+=" src_prepare src_configure"
26 [[ ${CATEGORY} == "perl-core" ]] && \ 26 [[ ${CATEGORY} == "perl-core" ]] && \
27 PERL_EXPF+=" pkg_postinst pkg_postrm" 27 PERL_EXPF+=" pkg_postinst pkg_postrm"
28 28
29 case "${GENTOO_DEPEND_ON_PERL:-yes}" in 29 case "${GENTOO_DEPEND_ON_PERL:-yes}" in
56 56
57if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then 57if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
58 : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}} 58 : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
59 S=${MY_S:-${WORKDIR}/${MY_P}} 59 S=${MY_S:-${WORKDIR}/${MY_P}}
60fi 60fi
61[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" 61
62[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
63 MODULE_A="${MY_P:-${P}}.${MODULE_A_EXT:-tar.gz}"
62[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ 64[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
63 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" 65 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
64[[ -z "${HOMEPAGE}" ]] && \ 66[[ -z "${HOMEPAGE}" ]] && \
65 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/" 67 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/"
66 68
95 SRC_PREP="yes" 97 SRC_PREP="yes"
96 98
97 perl_set_version 99 perl_set_version
98 perl_set_eprefix 100 perl_set_eprefix
99 101
100 export PERL_MM_USE_DEFAULT=1 102 [[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
101 # Disable ExtUtils::AutoInstall from prompting 103 # Disable ExtUtils::AutoInstall from prompting
102 export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" 104 export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
103 105
104 if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then 106 if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then
105 local myconf_local=(${myconf}) 107 local myconf_local=(${myconf})
193 195
194perl-module_src_test() { 196perl-module_src_test() {
195 debug-print-function $FUNCNAME "$@" 197 debug-print-function $FUNCNAME "$@"
196 if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then 198 if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then
197 if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then 199 if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then
198 export HARNESS_OPTIONS=j$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/\2/" ) 200 export HARNESS_OPTIONS=j$(makeopts_jobs)
199 einfo "Test::Harness Jobs=${HARNESS_OPTIONS}" 201 einfo "Test::Harness Jobs=$(makeopts_jobs)"
200 fi 202 fi
201 ${perlinfo_done} || perl_set_version 203 ${perlinfo_done} || perl_set_version
202 if [[ -f Build ]] ; then 204 if [[ -f Build ]] ; then
203 ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed" 205 ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed"
204 elif [[ -f Makefile ]] ; then 206 elif [[ -f Makefile ]] ; then
365 perl_set_eprefix 367 perl_set_eprefix
366 368
367 local i ff 369 local i ff
368 if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then 370 if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
369 for i in "${DUALLIFESCRIPTS[@]}" ; do 371 for i in "${DUALLIFESCRIPTS[@]}" ; do
370 alternatives_auto_makesym "/usr/bin/${i}" "/usr/bin/${i}-[0-9]*" 372 alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"
373 done
374 for i in "${DUALLIFEMAN[@]}" ; do
371 ff=`echo "${EROOT}"/usr/share/man/man1/${i}-${PV}-${P}.1*` 375 ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`
372 ff=${ff##*.1} 376 ff=${ff##*.1}
373 alternatives_auto_makesym "/usr/share/man/man1/${i}.1${ff}" "/usr/share/man/man1/${i}-[0-9]*" 377 alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"
374 done 378 done
375 else 379 else
376 pushd "${ED}" > /dev/null 380 pushd "${ED}" > /dev/null
377 for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do 381 for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
378 mv ${i}{,-${PV}-${P}} || die 382 mv ${i}{,-${PV}-${P}} || die
379 DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/} 383 #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
380 if [[ -f usr/share/man/man1/${i##*/}.1 ]] ; then 384 DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}
381 mv usr/share/man/man1/${i##*/}{.1,-${PV}-${P}.1} || die 385 done
382 fi 386 for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do
387 mv ${i} ${i%.1}-${PV}-${P}.1 || die
388 DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}
383 done 389 done
384 popd > /dev/null 390 popd > /dev/null
385 fi 391 fi
386} 392}
387 393

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

  ViewVC Help
Powered by ViewVC 1.1.20