diff options
author | Torsten Veller <tove@gentoo.org> | 2010-12-31 12:24:41 +0100 |
---|---|---|
committer | Torsten Veller <tove@gentoo.org> | 2011-01-03 08:53:50 +0100 |
commit | 792f8713fe6944f89039bfd1290175c94e9be7ea (patch) | |
tree | 63f7d85521cdfb943a06a5618fa36af47191caa6 /eclass/perl-module.eclass | |
parent | [newversion] CatalystX-SimpleLogin-0.14 (diff) | |
download | perl-overlay-792f8713fe6944f89039bfd1290175c94e9be7ea.tar.gz perl-overlay-792f8713fe6944f89039bfd1290175c94e9be7ea.tar.bz2 perl-overlay-792f8713fe6944f89039bfd1290175c94e9be7ea.zip |
Create MY_P if MY_PN or MY_PV are set. Use myconf, mymake, myinst arrays
Diffstat (limited to 'eclass/perl-module.eclass')
-rw-r--r-- | eclass/perl-module.eclass | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass index 2acb1cd54..5b1ee2e11 100644 --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -54,6 +54,10 @@ DESCRIPTION="Based on the $ECLASS eclass" LICENSE="${LICENSE:-|| ( Artistic GPL-1 GPL-2 GPL-3 )}" +if [[ -n ${MY_PN} || -n ${MY_PV} ]] ; then + : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${PV}}} + S=${MY_S:-${WORKDIR}/${MY_P}} +fi [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" @@ -97,6 +101,12 @@ perl-module_src_prep() { # Disable ExtUtils::AutoInstall from prompting export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" + if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then + local myconf_local=(${myconf}) + else + local myconf_local=("${myconf[@]}") + fi + if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then einfo "Using Module::Build" if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then @@ -108,10 +118,10 @@ perl-module_src_prep() { --libdoc= \ --destdir="${D}" \ --create_packlist=0 \ - ${myconf} + "${myconf_local[@]}" einfo "perl Build.PL" "$@" perl Build.PL "$@" <<< "${pm_echovar}" \ - || die "Unable to build! (are you using USE=\"build\"?)" + || die "Unable to build!" elif [[ -f Makefile.PL ]] ; then einfo "Using ExtUtils::MakeMaker" set -- \ @@ -119,10 +129,10 @@ perl-module_src_prep() { INSTALLDIRS=vendor \ INSTALLMAN3DIR='none' \ DESTDIR="${D}" \ - ${myconf} + "${myconf_local[@]}" einfo "perl Makefile.PL" "$@" perl Makefile.PL "$@" <<< "${pm_echovar}" \ - || die "Unable to build! (are you using USE=\"build\"?)" + || die "Unable to build!" fi if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then einfo "No Make or Build file detected..." @@ -136,14 +146,22 @@ perl-module_src_compile() { has src_configure ${PERL_EXPF} || perl-module_src_prep + if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then + local mymake_local=(${mymake}) + else + local mymake_local=("${mymake[@]}") + fi + if [[ -f Build ]] ; then ./Build build \ - || die "compilation failed" + || die "Compilation failed" elif [[ -f Makefile ]] ; then - emake \ + set -- \ OTHERLDFLAGS="${LDFLAGS}" \ - ${mymake} \ - || die "compilation failed" + "${mymake_local[@]}" + einfo "emake" "$@" + emake "$@" \ + || die "Compilation failed" # OPTIMIZE="${CFLAGS}" \ fi } @@ -200,12 +218,18 @@ perl-module_src_install() { esac fi + if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then + local myinst_local=(${myinst}) + else + local myinst_local=("${myinst[@]}") + fi + if [[ -f Build ]] ; then ./Build ${mytargets} \ || die "./Build ${mytargets} failed" elif [[ -f Makefile ]] ; then - emake ${myinst} ${mytargets} \ - || die "emake ${myinst} ${mytargets} failed" + emake "${myinst_local[@]}" ${mytargets} \ + || die "emake ${myinst_local[@]} ${mytargets} failed" fi perl_delete_module_manpages |