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

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.60 - (hide annotations) (download)
Sat May 1 22:03:12 2004 UTC (9 years, 11 months ago) by rac
Branch: MAIN
Changes since 1.59: +6 -40 lines
Add a perlinfo to src_prep and retire support for MakeMakers older
than 6.11.  Should also address bug 48052 in two different ways.

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.60 # $Header: /home/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.59 2004/04/02 10:54:58 mcummings 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 mcummings 1.57
19 mcummings 1.59 DEPEND="dev-lang/perl"
20 azarah 1.11 SRC_PREP="no"
21 rac 1.55 SRC_TEST="skip"
22 azarah 1.11
23 mcummings 1.57 PERL_VERSION=""
24     SITE_ARCH=""
25 seemant 1.35 SITE_LIB=""
26     ARCH_LIB=""
27     POD_DIR=""
28    
29 aliz 1.15 perl-module_src_prep() {
30 rac 1.60
31     perlinfo
32    
33 azarah 1.11 SRC_PREP="yes"
34 mcummings 1.43 if [ "${style}" == "builder" ]; then
35 rac 1.48 perl ${S}/Build.PL installdirs=vendor destdir=${D}
36 mcummings 1.43 else
37 rac 1.60 perl Makefile.PL ${myconf} \
38     PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D}
39 mcummings 1.43 fi
40 azarah 1.11 }
41    
42 aliz 1.15 perl-module_src_compile() {
43 seemant 1.6
44 aliz 1.15 [ "${SRC_PREP}" != "yes" ] && perl-module_src_prep
45 mcummings 1.43 if [ "${style}" != "builder" ]; then
46     make ${mymake} || die "compilation failed"
47     fi
48    
49 rac 1.55 if [ "${SRC_TEST}" == "do" ]; then
50     perl-module_src_test || die "test failed"
51     SRC_TEST="done"
52     fi
53 seemant 1.8 }
54    
55 aliz 1.15 perl-module_src_test() {
56 mcummings 1.43 if [ "${style}" == "builder" ]; then
57     perl ${S}/Build test
58     else
59     make test
60     fi
61 seemant 1.1 }
62    
63 aliz 1.15 perl-module_src_install() {
64 seemant 1.12
65 seemant 1.35 perlinfo
66 seemant 1.1 dodir ${POD_DIR}
67    
68 seemant 1.9 test -z ${mytargets} && mytargets="install"
69 mcummings 1.31
70 mcummings 1.43 if [ "${style}" == "builder" ]; then
71     perl ${S}/Build install
72     else
73 rac 1.51 make ${myinst} ${mytargets} || die
74 mcummings 1.43 fi
75 mcummings 1.20
76     if [ -f ${D}${ARCH_LIB}/perllocal.pod ];
77     then
78 seemant 1.27 touch ${D}/${POD_DIR}/${P}.pod
79     sed -e "s:${D}::g" \
80     ${D}${ARCH_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
81     touch ${D}/${POD_DIR}/${P}.pod.arch
82     cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.arch
83     rm -f ${D}/${ARCH_LIB}/perllocal.pod
84 mcummings 1.20 fi
85 seemant 1.1
86 mcummings 1.20 if [ -f ${D}${SITE_LIB}/perllocal.pod ];
87     then
88 seemant 1.27 touch ${D}/${POD_DIR}/${P}.pod
89     sed -e "s:${D}::g" \
90     ${D}${SITE_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
91     touch ${D}/${POD_DIR}/${P}.pod.site
92     cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site
93     rm -f ${D}/${SITE_LIB}/perllocal.pod
94 mcummings 1.20 fi
95 mcummings 1.38
96     for FILE in `find ${D} -type f -name "*.html" -o -name ".packlist"`; do
97 mcummings 1.42 sed -i -e "s:${D}:/:g" ${FILE}
98 mcummings 1.38 done
99 seemant 1.1
100 lanius 1.53 for doc in Change* MANIFEST* README*; do
101     [ -s "$doc" ] && dodoc $doc
102     done
103     dodoc ${mydoc}
104 seemant 1.35 }
105    
106    
107     perl-module_pkg_setup() {
108    
109     perlinfo
110     }
111    
112    
113     perl-module_pkg_preinst() {
114    
115     perlinfo
116     }
117    
118     perl-module_pkg_postinst() {
119    
120     updatepod
121     }
122    
123     perl-module_pkg_prerm() {
124    
125     updatepod
126     }
127    
128     perl-module_pkg_postrm() {
129    
130     updatepod
131     }
132    
133     perlinfo() {
134    
135     if [ -f /usr/bin/perl ]
136     then
137     POD_DIR="/usr/share/perl/gentoo-pods/${version}"
138     fi
139 mcummings 1.58 eval `perl '-V:version'`
140     PERL_VERSION=${version}
141     eval `perl '-V:installsitearch'`
142     SITE_ARCH=${installsitearch}
143     eval `perl '-V:installarchlib'`
144     ARCH_LIB=${installarchlib}
145     eval `perl '-V:installarchlib'`
146     ARCH_LIB=${installarchlib}
147     eval `perl '-V:installsitearch'`
148     SITE_LIB=${installsitearch}
149 seemant 1.35 }
150    
151     updatepod() {
152     perlinfo
153    
154     if [ -d "${POD_DIR}" ]
155     then
156     for FILE in `find ${POD_DIR} -type f -name "*.pod.arch"`; do
157     cat ${FILE} >> ${ARCH_LIB}/perllocal.pod
158     rm -f ${FILE}
159     done
160     for FILE in `find ${POD_DIR} -type f -name "*.pod.site"`; do
161     cat ${FILE} >> ${SITE_LIB}/perllocal.pod
162     rm -f ${FILE}
163     done
164     fi
165 seemant 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20