/[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.65 Revision 1.66
1# Copyright 1999-2004 Gentoo Foundation 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.65 2004/10/01 21:32:07 mcummings Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.66 2005/03/14 15:09:14 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
28# with 5.8.0 and its 6.03 makemaker up to a version that can 28# with 5.8.0 and its 6.03 makemaker up to a version that can
29# understand DESTDIR 29# understand DESTDIR
30# 30#
31# 2004.10.01 mcummings 31# 2004.10.01 mcummings
32# noticed a discrepancy in how we were sed fixing references to ${D} 32# noticed a discrepancy in how we were sed fixing references to ${D}
33#
34# 2005.03.14 mcummings
35# Updated eclass to include a specific function for dealing with perlocal.pods -
36# this should avoid the conflicts we've been running into with the introduction
37# of file collision features by giving us a single exportable function to deal
38# with the pods. Modifications to the eclass provided by Yaakov S
39# <yselkowitz@hotmail.com> in bug 83622
40
33 41
34DEPEND=">=dev-lang/perl-5.8.2 !<dev-perl/ExtUtils-MakeMaker-6.17" 42DEPEND=">=dev-lang/perl-5.8.2 !<dev-perl/ExtUtils-MakeMaker-6.17"
35SRC_PREP="no" 43SRC_PREP="no"
36SRC_TEST="skip" 44SRC_TEST="skip"
37 45
80} 88}
81 89
82perl-module_src_install() { 90perl-module_src_install() {
83 91
84 perlinfo 92 perlinfo
85 dodir ${POD_DIR}
86 93
87 test -z ${mytargets} && mytargets="install" 94 test -z ${mytargets} && mytargets="install"
88 95
89 if [ "${style}" == "builder" ]; then 96 if [ "${style}" == "builder" ]; then
90 perl ${S}/Build install 97 perl ${S}/Build install
91 else 98 else
92 make ${myinst} ${mytargets} || die 99 make ${myinst} ${mytargets} || die
93 fi 100 fi
101
102 fixlocalpod
103
104 for FILE in `find ${D} -type f |grep -v '.so'`; do
105 STAT=`file $FILE| grep -i " text"`
106 if [ "${STAT}x" != "x" ]; then
107 sed -i -e "s:${D}:/:g" ${FILE}
108 fi
109 done
110
111 for doc in Change* MANIFEST* README*; do
112 [ -s "$doc" ] && dodoc $doc
113 done
114 dodoc ${mydoc}
115}
116
117
118perl-module_pkg_setup() {
119
120 perlinfo
121}
122
123
124perl-module_pkg_preinst() {
125
126 perlinfo
127}
128
129perl-module_pkg_postinst() {
130
131 updatepod
132}
133
134perl-module_pkg_prerm() {
135
136 updatepod
137}
138
139perl-module_pkg_postrm() {
140
141 updatepod
142}
143
144perlinfo() {
145
146 eval `perl '-V:version'`
147 PERL_VERSION=${version}
148
149 eval `perl '-V:installsitearch'`
150 SITE_ARCH=${installsitearch}
151
152 eval `perl '-V:installsitearch'`
153 SITE_LIB=${installsitearch}
154
155 eval `perl '-V:installarchlib'`
156 ARCH_LIB=${installarchlib}
157
158 eval `perl '-V:installvendorlib'`
159 VENDOR_LIB=${installvendorlib}
160
161 eval `perl '-V:installvendorarch'`
162 VENDOR_ARCH=${installvendorarch}
163
164 if [ -f /usr/bin/perl ]
165 then
166 POD_DIR="/usr/share/perl/gentoo-pods/${version}"
167 fi
168}
169
170fixlocalpod() {
171 perlinfo
172 dodir ${POD_DIR}
94 173
95 if [ -f ${D}${ARCH_LIB}/perllocal.pod ]; 174 if [ -f ${D}${ARCH_LIB}/perllocal.pod ];
96 then 175 then
97 touch ${D}/${POD_DIR}/${P}.pod 176 touch ${D}/${POD_DIR}/${P}.pod
98 sed -e "s:${D}::g" \ 177 sed -e "s:${D}::g" \
118 sed -e "s:${D}::g" \ 197 sed -e "s:${D}::g" \
119 ${D}${VENDOR_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod 198 ${D}${VENDOR_LIB}/perllocal.pod >> ${D}/${POD_DIR}/${P}.pod
120 touch ${D}/${POD_DIR}/${P}.pod.vendor 199 touch ${D}/${POD_DIR}/${P}.pod.vendor
121 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.vendor 200 cat ${D}/${POD_DIR}/${P}.pod >>${D}/${POD_DIR}/${P}.pod.vendor
122 rm -f ${D}/${VENDOR_LIB}/perllocal.pod 201 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
129 sed -i -e "s:${D}:/:g" ${FILE}
130 fi
131 done
132
133 for doc in Change* MANIFEST* README*; do
134 [ -s "$doc" ] && dodoc $doc
135 done
136 dodoc ${mydoc}
137}
138
139
140perl-module_pkg_setup() {
141
142 perlinfo
143}
144
145
146perl-module_pkg_preinst() {
147
148 perlinfo
149}
150
151perl-module_pkg_postinst() {
152
153 updatepod
154}
155
156perl-module_pkg_prerm() {
157
158 updatepod
159}
160
161perl-module_pkg_postrm() {
162
163 updatepod
164}
165
166perlinfo() {
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
186 if [ -f /usr/bin/perl ]
187 then
188 POD_DIR="/usr/share/perl/gentoo-pods/${version}"
189 fi 202 fi
190} 203}
191 204
192updatepod() { 205updatepod() {
193 perlinfo 206 perlinfo

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.20