Contents of /trunk/include/perl.sminc
Parent Directory | Revision Log
Revision 11546 -
(show annotations)
(download)
Mon Mar 12 21:03:38 2012 UTC (12 years, 6 months ago) by niro
File size: 3823 byte(s)
Mon Mar 12 21:03:38 2012 UTC (12 years, 6 months ago) by niro
File size: 3823 byte(s)
-fixed typos
1 | # $Id$ |
2 | |
3 | # inherits {pre,post}install() and {pre,post}remove() to mage file |
4 | INHERITS="${INHERITS} perl" |
5 | |
6 | # taken from gentoo eclass perm-module.eclass |
7 | perlinfo() |
8 | { |
9 | if [ -f /usr/bin/perl ] |
10 | then |
11 | POD_DIR="/usr/share/perl/magellan-pods/${version}" |
12 | fi |
13 | |
14 | eval $(perl '-V:version') |
15 | PERL_VERSION=${version} |
16 | |
17 | eval $(perl '-V:installsitearch') |
18 | SITE_ARCH=${installsitearch} |
19 | |
20 | eval $(perl '-V:installarchlib') |
21 | ARCH_LIB=${installarchlib} |
22 | |
23 | eval $(perl '-V:installsitearch') |
24 | SITE_LIB=${installsitearch} |
25 | |
26 | local installvendorlib |
27 | eval $(perl '-V:installvendorlib') |
28 | VENDOR_LIB=${installvendorlib} |
29 | |
30 | local installvendorarch |
31 | eval $(perl '-V:installvendorarch') |
32 | VENDOR_ARCH=${installvendorarch} |
33 | |
34 | # handling of DESTDIR changed in makemaker 6.11 |
35 | MMSIXELEVEN=$(perl -e 'use ExtUtils::MakeMaker; print( $ExtUtils::MakeMaker::VERSION ge "6.11" )') |
36 | } |
37 | |
38 | # taken from gentoo eclass perl-module.eclass |
39 | updatepod() |
40 | { |
41 | local i |
42 | |
43 | perlinfo |
44 | |
45 | if [ -d "${POD_DIR}" ] |
46 | then |
47 | for i in $(find ${POD_DIR} -type f -name "*.pod.arch") |
48 | do |
49 | cat ${i} >> ${ARCH_LIB}/perllocal.pod |
50 | rm -f ${i} |
51 | done |
52 | for i in $(find ${POD_DIR} -type f -name "*.pod.site") |
53 | do |
54 | cat ${i} >> ${SITE_LIB}/perllocal.pod |
55 | rm -f ${i} |
56 | done |
57 | for i in $(find ${POD_DIR} -type f -name "*.pod.vendor") |
58 | do |
59 | cat ${i} >> ${VENDOR_LIB}/perllocal.pod |
60 | rm -f ${i} |
61 | done |
62 | fi |
63 | } |
64 | |
65 | fixlocalpod() |
66 | { |
67 | perlinfo |
68 | |
69 | if [ -f ${BINDIR}${ARCH_LIB}/perllocal.pod ] |
70 | then |
71 | rm -f ${BINDIR}/${ARCH_LIB}/perllocal.pod |
72 | fi |
73 | |
74 | if [ -f ${BINDIR}${SITE_LIB}/perllocal.pod ] |
75 | then |
76 | rm -f ${BINDIR}/${SITE_LIB}/perllocal.pod |
77 | fi |
78 | |
79 | if [ -f ${BINDIR}${VENDOR_LIB}/perllocal.pod ] |
80 | then |
81 | rm -f ${BINDIR}/${VENDOR_LIB}/perllocal.pod |
82 | fi |
83 | } |
84 | |
85 | perl_src_prepare() |
86 | { |
87 | munpack ${SRCFILE} || die |
88 | } |
89 | |
90 | perl_run_src_compile() |
91 | { |
92 | perlinfo |
93 | |
94 | export PERL_MM_USE_DEFAULT=1 |
95 | export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" |
96 | |
97 | local configure_opts="$@" |
98 | |
99 | if [[ -f Build.PL ]] |
100 | then |
101 | perl Build.PL \ |
102 | --installdirs=vendor \ |
103 | --destdir=${BINDIR} \ |
104 | --libdoc= \ |
105 | || die |
106 | perl Build build || die |
107 | |
108 | elif [[ -f Makefile.PL ]] |
109 | then |
110 | perl Makefile.PL \ |
111 | ${configure_opts} \ |
112 | PREFIX=/usr \ |
113 | INSTALLMAN3DIR='none' \ |
114 | INSTALLDIRS=vendor \ |
115 | DESTDIR=${BINDIR} \ |
116 | || die |
117 | make || die |
118 | else |
119 | die "No buildscript detected!" |
120 | fi |
121 | |
122 | fixlocalpod |
123 | } |
124 | |
125 | perl_src_compile() |
126 | { |
127 | cd ${SRCDIR} |
128 | perl_run_src_compile $@ || die |
129 | } |
130 | |
131 | perl_src_compile_multilib() |
132 | { |
133 | local abi |
134 | for abi in ${MULTILIB_ABIS} |
135 | do |
136 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
137 | perl_run_src_compile $@ || die |
138 | done |
139 | } |
140 | |
141 | perl_run_src_install() |
142 | { |
143 | local i |
144 | local stat |
145 | |
146 | perlinfo |
147 | |
148 | if [[ -f Makefile ]] |
149 | then |
150 | make install || die |
151 | elif [[ -f Build ]] |
152 | then |
153 | perl ${SRCDIR}/Build install || die |
154 | else |
155 | die "No installscript detected!" |
156 | fi |
157 | |
158 | # clean manfiles |
159 | for i in $(find ${BINDIR} -type f -name "*.3pm*") |
160 | do |
161 | rm ${i} || die |
162 | done |
163 | find ${BINDIR}/usr/share/man -depth -type d 2>/dev/null | xargs -r rmdir 2>/dev/null |
164 | |
165 | # remove local podfiles |
166 | fixlocalpod |
167 | |
168 | # remove BINDIR from text so files |
169 | for i in $(find ${BINDIR} -type f | grep -v '.so') |
170 | do |
171 | stat=$(file ${i} | grep -i " text") |
172 | if [[ ${stat}x != x ]] |
173 | then |
174 | sed -i "s:${BINDIR}:/:g" ${i} || die |
175 | fi |
176 | done |
177 | |
178 | local i |
179 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
180 | FAQ LICENSE NEWS README TODO |
181 | do |
182 | if [ -f ${SRCDIR}/${i} ] |
183 | then |
184 | minstalldocs ${i} || die |
185 | fi |
186 | done |
187 | } |
188 | |
189 | perl_src_compile() |
190 | { |
191 | cd ${SRCDIR} |
192 | perl_run_src_compile $@ || die |
193 | } |
194 | |
195 | perl_src_compile_multilib() |
196 | { |
197 | local abi |
198 | local saved_SRCDIR="${SRCDIR}" |
199 | |
200 | for abi in ${MULTILIB_ABIS} |
201 | do |
202 | export SRCDIR="${saved_SRCDIR}-${abi}/${SRCSUBDIR}" |
203 | cd ${SRCDIR} |
204 | perl_run_src_compile $@ || die |
205 | done |
206 | export SRCDIR="${saved_SRCDIR}" |
207 | } |
208 | |
209 | if [[ ${MULTILIB_BUILD} = true ]] |
210 | then |
211 | export_inherits perl src_prepare src_compile_multilib src_install_multilib |
212 | else |
213 | export_inherits perl src_prepare src_compile src_install |
214 | fi |