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