Mail-SpamCannibal
view release on metacpan or search on metacpan
BDBaccess/Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
##########################################################
## if built from a parent directory, #
## at install, the parent Makefile must execute #
## #
## as first step in the install process #
## @cd BDBaccess && $(MAKE) install_daemon $(PASTHRU) #
## #
## as the step imediately following 'all' #
## @cd BDBaccess && $(MAKE) clean_CTest $(PASTHRU) #
## #
##########################################################
use Config;
use vars qw($CONFIG);
use Cwd qw(abs_path);
use IPTables::IPv4::DBTarpit::Inst qw(:all);
use IPTables::IPv4::DBTarpit::SiteConfig;
my $conf = 'config.db';
my $home = abs_path('./');
my $localconf = $home .'/'. $conf;
# what to do with dialog if called from MAKE or parent Makefile
my $configtxt;
if ((caller)[0]) { # exists, the called by another routine
my $master = abs_path('../').'/'.$conf;
hard_fail("failed to access $_")
if ($_ = cpfromto($master,$localconf));
$CONFIG = do $localconf;
$configtxt = make_text($CONFIG);
}
# If rebuilding the make file, skip the dialog
elsif (join(' ',@INC) =~ /$home/) { # checkfor rebuild flag
$CONFIG = do $localconf;
$configtxt = make_text($CONFIG);
} else {
$configtxt = do 'inst/dialog.pl';
$CONFIG = do 'config.db';
}
my $pmname = 'BDBaccess.pm';
open(V,$pmname)
or hard_fail("could not open $pmname to get version number");
my $c_version;
while (<V>) {
next unless $_ =~ /\$VERSION.+(char[^;]+;)/;
$c_version = $1;
last;
}
close V;
hard_fail("could not find version number in $pmname")
unless $c_version;
hard_fail("could not open 'c_version.h' for local write")
unless open(H,'>./c_version.h');
print H qq|
/* c_version.h
*
* Do not edit this file. It was automatically created by
* Makefile.PL and contains the most recent version number
*/
$c_version
|;
close H;
my $BDBTARPIT_CONF = new IPTables::IPv4::DBTarpit::SiteConfig;
my $objects = 'main.o netio.o util_pid.o';
my $daemon = 'bdbaccess';
my $rcfile = 'rc.'. $daemon;
my $include = '-I'. $BDBTARPIT_CONF->{DBTP_INCLUDE_DIR};
my $extralibs = '-L'. $BDBTARPIT_CONF->{DBTP_LIBRARY_DIR};
%makeparms = (
'NAME' => 'Mail::SpamCannibal::BDBaccess::CTest',
'DISTNAME' => 'Mail-SpamCannibal-BDBaccess',
'VERSION_FROM' => $pmname, # finds $VERSION
'PM' => {'BDBaccess.pm' => '$(INST_LIB)/Mail/SpamCannibal/BDBaccess.pm',
'lib/Mail/SpamCannibal/BDBclient.pm' => '$(INST_LIB)/Mail/SpamCannibal/BDBclient.pm'
},
'MAN1PODS' => {$daemon .'.pod' => '$(INST_MAN1DIR)/'. $daemon .'.$(MAN1EXT)',
},
'MAN3PODS' => {'BDBaccess.pm' => '$(INST_MAN3DIR)/Mail::SpamCannibal::BDBaccess.$(MAN3EXT)',
'lib/Mail/SpamCannibal/BDBclient.pm' =>
( run in 4.280 seconds using v1.01-cache-2.11-cpan-302cb4679cc )