| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Alien::libmaxminddb; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
15561
|
use 5.014; |
|
|
1
|
|
|
|
|
5
|
|
|
6
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
64
|
|
|
7
|
1
|
|
|
1
|
|
8
|
use utf8; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 2.003; |
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
82
|
use File::Spec qw(); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
12
|
1
|
|
|
1
|
|
1014
|
use JSON::PP qw(); |
|
|
1
|
|
|
|
|
32827
|
|
|
|
1
|
|
|
|
|
784
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub cflags { |
|
15
|
1
|
|
|
1
|
1
|
725187
|
my $class = shift; |
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
17
|
return $class->config->{cflags}; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub libs { |
|
21
|
1
|
|
|
1
|
1
|
15
|
my $class = shift; |
|
22
|
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
8
|
return $class->config->{libs}; |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub version { |
|
27
|
1
|
|
|
1
|
1
|
20
|
my $class = shift; |
|
28
|
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
4
|
return $class->config->{version}; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub install_type { |
|
33
|
1
|
|
|
1
|
1
|
6
|
my $class = shift; |
|
34
|
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
3
|
return $class->config->{install_type}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub config { |
|
39
|
4
|
|
|
4
|
0
|
14
|
my $class = shift; |
|
40
|
|
|
|
|
|
|
|
|
41
|
4
|
|
|
|
|
24
|
state $config = $class->_config; |
|
42
|
4
|
|
|
|
|
22
|
return $config; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub dynamic_libs { |
|
46
|
1
|
|
|
1
|
0
|
2117
|
my $class = shift; |
|
47
|
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
4
|
return; |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub bin_dir { |
|
52
|
1
|
|
|
1
|
0
|
16
|
my $class = shift; |
|
53
|
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
4
|
return; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _dist_dir_with_subdir { |
|
58
|
3
|
|
|
3
|
|
18
|
my ($class, $subdir) = @_; |
|
59
|
|
|
|
|
|
|
|
|
60
|
3
|
|
|
|
|
10
|
my $dist = $class; |
|
61
|
3
|
|
|
|
|
23
|
$dist =~ s/::/-/g; |
|
62
|
|
|
|
|
|
|
|
|
63
|
3
|
|
|
|
|
53
|
my $search_dir = File::Spec->catdir(qw(auto share dist), $dist, $subdir); |
|
64
|
3
|
|
|
|
|
14
|
for my $inc (@INC) { |
|
65
|
6
|
|
|
|
|
41
|
my $dir = File::Spec->catdir($inc, $search_dir); |
|
66
|
6
|
100
|
|
|
|
170
|
if (-d $dir) { |
|
67
|
3
|
|
|
|
|
17
|
return $dir; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
} |
|
70
|
0
|
|
|
|
|
0
|
die "unable to find dist share directory for $dist"; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _config { |
|
74
|
1
|
|
|
1
|
|
5
|
my $class = shift; |
|
75
|
|
|
|
|
|
|
|
|
76
|
1
|
|
|
|
|
20
|
my $alien_dir = $class->_dist_dir_with_subdir('_alien'); |
|
77
|
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
22
|
my $json_file = File::Spec->catfile($alien_dir, 'alien.json'); |
|
79
|
1
|
50
|
|
|
|
79
|
open my $in, '<', $json_file |
|
80
|
|
|
|
|
|
|
or die "Cannot read $json_file"; |
|
81
|
1
|
|
|
|
|
3
|
my $json = do { local $/; <$in> }; |
|
|
1
|
|
|
|
|
13
|
|
|
|
1
|
|
|
|
|
36
|
|
|
82
|
1
|
|
|
|
|
10
|
close $in; |
|
83
|
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
18
|
my $config = JSON::PP::decode_json($json); |
|
85
|
|
|
|
|
|
|
|
|
86
|
1
|
50
|
|
|
|
6438
|
if ($config->{install_type} eq 'share') { |
|
87
|
1
|
|
|
|
|
12
|
my $inc_dir = $class->_dist_dir_with_subdir('include'); |
|
88
|
1
|
|
|
|
|
11
|
$config->{cflags} = join ' ', "-I$inc_dir", $config->{cflags}; |
|
89
|
1
|
|
|
|
|
5
|
my $lib_dir = $class->_dist_dir_with_subdir('lib'); |
|
90
|
1
|
|
|
|
|
34
|
$config->{libs} = join ' ', "-L$lib_dir", $config->{libs}; |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
1
|
|
|
|
|
12
|
return $config; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
|
97
|
|
|
|
|
|
|
__END__ |