File: FindOpenSSL.pm

package info (click to toggle)
libweb-id-perl 1.927-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308 kB
  • sloc: perl: 1,381; makefile: 2; sh: 1
file content (36 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (5)
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
package Web::ID::Util::FindOpenSSL;

our $AUTHORITY = "cpan:TOBYINK";
our $VERSION   = "1.927";

use strict;
use File::ShareDir qw/dist_dir/;
use File::Spec;

my @possible = (
	'c:\\openssl\\bin\\openssl.exe',
	'/usr/bin/openssl',
	'/usr/local/bin/openssl',
);
push @possible, $ENV{OPENSSL_PATH} if exists $ENV{OPENSSL_PATH};
push @possible, File::Spec->catfile(
	dist_dir("Alien-OpenSSL"),
	"bin",
	"openssl",
) if eval { dist_dir("Alien-OpenSSL") };

my $openssl;
sub find_openssl
{
	return $openssl
		if defined $openssl && -f $openssl;
	
	for my $try (@possible)
	{
		return ($openssl = $try) if -f $try;
	}
	
	return;
}

1;