View | Details | Raw Unified | Return to bug 199179 | Differences between
and this patch

Collapse All | Expand All

(-)security/p5-openxpki/files/patch-Makefile.PL (-63 / +67 lines)
Lines 1-66 Link Here
1
--- Makefile.PL.orig	2014-12-02 20:05:23 UTC
1
--- Makefile.PL.orig	2015-04-11 09:17:07 UTC
2
+++ Makefile.PL
2
+++ Makefile.PL
3
@@ -249,49 +249,6 @@ else {
3
@@ -83,19 +83,22 @@ print STDERR "OpenSSL binary:  $openssl_
4
   print STDERR "Logger is not installed. Continue anyway.\n";
4
 # OpenSSL 0.9.7l 28 Sep 2006
5
 # OpenSSL 1.0.0a 1 Jun 2010
6
 my $openssl_version_string = `$openssl_binary version`;
7
-my ($openssl_version_major, $openssl_version_minor, $openssl_version_fix, $openssl_version_patch);
8
-if ($openssl_version_string =~ m/\s*OpenSSL\s+(\d+)\.(\d+)\.(\d+)([a-zA-Z]+)/) {
9
+my ($openssl_version_major, $openssl_version_minor, $openssl_version_fix, $openssl_version_patch, $openssl_version_flavour);
10
+if ($openssl_version_string =~ m/\s*OpenSSL\s+(\d+)\.(\d+)\.(\d+)([a-zA-Z]+)/i) {
11
     # OpenSSL 0.9
12
+    $openssl_version_flavour = 'OpenSSL';
13
     $openssl_version_major = $1;
14
     $openssl_version_minor = $2;
15
     $openssl_version_fix   = $3;
16
     $openssl_version_patch = $4;
17
-    print "OpenSSL version: major=$openssl_version_major, minor=$openssl_version_minor, fix=$openssl_version_fix, patch=$openssl_version_patch\n";
18
-} elsif ($openssl_version_string =~ m/\s*OpenSSL\s+(\d+)\.(\d+)\.(\d+)\s+/) {
19
+    print "$openssl_version_flavour version: major=$openssl_version_major, minor=$openssl_version_minor, fix=$openssl_version_fix, patch=$openssl_version_patch\n";
20
+    
21
+} elsif ($openssl_version_string =~ m/\s*(OpenSSL|LibreSSL)\s+(\d+)\.(\d+)\.(\d+)\s+/) {
22
     # OpenSSL 1.0
23
-    $openssl_version_major = $1;
24
-    $openssl_version_minor = $2;
25
-    $openssl_version_fix   = $3;
26
+    $openssl_version_flavour = $1;
27
+    $openssl_version_major = $2;
28
+    $openssl_version_minor = $3;
29
+    $openssl_version_fix   = $4;
30
     print "OpenSSL version: major=$openssl_version_major, minor=$openssl_version_minor, fix=$openssl_version_fix\n";
31
 } else {
32
     print "Problem: malformed openssl version string!\n";
33
@@ -103,12 +106,22 @@ if ($openssl_version_string =~ m/\s*Open
34
     exit 1;
5
 }
35
 }
6
 
36
 
7
-# check if we should add -shared
37
-# Now make sure version is 0.9.8
8
-# not all platforms support this feature
38
-unless ( (($openssl_version_major == 0) &&
9
-my %flags = ();
39
-          ($openssl_version_minor == 9) &&
10
-
40
-          ($openssl_version_fix   == 8)) or
11
-open $fh, '>test.c' or die "Cannot open test.c. Stopped";
41
-         ($openssl_version_major == 1 &&
12
-print $fh "int main() {}\n";
42
-          $openssl_version_minor == 0)) {
13
-close $fh;
43
+# Warn on old openssl - should work but lacks support for some features 
14
-use Config;
44
+if ($openssl_version_major == 0 &&
15
-my $cc = $Config{'cc'};
45
+    $openssl_version_minor == 9 &&
16
-
46
+    $openssl_version_fix   == 8) {
17
-my $cc_supports_shared = 1;
47
+
18
-if (open $fh, "$cc -shared -o test test.c 2>&1 |") {
48
+    print STDERR "Warning: openssl 0.9.8 found - this will work but lacks some features, e.g. server side key generation!";
19
-    while (my $line = <$fh>) {
49
+              
20
-        if ($line =~ m{ unrecognized .* option .* -shared }xms) {
50
+} elsif ( $openssl_version_flavour =~ m/LibreSSL/i ) {
21
-	    $cc_supports_shared = 0;
51
+    
22
-        }
52
+    print STDERR "Warning: LibreSSL found, support for LibreSSL is experimental!";
23
-    }
53
+    
24
-    close $fh;
54
+} elsif (not 
25
-    if ($CHILD_ERROR) {
55
+    ($openssl_version_flavour =~ m/OpenSSL/i &&
26
-        $cc_supports_shared = 0;
56
+     $openssl_version_major == 1 &&
27
-    }
57
+     $openssl_version_minor == 0 )) {
28
-
58
+         
29
-    if (! $cc_supports_shared)
59
     print STDERR "\n";
30
-    {
60
     print STDERR "ERROR: OpenSSL 0.9.8  or 1.0 is required.\n";
31
-        print STDERR "C compiler does not support -shared.\n";
61
     print STDERR "Consider setting OPENSSL_PREFIX correctly.\n\n";
32
-    }
62
@@ -130,7 +143,7 @@ if ( -s '../../VERSION' ) {
33
-    else {
63
     $openxpki_version = `cat ../../VERSION`;
34
-        if ($^O ne 'darwin') {
64
     chomp $openxpki_version;
35
-            print STDERR "C compiler supports -share. Adding it to LDDLFLAGS.\n";
65
 } elsif ( -e($vergen) ) {
36
-            $flags{'LDDLFLAGS'} = '-shared';
66
-    $openxpki_version = `$vergen --format version`;
37
-        }
67
+    $openxpki_version = "0.27.0";
38
-        else {
68
 
39
-            print STDERR "C compiler claims to support -share. But we are on Mac OS X, experience shows that it still does not work with -share, so we won't add it to LDDLFLAGS ...\n";
69
     if ($CHILD_ERROR != 0) {
40
-        }
70
         $openxpki_version = undef;
41
-    }
42
-}
43
-else {
44
-    print STDERR "Could not run C compiler. Continue anyway.\n";
45
-}
46
-
47
-unlink('test.c');
48
-unlink('test');
49
-
50
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
51
 # the contents of the Makefile that is written.
52
 WriteMakefile(
53
@@ -299,7 +256,6 @@ WriteMakefile(
54
     'VERSION'   => $openxpki_version,
55
     'LIBS'      => ["-L$openssl_lib_dir -lcrypto"],
56
     'INC'       => "-I. -I$openssl_inc_dir",
57
-    'CCFLAGS'   => '-O2 -g '.$Config{ccflags},
58
     'PREREQ_PM' => {
59
 #    'Class::Accessor::Fast'  => '0.31', # Constituent of module Class::Accessor
60
 #					 # which is a prerequisite of Class::Accessor::Chained, see below
61
@@ -397,5 +353,4 @@ WriteMakefile(
62
                               't/cfg.binary.openssl']},
63
     'XSPROTOARG' => '-noprototypes',
64
     'EXE_FILES' => [ 'bin/openxpkictl','bin/openxpkicmd', 'bin/openxpkiadm', 'bin/openxpkicli'],    
65
-    %flags,
66
 );

Return to bug 199179