| 1 | # Copyright 2002 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
| 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.33 2003/02/16 04:26:21 vapier Exp $ |
|
|
4 | # |
| 3 | # Author: Seemant Kulleen <seemant@gentoo.org> |
5 | # Author: Seemant Kulleen <seemant@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.2 2002/05/05 07:00:38 seemant Exp $ |
6 | # |
| 5 | # The perl-module eclass is designed to allow easier installation of perl |
7 | # The perl-module eclass is designed to allow easier installation of perl |
| 6 | # modules, and their incorporation into the Gentoo Linux system. |
8 | # modules, and their incorporation into the Gentoo Linux system. |
| 7 | ECLASS=base |
|
|
| 8 | EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |
|
|
| 9 | |
9 | |
| 10 | newdepend ">=sys-devel/perl-5" |
10 | #first inherit the pkg_postinst() and pkg_postrm() functions |
|
|
11 | inherit perl-post |
| 11 | |
12 | |
| 12 | base_src_compile() { |
13 | ECLASS=perl-module |
|
|
14 | INHERITED="$INHERITED $ECLASS" |
|
|
15 | |
|
|
16 | EXPORT_FUNCTIONS src_compile src_install src_test |
|
|
17 | |
|
|
18 | eval `perl '-V:version'` |
|
|
19 | DEPEND="sys-devel/perl |
|
|
20 | >=dev-perl/ExtUtils-MakeMaker-6.05-r1 |
|
|
21 | ${DEPEND}" |
|
|
22 | SRC_PREP="no" |
|
|
23 | |
|
|
24 | perl-module_src_prep() { |
|
|
25 | |
|
|
26 | SRC_PREP="yes" |
| 13 | perl Makefile.PL ${myconf} |
27 | perl Makefile.PL ${myconf} \ |
| 14 | make || die |
28 | PREFIX=${D}/usr |
| 15 | } |
29 | } |
| 16 | |
30 | |
| 17 | base_src_install() { |
31 | perl-module_src_compile() { |
|
|
32 | |
|
|
33 | [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep |
|
|
34 | make ${mymake} || die "compilation failed" |
|
|
35 | } |
|
|
36 | |
|
|
37 | perl-module_src_test() { |
|
|
38 | make test |
|
|
39 | } |
|
|
40 | |
|
|
41 | perl-module_src_install() { |
| 18 | |
42 | |
|
|
43 | perl-post_perlinfo |
| 19 | dodir ${POD_DIR} |
44 | dodir ${POD_DIR} |
|
|
45 | |
|
|
46 | test -z ${mytargets} && mytargets="install" |
|
|
47 | eval `perl '-V:installsitearch'` |
|
|
48 | SITE_ARCH=${installsitearch} |
|
|
49 | eval `perl '-V:installarchlib'` |
|
|
50 | ARCH_LIB=${installarchlib} |
|
|
51 | |
| 20 | |
52 | |
| 21 | make \ |
53 | make \ |
| 22 | PREFIX=${D}/usr \ |
54 | PREFIX=${D}/usr \ |
| 23 | INSTALLMAN1DIR=${D}/usr/share/man/man1 \ |
55 | INSTALLMAN1DIR=${D}/usr/share/man/man1 \ |
| 24 | INSTALLMAN2DIR=${D}/usr/share/man/man2 \ |
56 | INSTALLMAN2DIR=${D}/usr/share/man/man2 \ |
| … | |
… | |
| 26 | INSTALLMAN4DIR=${D}/usr/share/man/man4 \ |
58 | INSTALLMAN4DIR=${D}/usr/share/man/man4 \ |
| 27 | INSTALLMAN5DIR=${D}/usr/share/man/man5 \ |
59 | INSTALLMAN5DIR=${D}/usr/share/man/man5 \ |
| 28 | INSTALLMAN6DIR=${D}/usr/share/man/man6 \ |
60 | INSTALLMAN6DIR=${D}/usr/share/man/man6 \ |
| 29 | INSTALLMAN7DIR=${D}/usr/share/man/man7 \ |
61 | INSTALLMAN7DIR=${D}/usr/share/man/man7 \ |
| 30 | INSTALLMAN8DIR=${D}/usr/share/man/man8 \ |
62 | INSTALLMAN8DIR=${D}/usr/share/man/man8 \ |
| 31 | install || die |
63 | INSTALLSITEMAN1DIR=${D}/usr/share/man/man1 \ |
|
|
64 | INSTALLSITEMAN2DIR=${D}/usr/share/man/man2 \ |
|
|
65 | INSTALLSITEMAN3DIR=${D}/usr/share/man/man3 \ |
|
|
66 | INSTALLSITEMAN4DIR=${D}/usr/share/man/man4 \ |
|
|
67 | INSTALLSITEMAN5DIR=${D}/usr/share/man/man5 \ |
|
|
68 | INSTALLSITEMAN6DIR=${D}/usr/share/man/man6 \ |
|
|
69 | INSTALLSITEMAN7DIR=${D}/usr/share/man/man7 \ |
|
|
70 | INSTALLSITEMAN8DIR=${D}/usr/share/man/man8 \ |
|
|
71 | INSTALLSITEARCH=${D}/${SITE_ARCH} \ |
|
|
72 | INSTALLSCRIPT=${D}/usr/bin \ |
|
|
73 | ${myinst} \ |
|
|
74 | ${mytargets} || die |
| 32 | |
75 | |
| 33 | eval `perl '-V:installarchlib'` |
76 | |
|
|
77 | if [ -f ${D}${ARCH_LIB}/perllocal.pod ]; |
|
|
78 | then |
|
|
79 | touch ${D}/${POD_DIR}/${P}.pod |
| 34 | sed -e "s:${D}::g" \ |
80 | sed -e "s:${D}::g" \ |
| 35 | ${D}/${installarchlib}/perllocal.pod \ |
81 | ${D}${ARCH_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod |
| 36 | > ${D}/${POD_DIR}/${PF}.pod |
82 | touch ${D}/${POD_DIR}/${P}.pod.arch |
|
|
83 | cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.arch |
|
|
84 | rm -f ${D}/${ARCH_LIB}/perllocal.pod |
|
|
85 | fi |
| 37 | |
86 | |
| 38 | rm -f ${D}/${installarchlib}/perllocal.pod |
87 | if [ -f ${D}${SITE_LIB}/perllocal.pod ]; |
|
|
88 | then |
|
|
89 | touch ${D}/${POD_DIR}/${P}.pod |
|
|
90 | sed -e "s:${D}::g" \ |
|
|
91 | ${D}${SITE_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod |
|
|
92 | touch ${D}/${POD_DIR}/${P}.pod.site |
|
|
93 | cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site |
|
|
94 | rm -f ${D}/${SITE_LIB}/perllocal.pod |
|
|
95 | fi |
| 39 | |
96 | |
| 40 | dodoc ChangeLog MANIFEST NOTES README VERSIONS WARNING ToDo |
97 | dodoc Change* MANIFEST* README* ${mydoc} |
| 41 | } |
98 | } |