/[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.34 Revision 1.61
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2004 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.34 2003/03/11 21:26:32 seemant Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.61 2004/05/10 21:10:50 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# 7#
7# 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
8# modules, and their incorporation into the Gentoo Linux system. 9# modules, and their incorporation into the Gentoo Linux system.
9 10
10#first inherit the pkg_postinst() and pkg_postrm() functions 11ECLASS=perl-module
11inherit perl-post 12INHERITED="${INHERITED} ${ECLASS}"
12 13
13ECLASS=perl-module 14EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \
14INHERITED="$INHERITED $ECLASS" 15 src_compile src_install src_test \
16 perlinfo updatepod
15 17
16EXPORT_FUNCTIONS src_compile src_install src_test 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.
17 25
18eval `perl '-V:version'` 26DEPEND="dev-lang/perl !<dev-perl/ExtUtils-MakeMaker-6.17"
19DEPEND="dev-lang/perl
20 >=dev-perl/ExtUtils-MakeMaker-6.05-r1
21 ${DEPEND}"
22SRC_PREP="no" 27SRC_PREP="no"
28SRC_TEST="skip"
29
30PERL_VERSION=""
31SITE_ARCH=""
32SITE_LIB=""
33ARCH_LIB=""
34POD_DIR=""
23 35
24perl-module_src_prep() { 36perl-module_src_prep() {
25 37
38 perlinfo
39
26 SRC_PREP="yes" 40 SRC_PREP="yes"
41 if [ "${style}" == "builder" ]; then
42 perl ${S}/Build.PL installdirs=vendor destdir=${D}
43 else
27 perl Makefile.PL ${myconf} \ 44 perl Makefile.PL ${myconf} \
28 PREFIX=${D}/usr 45 PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D}
46 fi
29} 47}
30 48
31perl-module_src_compile() { 49perl-module_src_compile() {
32 50
33 [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep 51 [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep
52 if [ "${style}" != "builder" ]; then
34 make ${mymake} || die "compilation failed" 53 make ${mymake} || die "compilation failed"
54 fi
55
56 if [ "${SRC_TEST}" == "do" ]; then
57 perl-module_src_test || die "test failed"
58 SRC_TEST="done"
59 fi
35} 60}
36 61
37perl-module_src_test() { 62perl-module_src_test() {
63 if [ "${style}" == "builder" ]; then
64 perl ${S}/Build test
65 else
38 make test 66 make test
67 fi
39} 68}
40 69
41perl-module_src_install() { 70perl-module_src_install() {
42 71
43 perl-post_perlinfo 72 perlinfo
44 dodir ${POD_DIR} 73 dodir ${POD_DIR}
45 74
46 test -z ${mytargets} && mytargets="install" 75 test -z ${mytargets} && mytargets="install"
47 eval `perl '-V:installsitearch'`
48 SITE_ARCH=${installsitearch}
49 eval `perl '-V:installarchlib'`
50 ARCH_LIB=${installarchlib}
51 76
52 77 if [ "${style}" == "builder" ]; then
53 make \ 78 perl ${S}/Build install
54 PREFIX=${D}/usr \ 79 else
55 INSTALLMAN1DIR=${D}/usr/share/man/man1 \ 80 make ${myinst} ${mytargets} || die
56 INSTALLMAN2DIR=${D}/usr/share/man/man2 \ 81 fi
57 INSTALLMAN3DIR=${D}/usr/share/man/man3 \
58 INSTALLMAN4DIR=${D}/usr/share/man/man4 \
59 INSTALLMAN5DIR=${D}/usr/share/man/man5 \
60 INSTALLMAN6DIR=${D}/usr/share/man/man6 \
61 INSTALLMAN7DIR=${D}/usr/share/man/man7 \
62 INSTALLMAN8DIR=${D}/usr/share/man/man8 \
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
75
76 82
77 if [ -f ${D}${ARCH_LIB}/perllocal.pod ]; 83 if [ -f ${D}${ARCH_LIB}/perllocal.pod ];
78 then 84 then
79 touch ${D}/${POD_DIR}/${P}.pod 85 touch ${D}/${POD_DIR}/${P}.pod
80 sed -e "s:${D}::g" \ 86 sed -e "s:${D}::g" \
92 touch ${D}/${POD_DIR}/${P}.pod.site 98 touch ${D}/${POD_DIR}/${P}.pod.site
93 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site 99 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site
94 rm -f ${D}/${SITE_LIB}/perllocal.pod 100 rm -f ${D}/${SITE_LIB}/perllocal.pod
95 fi 101 fi
96 102
103 for FILE in `find ${D} -type f -name "*.html" -o -name ".packlist"`; do
104 sed -i -e "s:${D}:/:g" ${FILE}
105 done
106
97 dodoc Change* MANIFEST* README* ${mydoc} 107 for doc in Change* MANIFEST* README*; do
108 [ -s "$doc" ] && dodoc $doc
109 done
110 dodoc ${mydoc}
98} 111}
112
113
114perl-module_pkg_setup() {
115
116 perlinfo
117}
118
119
120perl-module_pkg_preinst() {
121
122 perlinfo
123}
124
125perl-module_pkg_postinst() {
126
127 updatepod
128}
129
130perl-module_pkg_prerm() {
131
132 updatepod
133}
134
135perl-module_pkg_postrm() {
136
137 updatepod
138}
139
140perlinfo() {
141
142 if [ -f /usr/bin/perl ]
143 then
144 POD_DIR="/usr/share/perl/gentoo-pods/${version}"
145 fi
146 eval `perl '-V:version'`
147 PERL_VERSION=${version}
148 eval `perl '-V:installsitearch'`
149 SITE_ARCH=${installsitearch}
150 eval `perl '-V:installarchlib'`
151 ARCH_LIB=${installarchlib}
152 eval `perl '-V:installarchlib'`
153 ARCH_LIB=${installarchlib}
154 eval `perl '-V:installsitearch'`
155 SITE_LIB=${installsitearch}
156}
157
158updatepod() {
159 perlinfo
160
161 if [ -d "${POD_DIR}" ]
162 then
163 for FILE in `find ${POD_DIR} -type f -name "*.pod.arch"`; do
164 cat ${FILE} >> ${ARCH_LIB}/perllocal.pod
165 rm -f ${FILE}
166 done
167 for FILE in `find ${POD_DIR} -type f -name "*.pod.site"`; do
168 cat ${FILE} >> ${SITE_LIB}/perllocal.pod
169 rm -f ${FILE}
170 done
171 fi
172}

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.61

  ViewVC Help
Powered by ViewVC 1.1.20