sophia-perl/Makefile.PL

47 lines
984 B
Makefile
Raw Permalink Normal View History

2015-03-20 17:56:04 +03:00
use strict;
use utf8;
use File::Fetch;
use Archive::Extract;
use FindBin;
use ExtUtils::MakeMaker;
my $rc = eval
{
require 5.010;
Term::ReadKey->import();
1;
};
if($rc && !-e "sophia-master")
{
eval {
my $ff = File::Fetch->new(uri => "http://github.com/pmwkaa/sophia/archive/master.zip");
if(my $file = $ff->fetch())
{
my $ae = Archive::Extract->new( archive => $file );
$ae->extract( to => '.' );
}
};
}
2015-03-20 20:41:17 +03:00
my $sophia = $FindBin::Bin ."/sophia-master";
2015-03-20 23:42:03 +03:00
my $sophia_src = $sophia;
2015-03-20 17:56:04 +03:00
`make -C $sophia_src libsophia.a`;
my $ccflags = $Config::Config{ccflags} || '';
2015-03-20 17:56:04 +03:00
WriteMakefile(
2015-03-20 23:36:29 +03:00
AUTHOR => 'Vitaliy Filippov <vitalif@mail.ru>',
2015-03-20 17:56:04 +03:00
ABSTRACT_FROM => 'Sophia.pm',
VERSION_FROM => 'Sophia.pm',
NAME => 'Database::Sophia',
LICENSE => 'perl',
LINKTYPE => 'dynamic',
CCFLAGS => "-Wall $ccflags",
2015-03-20 17:56:04 +03:00
LIBS => ["-L$sophia_src -lsophia -lpthread"],
INC => '-I'. $sophia_src
);