openpkg/perl.patch

Thu, 04 Oct 2012 20:30:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:30:05 +0200
changeset 715
c10fb90893b9
parent 428
f880f219c566
permissions
-rw-r--r--

Correct out of date build configuration, porting to Solaris 11 network
link infrastructure and new libpcap logic. This additionally allows for
device drivers in subdirectories of /dev. Correct packaged nmap
personalities and signatures to work out of the box. Finally, hack
arpd logic to properly close sockets and quit on TERM by repeating
signaling in the run command script. Sadly, all this fails to correct
the run time behaviour of honeyd which fails to bind to the IP layer.

michael@13 1 By default, the "vendor" area is not used, so Perl's installation
michael@13 2 procedure forgot to create its top-level paths, too. In OpenPKG we use
michael@13 3 the "vendor" area, so make sure it is created the same way the "site"
michael@13 4 area is.
michael@13 5
michael@13 6 Index: installperl
michael@428 7 --- installperl.orig 2011-06-09 22:04:29.000000000 +0200
michael@428 8 +++ installperl 2011-06-17 15:20:48.000000000 +0200
michael@431 9 @@ -196,6 +196,8 @@
michael@428 10 my $installarchlib = "$opts{destdir}$Config{installarchlib}";
michael@428 11 my $installsitelib = "$opts{destdir}$Config{installsitelib}";
michael@428 12 my $installsitearch = "$opts{destdir}$Config{installsitearch}";
michael@428 13 +my $installvendorlib = "$opts{destdir}$Config{installvendorlib}";
michael@428 14 +my $installvendorarch = "$opts{destdir}$Config{installvendorarch}";
michael@428 15 my $installman1dir = "$opts{destdir}$Config{installman1dir}";
michael@13 16 my $man1ext = $Config{man1ext};
michael@13 17 my $libperl = $Config{libperl};
michael@428 18 @@ -349,6 +351,8 @@
michael@428 19 mkpath($installarchlib, $opts{verbose}, 0777);
michael@428 20 mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
michael@428 21 mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
michael@428 22 +mkpath($installvendorlib, $opts{verbose}, 0777) if ($installvendorlib);
michael@428 23 +mkpath($installvendorarch, $opts{verbose}, 0777) if ($installvendorarch);
michael@13 24
michael@13 25 if (chdir "lib") {
michael@13 26 $do_installarchlib = ! samepath($installarchlib, '.');
michael@13 27
michael@13 28 -----------------------------------------------------------------------------
michael@13 29
michael@13 30 Port to [Open]Darwin 6.6.2:
michael@13 31
michael@13 32 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
michael@13 33 understand "-no-cpp-precomp", so remove this build option.
michael@13 34
michael@13 35 2. The <sys/mman.h> indirectly includes system specific headers
michael@13 36 which in turn have fields named "environ" while Perl uses
michael@13 37 a define of "environ" internally. So wrap the inclusion.
michael@13 38
michael@13 39 3. Darwin 6 no longer accepts the non-standard "#import" statements,
michael@13 40 so replace with "#include" and circumvent some header problem
michael@13 41 related to the non-standard "__private_extern__" attribute.
michael@13 42
michael@13 43 Index: hints/darwin.sh
michael@428 44 --- hints/darwin.sh.orig 2011-09-19 15:18:22.000000000 +0200
michael@428 45 +++ hints/darwin.sh 2011-12-24 12:00:58.000000000 +0100
michael@428 46 @@ -181,6 +181,20 @@
michael@428 47 ldflags="${ldflags} -flat_namespace"
michael@428 48 lddlflags="${ldflags} -bundle -undefined suppress"
michael@428 49 ;;
michael@428 50 +9.*)
michael@428 51 + lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
michael@428 52 + case "$ld" in
michael@428 53 + *MACOSX_DEVELOPMENT_TARGET*) ;;
michael@428 54 + *) ld="env MACOSX_DEPLOYMENT_TARGET=10.5 ${ld}" ;;
michael@428 55 + esac
michael@428 56 + ;;
michael@428 57 +10.*)
michael@428 58 + lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
michael@428 59 + case "$ld" in
michael@428 60 + *MACOSX_DEVELOPMENT_TARGET*) ;;
michael@428 61 + *) ld="env MACOSX_DEPLOYMENT_TARGET=10.6 ${ld}" ;;
michael@428 62 + esac
michael@428 63 + ;;
michael@428 64 *)
michael@428 65 lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
michael@428 66 case "$ld" in
michael@428 67 @@ -191,8 +205,7 @@
michael@13 68 esac
michael@13 69 ldlibpthname='DYLD_LIBRARY_PATH';
michael@13 70
michael@13 71 -# useshrplib=true results in much slower startup times.
michael@13 72 -# 'false' is the default value. Use Configure -Duseshrplib to override.
michael@13 73 +useshrplib='true'
michael@13 74
michael@13 75 cat > UU/archname.cbu <<'EOCBU'
michael@13 76 # This script UU/archname.cbu will get 'called-back' by Configure
michael@428 77 @@ -326,3 +339,6 @@
michael@428 78 # makefile in the same place. Since Darwin uses GNU make, this dodges
michael@428 79 # the problem.
michael@428 80 firstmakefile=GNUmakefile;
michael@428 81 +
michael@428 82 +usenm='false'
michael@428 83 +
michael@13 84
michael@13 85 -----------------------------------------------------------------------------
michael@13 86
michael@13 87 Port to Tru64 5.1:
michael@13 88
michael@13 89 Under Tru64 our gcc has to be built without binutils and the system
michael@13 90 ld(1) does not accept a "-O" option, so remove the whole passing of
michael@13 91 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
michael@13 92 really don't need any more optimization because we are already happy if
michael@13 93 it works at all.
michael@13 94
michael@13 95 Index: hints/dec_osf.sh
michael@428 96 --- hints/dec_osf.sh.orig 2011-06-17 02:06:09.000000000 +0200
michael@428 97 +++ hints/dec_osf.sh 2011-06-17 15:20:48.000000000 +0200
michael@13 98 @@ -73,15 +73,6 @@
michael@13 99 *) if $test "X$optimize" = "X$undef"; then
michael@13 100 lddlflags="$lddlflags -msym"
michael@13 101 else
michael@13 102 - case "$myosvers" in
michael@13 103 - *4.0D*)
michael@13 104 - # QAR 56761: -O4 + .so may produce broken code,
michael@13 105 - # fixed in 4.0E or better.
michael@13 106 - ;;
michael@13 107 - *)
michael@13 108 - lddlflags="$lddlflags $optimize"
michael@13 109 - ;;
michael@13 110 - esac
michael@13 111 # -msym: If using a sufficiently recent /sbin/loader,
michael@13 112 # keep the module symbols with the modules.
michael@13 113 lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
michael@13 114
michael@13 115 -----------------------------------------------------------------------------
michael@13 116
michael@428 117 Linker flag change for Solaris.
michael@428 118
michael@13 119 Index: Configure
michael@428 120 --- Configure.orig 2011-06-09 22:04:29.000000000 +0200
michael@428 121 +++ Configure 2011-06-17 15:20:48.000000000 +0200
michael@431 122 @@ -8014,9 +8014,9 @@
michael@14 123 ;;
michael@14 124 linux|irix*|gnu*) dflt="-shared $optimize" ;;
michael@13 125 next) dflt='none' ;;
michael@13 126 - solaris) dflt='-G' ;;
michael@13 127 + solaris) dflt='-shared' ;;
michael@13 128 sunos) dflt='-assert nodefinitions' ;;
michael@428 129 - svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
michael@428 130 + svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
michael@13 131 *) dflt='none' ;;
michael@428 132 esac
michael@428 133 ;;
michael@13 134
michael@13 135 -----------------------------------------------------------------------------
michael@13 136
michael@13 137 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
michael@13 138
michael@13 139 Index: sv.c
michael@428 140 --- sv.c.orig 2011-06-17 02:06:09.000000000 +0200
michael@428 141 +++ sv.c 2011-06-17 15:20:48.000000000 +0200
michael@431 142 @@ -10283,7 +10283,10 @@
michael@13 143 if ( (width = expect_number(&q)) ) {
michael@13 144 if (*q == '$') {
michael@13 145 ++q;
michael@13 146 - efix = width;
michael@13 147 + if (width > PERL_INT_MAX)
michael@13 148 + efix = PERL_INT_MAX;
michael@13 149 + else
michael@13 150 + efix = width;
michael@13 151 } else {
michael@13 152 goto gotwidth;
michael@13 153 }
michael@13 154
michael@14 155 -----------------------------------------------------------------------------
michael@14 156
michael@428 157 Do not use -fstack-protector as it causes too much portability issues.
michael@14 158
michael@428 159 Index: Configure
michael@428 160 --- Configure.orig 2011-06-09 22:04:29.000000000 +0200
michael@428 161 +++ Configure 2011-06-17 15:20:48.000000000 +0200
michael@431 162 @@ -5103,17 +5103,6 @@
michael@428 163 ;;
michael@428 164 esac
michael@14 165
michael@428 166 - # on x86_64 (at least) we require an extra library (libssp) in the
michael@428 167 - # link command line. This library is not named, so I infer that it is
michael@428 168 - # an implementation detail that may change. Hence the safest approach
michael@428 169 - # is to add the flag to the flags passed to the compiler at link time,
michael@428 170 - # as that way the compiler can do the right implementation dependant
michael@428 171 - # thing. (NWC)
michael@428 172 - case "$gccversion" in
michael@428 173 - ?*) set stack-protector -fstack-protector
michael@428 174 - eval $checkccflag
michael@428 175 - ;;
michael@428 176 - esac
michael@428 177 ;;
michael@428 178 esac
michael@14 179
michael@431 180 @@ -5241,15 +5241,6 @@
michael@428 181 ;;
michael@428 182 *) dflt="$ldflags";;
michael@428 183 esac
michael@428 184 -# See note above about -fstack-protector
michael@428 185 -case "$ccflags" in
michael@428 186 -*-fstack-protector*)
michael@428 187 - case "$dflt" in
michael@428 188 - *-fstack-protector*) ;; # Don't add it again
michael@428 189 - *) dflt="$dflt -fstack-protector" ;;
michael@428 190 - esac
michael@428 191 - ;;
michael@428 192 -esac
michael@428 193
michael@428 194 : Try to guess additional flags to pick up local libraries.
michael@428 195 for thislibdir in $libpth; do
michael@431 196 @@ -8023,14 +8023,6 @@
michael@428 197 ''|' ') dflt='none' ;;
michael@428 198 esac
michael@428 199
michael@428 200 - case "$ldflags" in
michael@428 201 - *-fstack-protector*)
michael@428 202 - case "$dflt" in
michael@428 203 - *-fstack-protector*) ;; # Don't add it again
michael@428 204 - *) dflt="$dflt -fstack-protector" ;;
michael@428 205 - esac
michael@428 206 - ;;
michael@428 207 - esac
michael@428 208
michael@428 209
michael@428 210 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
michael@428 211
michael@428 212 -----------------------------------------------------------------------------
michael@428 213
michael@428 214 Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
michael@428 215
michael@428 216 Index: Configure
michael@428 217 --- Configure.orig 2009-08-24 18:33:49 +0200
michael@428 218 +++ Configure 2009-08-24 18:44:39 +0200
michael@431 219 @@ -1778,7 +1778,7 @@
michael@428 220 touch posthint.sh
michael@428 221
michael@428 222 : set package name
michael@428 223 -package='perl5'
michael@428 224 +package='perl'
michael@428 225 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
michael@428 226 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
michael@428 227 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
michael@428 228
michael@428 229 -----------------------------------------------------------------------------
michael@428 230
michael@428 231 Linking against just libgdbm_compat under at least SUSE fails
michael@428 232 because it also needs libgdbm (which Perl doesn't pick up, too)
michael@428 233
michael@428 234 Index: hints/linux.sh
michael@428 235 --- hints/linux.sh.orig 2011-06-09 22:04:29.000000000 +0200
michael@428 236 +++ hints/linux.sh 2011-06-17 15:20:48.000000000 +0200
michael@431 237 @@ -58,7 +58,9 @@
michael@428 238 libswanted="$*"
michael@428 239
michael@428 240 # Debian 4.0 puts ndbm in the -lgdbm_compat library.
michael@428 241 -libswanted="$libswanted gdbm_compat"
michael@428 242 +if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
michael@428 243 + libswanted="$libswanted gdbm_compat"
michael@428 244 +fi
michael@428 245
michael@428 246 # If you have glibc, then report the version for ./myconfig bug reporting.
michael@428 247 # (Configure doesn't need to know the specific version since it just uses
michael@428 248
michael@428 249 Index: Configure
michael@428 250 --- Configure.orig 2012-05-31 14:59:16.000000000 +0200
michael@428 251 +++ Configure 2012-05-31 15:04:27.000000000 +0200
michael@428 252 @@ -22206,6 +22206,7 @@
michael@428 253 for xxx in *; do
michael@428 254 case "$xxx" in
michael@428 255 DynaLoader|dynaload) ;;
michael@428 256 + \* ) ;;
michael@428 257 *)
michael@428 258 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
michael@428 259 leaf=`echo $xxx | $sed -e s/.*-//`;

mercurial