/[gentoo-x86]/eclass/perl-module.eclass
Gentoo

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.61 - (hide annotations) (download)
Mon May 10 21:10:50 2004 UTC (10 years, 5 months ago) by rac
Branch: MAIN
Changes since 1.60: +9 -2 lines
Block on <MakeMaker6.17

1 mcummings 1.57 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 vapier 1.30 # Distributed under the terms of the GNU General Public License v2
3 rac 1.61 # $Header: /home/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.60 2004/05/01 22:03:12 rac Exp $
4 vapier 1.33 #
5 seemant 1.1 # Author: Seemant Kulleen <seemant@gentoo.org>
6 mcummings 1.57 # Maintained by the Perl herd <perl@gentoo.org>
7 vapier 1.33 #
8 seemant 1.1 # The perl-module eclass is designed to allow easier installation of perl
9     # modules, and their incorporation into the Gentoo Linux system.
10 seemant 1.3
11 danarmak 1.14 ECLASS=perl-module
12 seemant 1.35 INHERITED="${INHERITED} ${ECLASS}"
13 danarmak 1.13
14 seemant 1.35 EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \
15 seemant 1.37 src_compile src_install src_test \
16     perlinfo updatepod
17 seemant 1.1
18 rac 1.61 # 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 mcummings 1.57
26 rac 1.61 DEPEND="dev-lang/perl !<dev-perl/ExtUtils-MakeMaker-6.17"
27 azarah 1.11 SRC_PREP="no"
28 rac 1.55 SRC_TEST="skip"
29 azarah 1.11
30 mcummings 1.57 PERL_VERSION=""
31     SITE_ARCH=""
32 seemant 1.35 SITE_LIB=""
33     ARCH_LIB=""
34     POD_DIR=""
35    
36 aliz 1.15 perl-module_src_prep() {
37 rac 1.60
38     perlinfo
39    
40 azarah 1.11 SRC_PREP="yes"
41 mcummings 1.43 if [ "${style}" == "builder" ]; then
42 rac 1.48 perl ${S}/Build.PL installdirs=vendor destdir=${D}
43 mcummings 1.43 else
44 rac 1.60 perl Makefile.PL ${myconf} \
45     PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D}
46 mcummings 1.43 fi
47 azarah 1.11 }
48    
49 aliz 1.15 perl-module_src_compile() {
50 seemant 1.6
51 aliz 1.15 [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep
52 mcummings 1.43 if [ "${style}" != "builder" ]; then
53     make ${mymake} || die "compilation failed"
54     fi
55    
56 rac 1.55 if [ "${SRC_TEST}" == "do" ]; then
57     perl-module_src_test || die "test failed"
58     SRC_TEST="done"
59     fi
60 seemant 1.8 }
61    
62 aliz 1.15 perl-module_src_test() {
63 mcummings 1.43 if [ "${style}" == "builder" ]; then
64     perl ${S}/Build test
65     else
66     make test
67     fi
68 seemant 1.1 }
69    
70 aliz 1.15 perl-module_src_install() {
71 seemant 1.12
72 seemant 1.35 perlinfo
73 seemant 1.1 dodir ${POD_DIR}
74    
75 seemant 1.9 test -z ${mytargets} && mytargets="install"
76 mcummings 1.31
77 mcummings 1.43 if [ "${style}" == "builder" ]; then
78     perl ${S}/Build install
79     else
80 rac 1.51 make ${myinst} ${mytargets} || die
81 mcummings 1.43 fi
82 mcummings 1.20
83     if [ -f ${D}${ARCH_LIB}/perllocal.pod ];
84     then
85 seemant 1.27 touch ${D}/${POD_DIR}/${P}.pod
86     sed -e "s:${D}::g" \
87     ${D}${ARCH_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
88     touch ${D}/${POD_DIR}/${P}.pod.arch
89     cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.arch
90     rm -f ${D}/${ARCH_LIB}/perllocal.pod
91 mcummings 1.20 fi
92 seemant 1.1
93 mcummings 1.20 if [ -f ${D}${SITE_LIB}/perllocal.pod ];
94     then
95 seemant 1.27 touch ${D}/${POD_DIR}/${P}.pod
96     sed -e "s:${D}::g" \
97     ${D}${SITE_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
98     touch ${D}/${POD_DIR}/${P}.pod.site
99     cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site
100     rm -f ${D}/${SITE_LIB}/perllocal.pod
101 mcummings 1.20 fi
102 mcummings 1.38
103     for FILE in `find ${D} -type f -name "*.html" -o -name ".packlist"`; do
104 mcummings 1.42 sed -i -e "s:${D}:/:g" ${FILE}
105 mcummings 1.38 done
106 seemant 1.1
107 lanius 1.53 for doc in Change* MANIFEST* README*; do
108     [ -s "$doc" ] && dodoc $doc
109     done
110     dodoc ${mydoc}
111 seemant 1.35 }
112    
113    
114     perl-module_pkg_setup() {
115    
116     perlinfo
117     }
118    
119    
120     perl-module_pkg_preinst() {
121    
122     perlinfo
123     }
124    
125     perl-module_pkg_postinst() {
126    
127     updatepod
128     }
129    
130     perl-module_pkg_prerm() {
131    
132     updatepod
133     }
134    
135     perl-module_pkg_postrm() {
136    
137     updatepod
138     }
139    
140     perlinfo() {
141    
142     if [ -f /usr/bin/perl ]
143     then
144     POD_DIR="/usr/share/perl/gentoo-pods/${version}"
145     fi
146 mcummings 1.58 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 seemant 1.35 }
157    
158     updatepod() {
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 seemant 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20