| 1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 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.60 2004/05/01 22:03:12 rac Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.65 2004/10/01 21:32:07 mcummings 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 | # Maintained by the Perl herd <perl@gentoo.org> |
| 7 | # |
7 | # |
| 8 | # 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 |
| … | |
… | |
| 13 | |
13 | |
| 14 | EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \ |
14 | EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm \ |
| 15 | src_compile src_install src_test \ |
15 | src_compile src_install src_test \ |
| 16 | perlinfo updatepod |
16 | perlinfo updatepod |
| 17 | |
17 | |
|
|
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. |
|
|
25 | # |
|
|
26 | # 2004.05.25 rac |
|
|
27 | # for the same reasons, make the perl dep >=5.8.2 to get everybody |
|
|
28 | # with 5.8.0 and its 6.03 makemaker up to a version that can |
|
|
29 | # understand DESTDIR |
|
|
30 | # |
|
|
31 | # 2004.10.01 mcummings |
|
|
32 | # noticed a discrepancy in how we were sed fixing references to ${D} |
| 18 | |
33 | |
| 19 | DEPEND="dev-lang/perl" |
34 | DEPEND=">=dev-lang/perl-5.8.2 !<dev-perl/ExtUtils-MakeMaker-6.17" |
| 20 | SRC_PREP="no" |
35 | SRC_PREP="no" |
| 21 | SRC_TEST="skip" |
36 | SRC_TEST="skip" |
| 22 | |
37 | |
| 23 | PERL_VERSION="" |
38 | PERL_VERSION="" |
| 24 | SITE_ARCH="" |
39 | SITE_ARCH="" |
| 25 | SITE_LIB="" |
40 | SITE_LIB="" |
|
|
41 | VENDOR_LIB="" |
|
|
42 | VENDOR_ARCH="" |
| 26 | ARCH_LIB="" |
43 | ARCH_LIB="" |
| 27 | POD_DIR="" |
44 | POD_DIR="" |
| 28 | |
45 | |
| 29 | perl-module_src_prep() { |
46 | perl-module_src_prep() { |
| 30 | |
47 | |
| 31 | perlinfo |
48 | perlinfo |
|
|
49 | |
|
|
50 | export PERL_MM_USE_DEFAULT=1 |
| 32 | |
51 | |
| 33 | SRC_PREP="yes" |
52 | SRC_PREP="yes" |
| 34 | if [ "${style}" == "builder" ]; then |
53 | if [ "${style}" == "builder" ]; then |
| 35 | perl ${S}/Build.PL installdirs=vendor destdir=${D} |
54 | perl ${S}/Build.PL installdirs=vendor destdir=${D} |
| 36 | else |
55 | else |
| … | |
… | |
| 91 | touch ${D}/${POD_DIR}/${P}.pod.site |
110 | touch ${D}/${POD_DIR}/${P}.pod.site |
| 92 | cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site |
111 | cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.site |
| 93 | rm -f ${D}/${SITE_LIB}/perllocal.pod |
112 | rm -f ${D}/${SITE_LIB}/perllocal.pod |
| 94 | fi |
113 | fi |
| 95 | |
114 | |
| 96 | for FILE in `find ${D} -type f -name "*.html" -o -name ".packlist"`; do |
115 | if [ -f ${D}${VENDOR_LIB}/perllocal.pod ]; |
|
|
116 | then |
|
|
117 | touch ${D}/${POD_DIR}/${P}.pod |
|
|
118 | sed -e "s:${D}::g" \ |
|
|
119 | ${D}${VENDOR_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod |
|
|
120 | touch ${D}/${POD_DIR}/${P}.pod.vendor |
|
|
121 | cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.vendor |
|
|
122 | rm -f ${D}/${VENDOR_LIB}/perllocal.pod |
|
|
123 | fi |
|
|
124 | |
|
|
125 | |
|
|
126 | for FILE in `find ${D} -type f |grep -v '.so'`; do |
|
|
127 | STAT=`file $FILE| grep -i " text"` |
|
|
128 | if [ "${STAT}x" != "x" ]; then |
| 97 | sed -i -e "s:${D}:/:g" ${FILE} |
129 | sed -i -e "s:${D}:/:g" ${FILE} |
|
|
130 | fi |
| 98 | done |
131 | done |
| 99 | |
132 | |
| 100 | for doc in Change* MANIFEST* README*; do |
133 | for doc in Change* MANIFEST* README*; do |
| 101 | [ -s "$doc" ] && dodoc $doc |
134 | [ -s "$doc" ] && dodoc $doc |
| 102 | done |
135 | done |
| … | |
… | |
| 130 | updatepod |
163 | updatepod |
| 131 | } |
164 | } |
| 132 | |
165 | |
| 133 | perlinfo() { |
166 | perlinfo() { |
| 134 | |
167 | |
|
|
168 | eval `perl '-V:version'` |
|
|
169 | PERL_VERSION=${version} |
|
|
170 | |
|
|
171 | eval `perl '-V:installsitearch'` |
|
|
172 | SITE_ARCH=${installsitearch} |
|
|
173 | |
|
|
174 | eval `perl '-V:installsitearch'` |
|
|
175 | SITE_LIB=${installsitearch} |
|
|
176 | |
|
|
177 | eval `perl '-V:installarchlib'` |
|
|
178 | ARCH_LIB=${installarchlib} |
|
|
179 | |
|
|
180 | eval `perl '-V:installvendorlib'` |
|
|
181 | VENDOR_LIB=${installvendorlib} |
|
|
182 | |
|
|
183 | eval `perl '-V:installvendorarch'` |
|
|
184 | VENDOR_ARCH=${installvendorarch} |
|
|
185 | |
| 135 | if [ -f /usr/bin/perl ] |
186 | if [ -f /usr/bin/perl ] |
| 136 | then |
187 | then |
| 137 | POD_DIR="/usr/share/perl/gentoo-pods/${version}" |
188 | POD_DIR="/usr/share/perl/gentoo-pods/${version}" |
| 138 | fi |
189 | fi |
| 139 | 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 | } |
190 | } |
| 150 | |
191 | |
| 151 | updatepod() { |
192 | updatepod() { |
| 152 | perlinfo |
193 | perlinfo |
| 153 | |
194 | |
| … | |
… | |
| 159 | done |
200 | done |
| 160 | for FILE in `find ${POD_DIR} -type f -name "*.pod.site"`; do |
201 | for FILE in `find ${POD_DIR} -type f -name "*.pod.site"`; do |
| 161 | cat ${FILE} >> ${SITE_LIB}/perllocal.pod |
202 | cat ${FILE} >> ${SITE_LIB}/perllocal.pod |
| 162 | rm -f ${FILE} |
203 | rm -f ${FILE} |
| 163 | done |
204 | done |
|
|
205 | for FILE in `find ${POD_DIR} -type f -name "*.pod.vendor"`; do |
|
|
206 | cat ${FILE} >> ${VENDOR_LIB}/perllocal.pod |
|
|
207 | rm -f ${FILE} |
|
|
208 | done |
| 164 | fi |
209 | fi |
| 165 | } |
210 | } |