| 1 |
use alienfile; |
| 2 |
|
| 3 |
plugin 'PkgConfig' => ( |
| 4 |
pkg_name => 'openssl', |
| 5 |
); |
| 6 |
|
| 7 |
share { |
| 8 |
|
| 9 |
# when building OpenSSL from source we have a few challenges. |
| 10 |
# - AB uses Net::SSLeay (via HTTP::Tiny) by default when downloading https URLs |
| 11 |
# - Net::SSLeay requires OpenSSL |
| 12 |
# - We can download OpenSSL from FTP, but that is susceptible to man-in-the-middle attacks |
| 13 |
# (and that is a bad look for a security product) |
| 14 |
|
| 15 |
# Solution: |
| 16 |
# - try downloading with curl or wget via the 'bootstrap_ssl' option. |
| 17 |
# - if that doesn't work, fallback on FTP |
| 18 |
# - don't attempt FTP transfer if ALIEN_OPENSSL_FTP is set to 0 |
| 19 |
|
| 20 |
start_url 'https://www.openssl.org/source/'; |
| 21 |
plugin Download => ( |
| 22 |
version => qr/^openssl-([0-9\.]+[a-z]*)\.tar\.gz$/, |
| 23 |
bootstrap_ssl => 1, |
| 24 |
); |
| 25 |
|
| 26 |
unless(meta->has_hook('fetch')) |
| 27 |
{ |
| 28 |
my $ftp_ok = $ENV{ALIEN_OPENSSL_FTP}; |
| 29 |
$ftp_ok = 1 unless defined $ftp_ok; |
| 30 |
if($ftp_ok) |
| 31 |
{ |
| 32 |
log(" ************************************************* "); |
| 33 |
log(" * WARNING downloading OpenSSL via FTP * "); |
| 34 |
log(" ************************************************* "); |
| 35 |
start_url 'ftp://ftp.openssl.org/source/'; |
| 36 |
plugin 'Fetch::NetFTP'; |
| 37 |
plugin 'Decode::DirListing'; |
| 38 |
} |
| 39 |
else |
| 40 |
{ |
| 41 |
log("Unable to download OpenSSL via https without OpenSSL!"); |
| 42 |
log("Recommend installing wget or curl to bootstrap Alien::OpenSSL"); |
| 43 |
die "unable to download OpenSSL via https"; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
plugin 'Extract' => 'tar.gz'; |
| 48 |
|
| 49 |
build [ |
| 50 |
'%{perl} Configure --prefix=%{.install.prefix} no-shared cc', |
| 51 |
'%{make}', |
| 52 |
'%{make} install', |
| 53 |
]; |
| 54 |
|
| 55 |
# This package doesn't build a dynamic library by default, but if |
| 56 |
# it did this would make sure that it wasn't used with XS. |
| 57 |
# (See Alien::Build::Manual::AlienAuthor for details). |
| 58 |
plugin 'Gather::IsolateDynamic'; |
| 59 |
|
| 60 |
}; |