| 1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2004 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.58 2004/04/02 10:22:50 mcummings Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.64 2004/08/02 18:45:37 rac Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Seemant Kulleen <seemant@gentoo.org> |
5 | # Author: Seemant Kulleen <seemant@gentoo.org> |
| 6 | # Maintained by the Perl herd <perl@gentoo.org> |
6 | # Maintained by the Perl herd <perl@gentoo.org> |
| 7 | # |
7 | # |
| 8 | # The perl-module eclass is designed to allow easier installation of perl |
8 | # The perl-module eclass is designed to allow easier installation of perl |
| … | |
… | |
| 13 | |
13 | |
| 14 | EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \ |
14 | EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \ |
| 15 | src_compile src_install src_test \ |
15 | src_compile src_install src_test \ |
| 16 | perlinfo updatepod |
16 | perlinfo updatepod |
| 17 | |
17 | |
|
|
18 | # 2004.05.10 rac |
|
|
19 | # block on makemaker versions earlier than that in the 5.8.2 core. in |
|
|
20 | # actuality, this should be handled in the perl ebuild, so every perl |
|
|
21 | # ebuild should block versions of MakeMaker older than the one it |
|
|
22 | # carries. in the meantime, since we have dumped support for MakeMaker |
|
|
23 | # <6.11 and the associated broken DESTDIR handling, block here to save |
|
|
24 | # people from sandbox trouble. |
|
|
25 | # |
|
|
26 | # 2004.05.25 rac |
|
|
27 | # for the same reasons, make the perl dep >=5.8.2 to get everybody |
|
|
28 | # with 5.8.0 and its 6.03 makemaker up to a version that can |
|
|
29 | # understand DESTDIR |
| 18 | |
30 | |
| 19 | newdepend ">=dev-lang/perl-5.8.0-r12" |
31 | DEPEND=">=dev-lang/perl-5.8.2 !<dev-perl/ExtUtils-MakeMaker-6.17" |
| 20 | SRC_PREP="no" |
32 | SRC_PREP="no" |
| 21 | SRC_TEST="skip" |
33 | SRC_TEST="skip" |
| 22 | |
34 | |
| 23 | PERL_VERSION="" |
35 | PERL_VERSION="" |
| 24 | SITE_ARCH="" |
36 | SITE_ARCH="" |
| 25 | SITE_LIB="" |
37 | SITE_LIB="" |
| 26 | ARCH_LIB="" |
38 | ARCH_LIB="" |
| 27 | POD_DIR="" |
39 | POD_DIR="" |
| 28 | MMSIXELEVEN="" |
|
|
| 29 | |
40 | |
| 30 | perl-module_src_prep() { |
41 | perl-module_src_prep() { |
|
|
42 | |
|
|
43 | perlinfo |
|
|
44 | |
|
|
45 | export PERL_MM_USE_DEFAULT=1 |
|
|
46 | |
| 31 | SRC_PREP="yes" |
47 | SRC_PREP="yes" |
| 32 | if [ "${style}" == "builder" ]; then |
48 | if [ "${style}" == "builder" ]; then |
| 33 | perl ${S}/Build.PL installdirs=vendor destdir=${D} |
49 | perl ${S}/Build.PL installdirs=vendor destdir=${D} |
| 34 | else |
50 | else |
| 35 | if [ "${MMSIXELEVEN}" ]; then |
|
|
| 36 | perl Makefile.PL ${myconf} \ |
51 | perl Makefile.PL ${myconf} \ |
| 37 | PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D} |
52 | PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D} |
| 38 | else |
|
|
| 39 | perl Makefile.PL ${myconf} \ |
|
|
| 40 | PREFIX=${D}/usr INSTALLDIRS=vendor |
|
|
| 41 | fi |
|
|
| 42 | fi |
53 | fi |
| 43 | |
|
|
| 44 | } |
54 | } |
| 45 | |
55 | |
| 46 | perl-module_src_compile() { |
56 | perl-module_src_compile() { |
| 47 | |
57 | |
| 48 | [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep |
58 | [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep |
| … | |
… | |
| 60 | if [ "${style}" == "builder" ]; then |
70 | if [ "${style}" == "builder" ]; then |
| 61 | perl ${S}/Build test |
71 | perl ${S}/Build test |
| 62 | else |
72 | else |
| 63 | make test |
73 | make test |
| 64 | fi |
74 | fi |
| 65 | |
|
|
| 66 | } |
75 | } |
| 67 | |
76 | |
| 68 | perl-module_src_install() { |
77 | perl-module_src_install() { |
| 69 | |
78 | |
| 70 | perlinfo |
79 | perlinfo |
| … | |
… | |
| 73 | test -z ${mytargets} && mytargets="install" |
82 | test -z ${mytargets} && mytargets="install" |
| 74 | |
83 | |
| 75 | if [ "${style}" == "builder" ]; then |
84 | if [ "${style}" == "builder" ]; then |
| 76 | perl ${S}/Build install |
85 | perl ${S}/Build install |
| 77 | else |
86 | else |
| 78 | if [ "${MMSIXELEVEN}" ]; then |
|
|
| 79 | make ${myinst} ${mytargets} || die |
87 | make ${myinst} ${mytargets} || die |
| 80 | else |
|
|
| 81 | make \ |
|
|
| 82 | PREFIX=${D}/usr \ |
|
|
| 83 | INSTALLMAN1DIR=${D}/usr/share/man/man1 \ |
|
|
| 84 | INSTALLMAN2DIR=${D}/usr/share/man/man2 \ |
|
|
| 85 | INSTALLMAN3DIR=${D}/usr/share/man/man3 \ |
|
|
| 86 | INSTALLMAN4DIR=${D}/usr/share/man/man4 \ |
|
|
| 87 | INSTALLMAN5DIR=${D}/usr/share/man/man5 \ |
|
|
| 88 | INSTALLMAN6DIR=${D}/usr/share/man/man6 \ |
|
|
| 89 | INSTALLMAN7DIR=${D}/usr/share/man/man7 \ |
|
|
| 90 | INSTALLMAN8DIR=${D}/usr/share/man/man8 \ |
|
|
| 91 | INSTALLSITEMAN1DIR=${D}/usr/share/man/man1 \ |
|
|
| 92 | INSTALLSITEMAN2DIR=${D}/usr/share/man/man2 \ |
|
|
| 93 | INSTALLSITEMAN3DIR=${D}/usr/share/man/man3 \ |
|
|
| 94 | INSTALLSITEMAN4DIR=${D}/usr/share/man/man4 \ |
|
|
| 95 | INSTALLSITEMAN5DIR=${D}/usr/share/man/man5 \ |
|
|
| 96 | INSTALLSITEMAN6DIR=${D}/usr/share/man/man6 \ |
|
|
| 97 | INSTALLSITEMAN7DIR=${D}/usr/share/man/man7 \ |
|
|
| 98 | INSTALLSITEMAN8DIR=${D}/usr/share/man/man8 \ |
|
|
| 99 | INSTALLVENDORMAN3DIR=${D}/usr/share/man/man3 \ |
|
|
| 100 | INSTALLSITEARCH=${D}/${SITE_ARCH} \ |
|
|
| 101 | INSTALLSCRIPT=${D}/usr/bin \ |
|
|
| 102 | ${myinst} \ |
|
|
| 103 | ${mytargets} || die |
|
|
| 104 | fi |
|
|
| 105 | fi |
88 | fi |
| 106 | |
89 | |
| 107 | if [ -f ${D}${ARCH_LIB}/perllocal.pod ]; |
90 | if [ -f ${D}${ARCH_LIB}/perllocal.pod ]; |
| 108 | then |
91 | then |
| 109 | touch ${D}/${POD_DIR}/${P}.pod |
92 | touch ${D}/${POD_DIR}/${P}.pod |
| … | |
… | |
| 175 | ARCH_LIB=${installarchlib} |
158 | ARCH_LIB=${installarchlib} |
| 176 | eval `perl '-V:installarchlib'` |
159 | eval `perl '-V:installarchlib'` |
| 177 | ARCH_LIB=${installarchlib} |
160 | ARCH_LIB=${installarchlib} |
| 178 | eval `perl '-V:installsitearch'` |
161 | eval `perl '-V:installsitearch'` |
| 179 | SITE_LIB=${installsitearch} |
162 | SITE_LIB=${installsitearch} |
| 180 | # handling of DESTDIR changed in makemaker 6.11 |
|
|
| 181 | MMSIXELEVEN=`perl -e 'use ExtUtils::MakeMaker; print( $ExtUtils::MakeMaker::VERSION ge "6.11" )'` |
|
|
| 182 | |
|
|
| 183 | } |
163 | } |
| 184 | |
164 | |
| 185 | updatepod() { |
165 | updatepod() { |
| 186 | perlinfo |
166 | perlinfo |
| 187 | |
167 | |