diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2004-10-25 11:47:19 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2004-10-25 11:47:19 +0000 |
commit | ba23b773038d07f114dc2ef8db400dd17c6e2582 (patch) | |
tree | 2eeceb1b3881170dbbef3df44d2327b889346798 /devel/p5-Log-Dispatch | |
parent | f436a96993ab3f8193fa120fd85f8680daa638a3 (diff) |
Notes
Diffstat (limited to 'devel/p5-Log-Dispatch')
-rw-r--r-- | devel/p5-Log-Dispatch/Makefile | 49 | ||||
-rw-r--r-- | devel/p5-Log-Dispatch/scripts/configure.pl | 180 |
2 files changed, 33 insertions, 196 deletions
diff --git a/devel/p5-Log-Dispatch/Makefile b/devel/p5-Log-Dispatch/Makefile index 8212e1a73333..31b1c5bfa08b 100644 --- a/devel/p5-Log-Dispatch/Makefile +++ b/devel/p5-Log-Dispatch/Makefile @@ -7,6 +7,7 @@ PORTNAME= Log-Dispatch PORTVERSION= 2.10 +PORTREVISION= 1 CATEGORIES= devel perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= Log @@ -18,11 +19,6 @@ COMMENT= A suite of OO modules for logging messages to multiple outputs BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Params/Validate.pm:${PORTSDIR}/devel/p5-Params-Validate RUN_DEPENDS= ${BUILD_DEPENDS} -.if !defined(BATCH) -IS_INTERACTIVE= yes -.endif - -USE_SUBMAKE= yes PERL_MODBUILD= yes MAN3= Log::Dispatch.3 \ @@ -40,24 +36,45 @@ MAN3= Log::Dispatch.3 \ Log::Dispatch::Screen.3 \ Log::Dispatch::Syslog.3 -SCRIPTS_ENV+= WRKDIRPREFIX="${WRKDIRPREFIX}" \ - MKDIR="${MKDIR}" \ - REALCURDIR="${.CURDIR}" +OPTIONS= APACHELOG "Apache::Log support" off \ + EMAIL_MIMELITE "MIME::Lite support" off \ + EMAIL_MAILSEND "Mail::Send support" off \ + EMAIL_MAILSENDMAIL "Mail::Sendmail support" on \ + MAIL_SENDER "Mail::Sender support" off + +.if !defined(NOPORTDOCS) +PORTDOCS= Changes README + +post-install: + @${MKDIR} ${DOCSDIR} + @${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR} + @${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}." +.endif .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 502126 -BROKEN= Build fails +.if defined(WITH_APACHELOG) +.if defined(WITH_APACHE2) +BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache2/mod_perl.so:${PORTSDIR}/www/mod_perl2 +.else +BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl +.endif .endif -pre-fetch: - @${SETENV} ${SCRIPTS_ENV} ${PERL} ${SCRIPTDIR}/configure.pl +.if defined(WITH_EMAIL_MIMELITE) +BUILD_DEPENDS+= ${SITE_PERL}/MIME/Lite.pm:${PORTSDIR}/mail/p5-MIME-Lite +.endif -post-clean: - @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc +.if defined(WITH_EMAIL_MAILSEND) +BUILD_DEPENDS+= ${SITE_PERL}/Mail/Send.pm:${PORTSDIR}/mail/p5-Mail-Tools +.endif + +.if defined(WITH_EMAIL_MAILSENDMAIL) +BUILD_DEPENDS+= ${SITE_PERL}/Mail/Sendmail.pm:${PORTSDIR}/mail/p5-Mail-Sendmail +.endif -.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) -.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" +.if defined(WITH_MAIL_SENDER) +BUILD_DEPENDS+= ${SITE_PERL}/Mail/Sender.pm:${PORTSDIR}/mail/p5-Mail-Sender .endif .include <bsd.port.post.mk> diff --git a/devel/p5-Log-Dispatch/scripts/configure.pl b/devel/p5-Log-Dispatch/scripts/configure.pl deleted file mode 100644 index 6de67ec6ea16..000000000000 --- a/devel/p5-Log-Dispatch/scripts/configure.pl +++ /dev/null @@ -1,180 +0,0 @@ -#! /usr/bin/perl -w -# $FreeBSD$ -use strict; - -unless (defined $ENV{WRKDIRPREFIX} and - defined $ENV{REALCURDIR} and - defined $ENV{MKDIR} and - defined $ENV{LOCALBASE}) -{ - die "this script should not be run like that!\n"; -} - -my $batch = $ENV{BATCH} || 0; - -my $makedir = "$ENV{WRKDIRPREFIX}$ENV{REALCURDIR}"; -my $makefile = "$makedir/Makefile.inc"; -my $mkdircmd = $ENV{MKDIR}; -exit if -f $makefile; - -my @modules = ( - { - module => 'ApacheLog', - check => 'Apache::Log', -# file => '${PERL_ARCH}/Apache/Log.pm', - port => 'www/mod_perl', -# man3 => 'Log::Dispatch::ApacheLog', - }, - { - module => 'Email::MIMELite', - check => 'MIME::Lite', - port => 'mail/p5-MIME-Lite', - }, - { - module => 'Email::MailSend', - check => 'Mail::Send', - port => 'mail/p5-Mail-Tools', - }, - { - module => 'Email::MailSendmail', - check => 'Mail::Sendmail', - port => 'mail/p5-Mail-Sendmail', - }, - { - module => 'Mail::Sender', - check => 'Mail::Sender', - port => 'mail/p5-Mail-Sender', - }, - { - module => 'Syslog', - check => 'Sys::Syslog', - port => 'base perl', - nodepend=> 1, - } -); - -scan_modules(@modules); -@modules = select_modules(@modules); -generate_makefile_inc(@modules); -exit; - -sub generate_makefile_inc -{ - my @modules = @_; - - system("$mkdircmd $makedir"); - open INC, "> $makefile" or die "open: $makefile: $!\n"; - - for my $m (@modules) { - next if $m->{nodepend}; - my $mpath = $m->{found} || "/nonexistent"; - $mpath = varify_hardcoded_paths($mpath); - my $port = $m->{port}; - print INC "BUILD_DEPENDS+= $mpath:\${PORTSDIR}/$port\n"; - } - close INC; -} - -sub varify_hardcoded_paths -{ - local ($_) = @_; - s|(perl5/site_perl/)([\d._]+)/|$1\${PERL_VER}/|; - s|(perl5/site_perl/\${PERL_VER}/)mach/|$1\${PERL_ARCH}/|; - s|^$ENV{LOCALBASE}/|\${LOCALBASE}/|; - $_; -} - -sub got_module -{ - my ($m) = @_; - - $m =~ s|::|/|g; - $m .= ".pm"; - for (@INC) { - my $f = "$_/$m"; - return $f if -r $f; - } - return 0; -} - -sub scan_modules -{ - my @modules = @_; - for my $module (@modules) { - $module->{found} = got_module($module->{check}); - } -} - -sub select_modules -{ - my @modules = @_; - my @selected; - if ($batch) { - @selected = batch_select(@_); - } else { - @selected = ask_user(@_); - } - my @mod; - my %modules = map { $_->{module} => $_ } @modules; - for my $module (@selected) { - push @mod, $modules{$module} if exists $modules{$module}; - } - @mod; -} - -sub batch_select -{ - my @modules = @_; - my @selected; - for my $module (@modules) { - push @selected, $module->{module} if $module->{found}; - } - @selected; -} - -sub ask_user -{ - my @modules = @_; - my @dlg; - push @dlg, "/usr/bin/dialog"; - push @dlg, "--title", "Log::Dispatch configuration"; - push @dlg, "--clear", "--checklist", <<EOF; -Log::Dispatch distribution provides several predefined output objects. -Select output objects you will likely need. Those output objects for -which no extra software packages need to be installed are preselected. - - Please choose options by pressing SPACE to TOGGLE on option ON/OFF -EOF - push @dlg, -1, -1, 9; - for my $module (@modules) { - push @dlg, $module->{module}, "requires $module->{check}" . - ($module->{found} ? " (already installed)" : ""), - ($module->{found} ? "ON" : "OFF"); - } - - my @selected; - - my $pid = open(RESULT, "-|"); - if ($pid) { - # parent - my $r = ""; - while (<RESULT>) { - $r .= $_; - } - close(RESULT) or die "dialog(1) exited with non-zero return code\n"; - $r =~ s/"//g; - $r =~ s/\s+/ /g; - @selected = split ' ', $r; - } elsif (defined $pid) { - # child - open XCHG, ">& STDOUT" or die "dup: $!\n"; - open STDOUT, ">& STDERR" or die "dup: $!\n"; - open STDERR, ">& XCHG" or die "dup: $!\n"; - close XCHG if fileno(XCHG) > 2; - exec @dlg or die "cannot exec: $!\n"; - } else { - die "cannot fork: $!\n"; - } - - return @selected; -} |