Magellan Linux

Annotation of /trunk/include/perl.sminc

Parent Directory Parent Directory | Revision Log Revision Log


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