File: openssl.alienfile

package info (click to toggle)
libalien-build-perl 2.84-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,116 kB
  • sloc: perl: 10,350; ansic: 134; sh: 66; makefile: 2
file content (60 lines) | stat: -rw-r--r-- 1,824 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use alienfile;

plugin 'PkgConfig' => (
  pkg_name => 'openssl',
);

share {

  # when building OpenSSL from source we have a few challenges.
  # - AB uses Net::SSLeay (via HTTP::Tiny) by default when downloading https URLs
  # - Net::SSLeay requires OpenSSL
  # - We can download OpenSSL from FTP, but that is susceptible to man-in-the-middle attacks
  #   (and that is a bad look for a security product)

  # Solution:
  # - try downloading with curl or wget via the 'bootstrap_ssl' option.
  # - if that doesn't work, fallback on FTP
  # - don't attempt FTP transfer if ALIEN_OPENSSL_FTP is set to 0

  start_url 'https://www.openssl.org/source/';
  plugin Download => (
    version       => qr/^openssl-([0-9\.]+[a-z]*)\.tar\.gz$/,
    bootstrap_ssl => 1,
  );

  unless(meta->has_hook('fetch'))
  {
    my $ftp_ok = $ENV{ALIEN_OPENSSL_FTP};
    $ftp_ok = 1 unless defined $ftp_ok;
    if($ftp_ok)
    {
      log(" ************************************************* ");
      log(" *  WARNING downloading OpenSSL via FTP          * ");
      log(" ************************************************* ");
      start_url 'ftp://ftp.openssl.org/source/';
      plugin 'Fetch::NetFTP';
      plugin 'Decode::DirListing';
    }
    else
    {
      log("Unable to download OpenSSL via https without OpenSSL!");
      log("Recommend installing wget or curl to bootstrap Alien::OpenSSL");
      die "unable to download OpenSSL via https";
    }
  }

  plugin 'Extract' => 'tar.gz';

  build [
    '%{perl} Configure --prefix=%{.install.prefix} no-shared cc',
    '%{make}',
    '%{make} install',
  ];

  # This package doesn't build a dynamic library by default, but if
  # it did this would make sure that it wasn't used with XS.
  # (See Alien::Build::Manual::AlienAuthor for details).
  plugin 'Gather::IsolateDynamic';

};