Annotation of /branches/R11-stable/include/perl.sminc
Parent Directory | Revision Log
Revision 6654 -
(hide annotations)
(download)
Tue Sep 14 16:46:32 2010 UTC (14 years, 2 months ago) by niro
Original Path: branches/magellan-next/include/perl.sminc
File size: 3261 byte(s)
Tue Sep 14 16:46:32 2010 UTC (14 years, 2 months ago) by niro
Original Path: branches/magellan-next/include/perl.sminc
File size: 3261 byte(s)
imported from trunk
1 | niro | 2 | # $Header: /magellan-cvs/smage/include/perl.sminc,v 1.15 2007-06-15 22:06:59 niro Exp $ |
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_src_compile() | ||
91 | { | ||
92 | cd ${SRCDIR} | ||
93 | |||
94 | perlinfo | ||
95 | |||
96 | export PERL_MM_USE_DEFAULT=1 | ||
97 | export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" | ||
98 | |||
99 | local configure_opts="$@" | ||
100 | |||
101 | if [[ -f Build.PL ]] | ||
102 | then | ||
103 | perl Build.PL \ | ||
104 | --installdirs=vendor \ | ||
105 | --destdir=${BINDIR} \ | ||
106 | --libdoc= \ | ||
107 | || die | ||
108 | perl Build build || die | ||
109 | |||
110 | elif [[ -f Makefile.PL ]] | ||
111 | then | ||
112 | perl Makefile.PL \ | ||
113 | ${configure_opts} \ | ||
114 | PREFIX=/usr \ | ||
115 | INSTALLMAN3DIR='none' \ | ||
116 | INSTALLDIRS=vendor \ | ||
117 | DESTDIR=${BINDIR} \ | ||
118 | || die | ||
119 | make || die | ||
120 | else | ||
121 | die "No buildscript detected!" | ||
122 | fi | ||
123 | |||
124 | fixlocalpod | ||
125 | } | ||
126 | |||
127 | perl_src_install() | ||
128 | { | ||
129 | niro | 4233 | cd ${SRCDIR} |
130 | |||
131 | niro | 2 | local i |
132 | local stat | ||
133 | |||
134 | perlinfo | ||
135 | |||
136 | if [[ -f Makefile ]] | ||
137 | then | ||
138 | make install || die | ||
139 | elif [[ -f Build ]] | ||
140 | then | ||
141 | perl ${SRCDIR}/Build install || die | ||
142 | else | ||
143 | die "No installscript detected!" | ||
144 | fi | ||
145 | |||
146 | # clean manfiles | ||
147 | for i in $(find ${BINDIR} -type f -name "*.3pm*") | ||
148 | do | ||
149 | rm ${i} || die | ||
150 | done | ||
151 | find ${BINDIR}/usr/share/man -depth -type d 2>/dev/null | xargs -r rmdir 2>/dev/null | ||
152 | |||
153 | # remove local podfiles | ||
154 | fixlocalpod | ||
155 | |||
156 | # remove BINDIR from text so files | ||
157 | for i in $(find ${BINDIR} -type f | grep -v '.so') | ||
158 | do | ||
159 | stat=$(file ${i} | grep -i " text") | ||
160 | if [[ ${stat}x != x ]] | ||
161 | then | ||
162 | sed -i "s:${BINDIR}:/:g" ${i} || die | ||
163 | fi | ||
164 | done | ||
165 | |||
166 | local i | ||
167 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
168 | FAQ LICENSE NEWS README TODO | ||
169 | do | ||
170 | if [ -f ${SRCDIR}/${i} ] | ||
171 | then | ||
172 | minstalldocs ${i} || die | ||
173 | fi | ||
174 | done | ||
175 | } | ||
176 | |||
177 | |||
178 | export_inherits perl src_prepare src_compile src_install |