/[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.8 Revision 1.55
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.55 2003/12/22 20:40:05 rac 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.8 2002/05/06 14:34:55 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 9
8#first inherit the pkg_postinst() and pkg_postrm() functions 10ECLASS=perl-module
9. /usr/portage/eclass/inherit.eclass || die 11INHERITED="${INHERITED} ${ECLASS}"
10inherit perl-post
11 12
12ECLASS=base 13EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \
13EXPORT_FUNCTIONS src_compile src_install src_test 14 src_compile src_install src_test \
15 perlinfo updatepod
14 16
15newdepend ">=sys-devel/perl-5" 17eval `perl '-V:version'`
18newdepend ">=dev-lang/perl-5.8.0-r12"
19SRC_PREP="no"
20SRC_TEST="skip"
16 21
17base_src_compile() { 22SITE_LIB=""
23ARCH_LIB=""
24POD_DIR=""
18 25
26# handling of DESTDIR changed in makemaker 6.11
27MMSIXELEVEN=`perl -e 'use ExtUtils::MakeMaker; print( $ExtUtils::MakeMaker::VERSION ge "6.11" )'`
28
29perl-module_src_prep() {
30
31 SRC_PREP="yes"
32 if [ "${style}" == "builder" ]; then
33 perl ${S}/Build.PL installdirs=vendor destdir=${D}
34 else
35 if [ "${MMSIXELEVEN}" ]; then
19 perl Makefile.PL ${myconf} 36 perl Makefile.PL ${myconf} \
20 make ${mymake} || die "compilation failed" 37 PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D}
38 else
39 perl Makefile.PL ${myconf} \
40 PREFIX=${D}/usr INSTALLDIRS=vendor
41 fi
42 fi
43
21} 44}
22 45
23base_src_test() { 46perl-module_src_compile() {
24 47
25 make test || die 48 [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep
49 if [ "${style}" != "builder" ]; then
50 make ${mymake} || die "compilation failed"
51 fi
52
53 if [ "${SRC_TEST}" == "do" ]; then
54 perl-module_src_test || die "test failed"
55 SRC_TEST="done"
56 fi
26} 57}
27 58
28base_src_install() { 59perl-module_src_test() {
60 if [ "${style}" == "builder" ]; then
61 perl ${S}/Build test
62 else
63 make test
64 fi
29 65
66}
67
68perl-module_src_install() {
69
70 perlinfo
30 dodir ${POD_DIR} 71 dodir ${POD_DIR}
31 72
73 test -z ${mytargets} && mytargets="install"
74 eval `perl '-V:installsitearch'`
75 SITE_ARCH=${installsitearch}
76 eval `perl '-V:installarchlib'`
77 ARCH_LIB=${installarchlib}
78
79 if [ "${style}" == "builder" ]; then
80 perl ${S}/Build install
81 else
82 if [ "${MMSIXELEVEN}" ]; then
83 make ${myinst} ${mytargets} || die
84 else
32 make \ 85 make \
33 PREFIX=${D}/usr \ 86 PREFIX=${D}/usr \
34 INSTALLMAN1DIR=${D}/usr/share/man/man1 \ 87 INSTALLMAN1DIR=${D}/usr/share/man/man1 \
35 INSTALLMAN2DIR=${D}/usr/share/man/man2 \ 88 INSTALLMAN2DIR=${D}/usr/share/man/man2 \
36 INSTALLMAN3DIR=${D}/usr/share/man/man3 \ 89 INSTALLMAN3DIR=${D}/usr/share/man/man3 \
37 INSTALLMAN4DIR=${D}/usr/share/man/man4 \ 90 INSTALLMAN4DIR=${D}/usr/share/man/man4 \
38 INSTALLMAN5DIR=${D}/usr/share/man/man5 \ 91 INSTALLMAN5DIR=${D}/usr/share/man/man5 \
39 INSTALLMAN6DIR=${D}/usr/share/man/man6 \ 92 INSTALLMAN6DIR=${D}/usr/share/man/man6 \
40 INSTALLMAN7DIR=${D}/usr/share/man/man7 \ 93 INSTALLMAN7DIR=${D}/usr/share/man/man7 \
41 INSTALLMAN8DIR=${D}/usr/share/man/man8 \ 94 INSTALLMAN8DIR=${D}/usr/share/man/man8 \
95 INSTALLSITEMAN1DIR=${D}/usr/share/man/man1 \
96 INSTALLSITEMAN2DIR=${D}/usr/share/man/man2 \
97 INSTALLSITEMAN3DIR=${D}/usr/share/man/man3 \
98 INSTALLSITEMAN4DIR=${D}/usr/share/man/man4 \
99 INSTALLSITEMAN5DIR=${D}/usr/share/man/man5 \
100 INSTALLSITEMAN6DIR=${D}/usr/share/man/man6 \
101 INSTALLSITEMAN7DIR=${D}/usr/share/man/man7 \
102 INSTALLSITEMAN8DIR=${D}/usr/share/man/man8 \
103 INSTALLVENDORMAN3DIR=${D}/usr/share/man/man3 \
104 INSTALLSITEARCH=${D}/${SITE_ARCH} \
105 INSTALLSCRIPT=${D}/usr/bin \
42 ${myinst} \ 106 ${myinst} \
43 install || die 107 ${mytargets} || die
108 fi
109 fi
44 110
111 if [ -f ${D}${ARCH_LIB}/perllocal.pod ];
112 then
113 touch ${D}/${POD_DIR}/${P}.pod
45 sed -e "s:${D}::g" \ 114 sed -e "s:${D}::g" \
115 ${D}${ARCH_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
116 touch ${D}/${POD_DIR}/${P}.pod.arch
117 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.arch
46 ${D}/${ARCH_LIB}/perllocal.pod \ 118 rm -f ${D}/${ARCH_LIB}/perllocal.pod
47 > ${D}/${POD_DIR}/${P}.pod 119 fi
48 120
121 if [ -f ${D}${SITE_LIB}/perllocal.pod ];
122 then
123 touch ${D}/${POD_DIR}/${P}.pod
124 sed -e "s:${D}::g" \
125 ${D}${SITE_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
126 touch ${D}/${POD_DIR}/${P}.pod.site
127 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site
49 rm -f ${D}/${ARCH_LIB}/perllocal.pod 128 rm -f ${D}/${SITE_LIB}/perllocal.pod
129 fi
50 130
131 for FILE in `find ${D} -type f -name "*.html" -o -name ".packlist"`; do
132 sed -i -e "s:${D}:/:g" ${FILE}
133 done
134
51 dodoc Change* MANIFEST README* ${mydoc} 135 for doc in Change* MANIFEST* README*; do
136 [ -s "$doc" ] && dodoc $doc
137 done
138 dodoc ${mydoc}
52} 139}
140
141
142perl-module_pkg_setup() {
143
144 perlinfo
145}
146
147
148perl-module_pkg_preinst() {
149
150 perlinfo
151}
152
153perl-module_pkg_postinst() {
154
155 updatepod
156}
157
158perl-module_pkg_prerm() {
159
160 updatepod
161}
162
163perl-module_pkg_postrm() {
164
165 updatepod
166}
167
168perlinfo() {
169
170 if [ -f /usr/bin/perl ]
171 then
172 eval `perl '-V:installarchlib'`
173 eval `perl '-V:installsitearch'`
174 ARCH_LIB=${installarchlib}
175 SITE_LIB=${installsitearch}
176
177 eval `perl '-V:version'`
178 POD_DIR="/usr/share/perl/gentoo-pods/${version}"
179 fi
180
181}
182
183updatepod() {
184 perlinfo
185
186 if [ -d "${POD_DIR}" ]
187 then
188 for FILE in `find ${POD_DIR} -type f -name "*.pod.arch"`; do
189 cat ${FILE} >> ${ARCH_LIB}/perllocal.pod
190 rm -f ${FILE}
191 done
192 for FILE in `find ${POD_DIR} -type f -name "*.pod.site"`; do
193 cat ${FILE} >> ${SITE_LIB}/perllocal.pod
194 rm -f ${FILE}
195 done
196 fi
197}

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.55

  ViewVC Help
Powered by ViewVC 1.1.20