Mon, 28 Mar 2011 19:41:02 +0200
Completely rework package including...
Simpify 64-bit -fPIC logic, instruct make to build in parallel,
force error condition on failed profile dependency, build the
standard 'bootstrap' target as suggested, correct grammar, wording,
and punctuation in general, upgrade to latest upstream vendor version,
rearrange package dependencies mpc, mpfr, and gmp, correct buildconf
thanks to new lto-plugin forced, avoid failed platform specific stage
comparison, adjust patch code to reflect new version update, and most
importantly adjust optimization flags to platform. Please note that
block 'correct hardcoded paths' is likely no yet complete.
1 By default, the "vendor" area is not used, so Perl's installation
2 procedure forgot to create its top-level paths, too. In OpenPKG we use
3 the "vendor" area, so make sure it is created the same way the "site"
4 area is.
6 Index: installperl
7 --- installperl.orig 2007-12-18 11:47:07 +0100
8 +++ installperl 2008-03-28 15:23:47 +0100
9 @@ -211,6 +211,8 @@
10 my $installarchlib = "$destdir$Config{installarchlib}";
11 my $installsitelib = "$destdir$Config{installsitelib}";
12 my $installsitearch = "$destdir$Config{installsitearch}";
13 +my $installvendorlib = "$destdir$Config{installvendorlib}";
14 +my $installvendorarch = "$destdir$Config{installvendorarch}";
15 my $installman1dir = "$destdir$Config{installman1dir}";
16 my $man1ext = $Config{man1ext};
17 my $libperl = $Config{libperl};
18 @@ -372,6 +374,8 @@
19 mkpath($installarchlib, $verbose, 0777);
20 mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
21 mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
22 +mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib);
23 +mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch);
25 if (chdir "lib") {
26 $do_installarchlib = ! samepath($installarchlib, '.');
28 -----------------------------------------------------------------------------
30 By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
31 perl, site, vendor, other". This means that in OpenPKG both the modules
32 installed via CPAN shell (in "site" area) and the "perl-xxx" packages
33 (in "vendor" area) cannot override the (sometimes obsoleted) module
34 versions distributed with Perl (in "perl" area). Hence, we change
35 the search order to a more reasonable one for OpenPKG: "use lib, -I,
36 PERL[5]LIB, site, vendor, perl, other".
38 Index: perl.c
39 --- perl.c.orig 2007-12-18 11:47:08 +0100
40 +++ perl.c 2008-03-28 15:23:47 +0100
41 @@ -4753,39 +4753,6 @@
42 incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
43 #endif
45 -#ifdef ARCHLIB_EXP
46 - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
47 -#endif
48 -#ifdef MACOS_TRADITIONAL
49 - {
50 - Stat_t tmpstatbuf;
51 - SV * privdir = newSV(0);
52 - char * macperl = PerlEnv_getenv("MACPERL");
53 -
54 - if (!macperl)
55 - macperl = "";
56 -
57 - Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
58 - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
59 - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
60 - Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
61 - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
62 - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
63 -
64 - SvREFCNT_dec(privdir);
65 - }
66 - if (!PL_tainting)
67 - incpush(":", FALSE, FALSE, TRUE, FALSE);
68 -#else
69 -#ifndef PRIVLIB_EXP
70 -# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
71 -#endif
72 -#if defined(WIN32)
73 - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
74 -#else
75 - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
76 -#endif
77 -
78 #ifdef SITEARCH_EXP
79 /* sitearch is always relative to sitelib on Windows for
80 * DLL-based path intuition to work correctly */
81 @@ -4828,6 +4795,39 @@
82 incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
83 #endif
85 +#ifdef ARCHLIB_EXP
86 + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
87 +#endif
88 +#ifdef MACOS_TRADITIONAL
89 + {
90 + Stat_t tmpstatbuf;
91 + SV * privdir = newSV(0);
92 + char * macperl = PerlEnv_getenv("MACPERL");
93 +
94 + if (!macperl)
95 + macperl = "";
96 +
97 + Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
98 + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
99 + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
100 + Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
101 + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
102 + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
103 +
104 + SvREFCNT_dec(privdir);
105 + }
106 + if (!PL_tainting)
107 + incpush(":", FALSE, FALSE, TRUE, FALSE);
108 +#else
109 +#ifndef PRIVLIB_EXP
110 +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
111 +#endif
112 +#if defined(WIN32)
113 + incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
114 +#else
115 + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
116 +#endif
117 +
118 #ifdef PERL_OTHERLIBDIRS
119 incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);
120 #endif
122 -----------------------------------------------------------------------------
124 Port to [Open]Darwin 6.6.2:
126 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
127 understand "-no-cpp-precomp", so remove this build option.
129 2. The <sys/mman.h> indirectly includes system specific headers
130 which in turn have fields named "environ" while Perl uses
131 a define of "environ" internally. So wrap the inclusion.
133 3. Darwin 6 no longer accepts the non-standard "#import" statements,
134 so replace with "#include" and circumvent some header problem
135 related to the non-standard "__private_extern__" attribute.
137 Index: hints/darwin.sh
138 --- hints/darwin.sh.orig 2007-12-18 11:47:07 +0100
139 +++ hints/darwin.sh 2008-03-28 15:23:47 +0100
140 @@ -120,9 +120,6 @@
141 *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
142 esac
144 -# Avoid Apple's cpp precompiler, better for extensions
145 -cppflags="${cppflags} -no-cpp-precomp"
146 -
147 # This is necessary because perl's build system doesn't
148 # apply cppflags to cc compile lines as it should.
149 ccflags="${ccflags} ${cppflags}"
150 @@ -182,8 +179,7 @@
151 esac
152 ldlibpthname='DYLD_LIBRARY_PATH';
154 -# useshrplib=true results in much slower startup times.
155 -# 'false' is the default value. Use Configure -Duseshrplib to override.
156 +useshrplib='true'
158 cat > UU/archname.cbu <<'EOCBU'
159 # This script UU/archname.cbu will get 'called-back' by Configure
160 Index: perlio.c
161 --- perlio.c.orig 2007-12-18 11:47:08 +0100
162 +++ perlio.c 2008-03-28 15:23:47 +0100
163 @@ -472,7 +472,14 @@
164 #include <unistd.h>
165 #endif
166 #ifdef HAS_MMAP
167 +#ifdef PERL_DARWIN
168 +#define environ_safe environ
169 +#undef environ
170 #include <sys/mman.h>
171 +#define environ environ_safe
172 +#else
173 +#include <sys/mman.h>
174 +#endif
175 #endif
177 void
178 Index: ext/DynaLoader/dl_dyld.xs
179 --- ext/DynaLoader/dl_dyld.xs.orig 2007-12-18 11:47:07 +0100
180 +++ ext/DynaLoader/dl_dyld.xs 2008-03-28 15:23:47 +0100
181 @@ -45,7 +45,13 @@
183 #undef environ
184 #undef bool
185 +#ifdef PERL_DARWIN
186 +#define __private_extern__ extern
187 +#include <mach-o/dyld.h>
188 +#undef __private_extern__
189 +#else
190 #import <mach-o/dyld.h>
191 +#endif
193 static char *dlerror()
194 {
196 -----------------------------------------------------------------------------
198 Port to Tru64 5.1:
200 Under Tru64 our gcc has to be built without binutils and the system
201 ld(1) does not accept a "-O" option, so remove the whole passing of
202 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
203 really don't need any more optimization because we are already happy if
204 it works at all.
206 Index: hints/dec_osf.sh
207 --- hints/dec_osf.sh.orig 2007-12-18 11:47:07 +0100
208 +++ hints/dec_osf.sh 2008-03-28 15:23:47 +0100
209 @@ -73,15 +73,6 @@
210 *) if $test "X$optimize" = "X$undef"; then
211 lddlflags="$lddlflags -msym"
212 else
213 - case "$myosvers" in
214 - *4.0D*)
215 - # QAR 56761: -O4 + .so may produce broken code,
216 - # fixed in 4.0E or better.
217 - ;;
218 - *)
219 - lddlflags="$lddlflags $optimize"
220 - ;;
221 - esac
222 # -msym: If using a sufficiently recent /sbin/loader,
223 # keep the module symbols with the modules.
224 lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
226 -----------------------------------------------------------------------------
228 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
229 Multiple scripts in the perl package in Trustix Secure Linux 1.5
230 through 2.1, and possibly other operating systems, allows local
231 users to overwrite files via a symlink attack on temporary files.
233 Index: lib/CGI/Cookie.pm
234 --- lib/CGI/Cookie.pm.orig 2007-12-18 11:47:07 +0100
235 +++ lib/CGI/Cookie.pm 2008-03-28 15:23:47 +0100
236 @@ -470,7 +470,7 @@
237 You may also retrieve cookies that were stored in some external
238 form using the parse() class method:
240 - $COOKIES = `cat /usr/tmp/Cookie_stash`;
241 + $COOKIES = `cat /var/run/www/Cookie_stash`;
242 %cookies = parse CGI::Cookie($COOKIES);
244 If you are in a mod_perl environment, you can save some overhead by
245 Index: lib/Shell.pm
246 --- lib/Shell.pm.orig 2007-12-18 11:47:07 +0100
247 +++ lib/Shell.pm 2008-03-28 15:23:47 +0100
248 @@ -151,7 +151,7 @@
249 use Shell qw(cat ps cp);
250 $passwd = cat('</etc/passwd');
251 @pslines = ps('-ww'),
252 - cp("/etc/passwd", "/tmp/passwd");
253 + cp("/etc/passwd", "/etc/passwd.orig");
255 # object oriented
256 my $sh = Shell->new;
258 -----------------------------------------------------------------------------
260 Index: Configure
261 --- Configure.orig 2007-12-18 11:47:07 +0100
262 +++ Configure 2008-03-28 15:23:47 +0100
263 @@ -7871,7 +7871,7 @@
264 ;;
265 linux|irix*|gnu*) dflt="-shared $optimize" ;;
266 next) dflt='none' ;;
267 - solaris) dflt='-G' ;;
268 + solaris) dflt='-shared' ;;
269 sunos) dflt='-assert nodefinitions' ;;
270 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
271 *) dflt='none' ;;
273 -----------------------------------------------------------------------------
275 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
277 Index: sv.c
278 --- sv.c.orig 2007-12-18 11:47:08 +0100
279 +++ sv.c 2008-03-28 15:23:47 +0100
280 @@ -8667,7 +8667,10 @@
281 if ( (width = expect_number(&q)) ) {
282 if (*q == '$') {
283 ++q;
284 - efix = width;
285 + if (width > PERL_INT_MAX)
286 + efix = PERL_INT_MAX;
287 + else
288 + efix = width;
289 } else {
290 goto gotwidth;
291 }
293 -----------------------------------------------------------------------------
295 Detect NetBSD 5.x as well
297 Index: hints/netbsd.sh
298 --- hints/netbsd.sh.orig 2007-12-18 11:47:07.000000000 +0100
299 +++ hints/netbsd.sh 2008-12-24 10:51:08.000000000 +0100
300 @@ -79,7 +79,7 @@
301 ;;
302 esac
303 case "$osvers" in
304 -0.9*|1.*|2.*|3.*|4.*)
305 +0.9*|1.*|2.*|3.*|4.*|5.*)
306 d_getprotoent_r="$undef"
307 d_getprotobyname_r="$undef"
308 d_getprotobynumber_r="$undef"
310 -----------------------------------------------------------------------------
312 Corrections for Solaris 11:
314 Index: perl.h
315 diff -Nau perl.h.orig perl.h
316 --- perl.h.orig 2007-12-18 11:47:08.000000000 +0100
317 +++ perl.h 2009-01-06 15:28:45.843276063 +0100
318 @@ -1393,6 +1393,7 @@
319 */
321 #if defined(I_SYSMODE) && !defined(PERL_MICRO)
322 +#include <sys/vnode.h>
323 #include <sys/mode.h>
324 #endif