steffen: server/perl-kolab configure, 1.1, 1.2 perl-kolab.spec, 1.93, 1.94 perl-kolab.spec.in, 1.4, 1.5
cvs at intevation.de
cvs at intevation.de
Thu Jun 30 13:12:12 CEST 2005
Author: steffen
Update of /kolabrepository/server/perl-kolab
In directory doto:/tmp/cvs-serv3597
Modified Files:
configure perl-kolab.spec perl-kolab.spec.in
Log Message:
perl-kolab is back in business
Index: configure
===================================================================
RCS file: /kolabrepository/server/perl-kolab/configure,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- configure 8 Jun 2005 12:44:35 -0000 1.1
+++ configure 30 Jun 2005 11:12:09 -0000 1.2
@@ -1,10 +1,8 @@
#!/usr/bin/env perl
-
-# -*-CPerl-*-
#
# Autoperl - a portable build system for Perl applications
#
-# Copyright 2003-2004 by Mark Heily <devel at heily.com>
+# Copyright (C) 2003-2005 by Mark Heily <devel at heily.com>
#
# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -18,17 +16,17 @@
use constant LOG_DEBUG => 0;
use constant LOG_INFO => 1;
-use constant LOG_WARNING => 2;
-use constant LOG_NOTICE => 3;
-use constant LOG_CRITICAL => 4;
+use constant LOG_NOTICE => 2;
+use constant LOG_WARNING => 3;
+use constant LOG_ERROR => 4;
BEGIN {
our @ISA = 'Exporter';
-our @EXPORT = qw(debug info warning notice critical LOG_INFO LOG_WARNING LOG_NOTICE LOG_DEBUG LOG_CRITICAL);
+our @EXPORT = qw(debug info warning notice error LOG_INFO LOG_WARNING LOG_NOTICE LOG_DEBUG LOG_ERROR);
}
our $open = 0;
-our $LOG_LEVEL = LOG_WARNING;
+our $LOG_LEVEL = LOG_NOTICE;
1;
#######################################################################
@@ -68,8 +66,9 @@
print FH "Setting log level to '$lvl'\n";
if ($lvl eq 'debug') { $LOG_LEVEL = LOG_DEBUG }
elsif ($lvl eq 'info') { $LOG_LEVEL = LOG_INFO }
- elsif ($lvl eq 'warning') { $LOG_LEVEL = LOG_WARNING }
elsif ($lvl eq 'notice') { $LOG_LEVEL = LOG_NOTICE }
+ elsif ($lvl eq 'warning') { $LOG_LEVEL = LOG_WARNING }
+ elsif ($lvl eq 'error') { $LOG_LEVEL = LOG_ERROR }
else { die "invalid log level: $lvl" }
}
@@ -78,17 +77,17 @@
my $sub = our $AUTOLOAD;
my $msg = join("\n", at _);
$msg .= "\n" unless $msg =~ /\n$/;
- if ( $sub =~ /^Autoperl::Logger::(debug|info|warning|notice|critical)$/ ) {
+ if ( $sub =~ /^Autoperl::Logger::(debug|info|warning|notice|error)$/ ) {
my $lvl = $1;
if ($lvl eq 'debug') { $lvl = LOG_DEBUG }
elsif ($lvl eq 'info') { $lvl = LOG_INFO }
elsif ($lvl eq 'warning') { $lvl = LOG_WARNING }
elsif ($lvl eq 'notice') { $lvl = LOG_NOTICE }
- elsif ($lvl eq 'critical') { $lvl = LOG_CRITICAL }
+ elsif ($lvl eq 'error') { $lvl = LOG_ERROR }
else { die "invalid logger method" }
if ( $lvl >= $LOG_LEVEL ) {
print FH $msg;
- print STDERR $msg;
+ print $msg;
}
} else {
die "Autoloaded method not found: \&$sub";
@@ -103,12 +102,10 @@
1;
#!/usr/bin/perl -I/usr/local/lib/autoperl
-
-# -*-CPerl-*-
#
# Autoperl - a portable build system for Perl applications
#
-# Copyright 2003-2004 by Mark Heily <devel at heily.com>
+# Copyright (C) 2003-2005 by Mark Heily <devel at heily.com>
#
# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -121,50 +118,84 @@
use subs qw( vprint );
-# Generated by autoperl
+BEGIN { import Autoperl; }
+BEGIN { import Autoperl::Parser; }
+BEGIN { import Autoperl::Generator; }
+BEGIN { import Autoperl::Installer; }
+BEGIN { import Autoperl::Linker; }
+BEGIN { import Autoperl::Logger; }
+BEGIN { import Autoperl::Packager; }
+
+# Generated by autoperl 1.25
unless (defined $ap::CONFIG_H) {
$ap::CONFIG_H = 1;
%ap::config = (
- 'docdir' => '/usr/local/share/doc/autoperl',
+ 'docdir' => '/usr/local/share/doc',
'mandir' => '/usr/local/man',
'pkgdatadir' => '/usr/local/share/autoperl',
- 'PERL' => '/usr/bin/perl',
'author' => 'Mark Heily <devel at heily.com>',
'program' => 'autoperl',
+ 'ovr_custom' => 'default',
'infodir' => '/usr/local/info',
- 'TEST_MULTILINE_DEFINITION' => 'one two three',
- 'sysconfdir' => '/etc',
- 'htmldir' => 'var/www',
+ 'cc' => '/usr/bin/perl -c',
+ 'sysconfdir' => '/usr/local/etc',
'bindir' => '/usr/local/bin',
- 'confdir' => '/etc/autoperl',
+ 'confdir' => '/usr/local/etc/autoperl',
'libexecdir' => '/usr/local/libexec',
+ 'make' => '/usr/bin/make',
+ 'autoperl' => '$(TOPDIR)/configure --autoperl',
'localedir' => '/usr/local/locale',
- 'version' => '1.10',
- 'cgidir' => 'usr/lib/cgi-bin',
+ 'install' => '$(TOPDIR)/configure --autoperl install -p',
+ 'version' => '1.25',
'includedir' => '/usr/local/lib/site_perl',
- 'statedir' => '/var/lib/autoperl',
+ 'statedir' => '/var/lib',
'datadir' => '/usr/local/share',
'sbindir' => '/usr/local/sbin',
- 'libdir' => '/usr/local/lib/autoperl',
- 'srcdir' => undef,
+ 'libdir' => '/usr/local/lib',
+ 'perl' => '/usr/bin/perl',
+ 'def_custom' => 'default',
+ 'ld' => '$(TOPDIR)/configure --autoperl link',
+ 'destdir' => '',
'prefix' => '/usr/local'
);
+# Allow references to $ap::foo
-# Inconvenience hashref
-$ap::config = \%ap::config;
-}
+$ap::{docdir} = sub { '/usr/local/share/doc' };
+$ap::{mandir} = sub { '/usr/local/man' };
+$ap::{pkgdatadir} = sub { '/usr/local/share/autoperl' };
+$ap::{author} = sub { 'Mark Heily <devel at heily.com>' };
+$ap::{program} = sub { 'autoperl' };
+$ap::{ovr_custom} = sub { 'default' };
+$ap::{infodir} = sub { '/usr/local/info' };
+$ap::{cc} = sub { '/usr/bin/perl -c' };
+$ap::{sysconfdir} = sub { '/usr/local/etc' };
+$ap::{bindir} = sub { '/usr/local/bin' };
+$ap::{confdir} = sub { '/usr/local/etc/autoperl' };
+$ap::{libexecdir} = sub { '/usr/local/libexec' };
+$ap::{make} = sub { '/usr/bin/make' };
+$ap::{autoperl} = sub { '$(TOPDIR)/configure --autoperl' };
+$ap::{localedir} = sub { '/usr/local/locale' };
+$ap::{install} = sub { '$(TOPDIR)/configure --autoperl install -p' };
+$ap::{version} = sub { '1.25' };
+$ap::{includedir} = sub { '/usr/local/lib/site_perl' };
+$ap::{statedir} = sub { '/var/lib' };
+$ap::{datadir} = sub { '/usr/local/share' };
+$ap::{sbindir} = sub { '/usr/local/sbin' };
+$ap::{libdir} = sub { '/usr/local/lib' };
+$ap::{perl} = sub { '/usr/bin/perl' };
+$ap::{def_custom} = sub { 'default' };
+$ap::{ld} = sub { '$(TOPDIR)/configure --autoperl link' };
+$ap::{destdir} = sub { '' };
+$ap::{prefix} = sub { '/usr/local' };
-BEGIN { import Autoperl; }
-BEGIN { import Autoperl::Parser; }
-BEGIN { import Autoperl::Generator; }
-BEGIN { import Autoperl::Installer; }
-BEGIN { import Autoperl::Linker; }
-BEGIN { import Autoperl::Logger; }
-BEGIN { import Autoperl::Packager; }
+# Allow references to $ap::config{foo} or $ap::config->{foo}
+$ap::config = \%ap::config;
+}
+1;
# Parse ARGV
my $original_action = shift @ARGV;
@@ -209,16 +240,6 @@
$ap->configure();
$log->info(Dumper($ap->{mk}));
}
-# -*-CPerl-*-
-#
-# Autoperl - a portable build system for Perl applications
-#
-# Copyright 2003-2004 by Mark Heily <devel at heily.com>
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the same terms as Perl itself.
-#
-
package Autoperl;
use strict;
@@ -254,7 +275,6 @@
my $self = shift;
return if $self->{sys}->{uname};
- print "Determining operating system type... ";
my $uname_bin = '/bin/uname';
$uname_bin = '/usr/bin/uname' unless ( -e $uname_bin );
die unless ( -e $uname_bin );
@@ -275,7 +295,7 @@
#fixme - not GNU compatible
my $hoststr = "$arch-$uname-" . $self->{sys}->{release};
$hoststr =~ tr/[A-Z]/[a-z]/;
- print "$hoststr\n";
+ notice("Determining operating system type... $hoststr");
return $host;
}
@@ -297,9 +317,8 @@
local $ENV{PATH} .= ":/sbin:/usr/sbin:/usr/local/sbin";
$bin =~ s/[^A-Za-z0-9.\-]//g;
- print "checking for $bin.. ";
chomp ( my $result = `/usr/bin/which $bin` ) ;
- print $result ? "yes" : "no", "\n";
+ notice("checking for $bin.. " . $result ? "yes" : "no" );
$ap->{mk}->{custom_arg}->{$var} = $result ? 1 : 0;
}
@@ -327,10 +346,6 @@
# Only print messages for non-pragmas
if ( $lib =~ /^[A-Z]/ ) { $silent = 0; }
- if ( not $silent ) {
- print "checking for $lib" . ($flags->{version} ? " ".$flags->{version} : "" ) . ".. ";
- }
-
# Try to load the library
eval "use $lib qw()";
my $errmsg = $@;
@@ -366,7 +381,7 @@
$result = 1;
}
- print "$answer\n" unless $silent;
+ notice("checking for $lib.. $answer");
$self->{_depends}->{$lib} = $result;
return $result;
@@ -413,6 +428,7 @@
Configuration:
-h, --help display this help and exit
+ -q, --quiet be quiet
-v, --verbose be more verbose
-vv, --very-verbose be very verbose
@@ -434,6 +450,7 @@
Compilation options:
--static do not use any shared system libraries [no]
+ --dependency-tracking require Perl library dependencies to be present [yes]
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
@@ -475,19 +492,15 @@
# Parse all sources and headers
foreach my $src ( mk_get_all_sources($mk),
- @{$mk->{headers}} ) {
-# $log->info("Marking $_ for dependency checking");
+ @{$mk->{headers}},
+ @{$mk->{bin_programs}},
+ @{$mk->{sbin_programs}},
+ ) {
+ next unless -e $src;
+ info("Marking $src for dependency checking");
$ap->check_depends("$curdir/$src");
}
- # If the binaries exist, check them too
- # (Special case)
- foreach ( @{$mk->{bin_programs}}, @{$mk->{sbin_programs}}) {
- next unless -e $_;
- #$log->info("Marking $_ for dependency checking");
- $ap->check_depends("$curdir/$_");
- }
-
# Add any children to the queue
foreach my $child (keys %{$mk->{child}}) {
push @q, $mk->{child}->{$child};
@@ -582,7 +595,6 @@
our %_dep_cache;
return $_dep_cache{$target} if exists $_dep_cache{$target};
- return 1 unless $ap->{dependency_tracking};
return $ap->check_recursive_depends($target) if -d $target;
$ap->vprint("scanning $target for library dependencies");
@@ -635,6 +647,7 @@
# Translation table
my %trans = (
'-h' => '--help',
+ '-q' => '--quiet',
'-v' => '--verbose',
'-vv' => '--very-verbose',
);
@@ -652,7 +665,8 @@
$value = 1;
}
- if ( $option =~ /^(without|disable)-(.*)/ ) {
+ # Check for option prefixes
+ if ( $option =~ /^(without|disable|no)-(.*)/ ) {
$option = $2;
$value = 0;
}
@@ -661,14 +675,19 @@
$value = 1;
}
- #FIXME-workaround
- if ( $option =~ /^disable_dependency_tracking/ ) {
- $ap->{dependency_tracking} = 0;
- }
- elsif ( $option eq 'help' ) {
- $ap->{mk}->parse_all(); # Parse custom_arg
+ # Convert the option to a Perl variable key
+ my $key = $option;
+ $key =~ s/-/_/g;
+ $key =~ tr/A-Z/a-z/;
+
+ # Check for builtin options
+ if ( $option eq 'help' ) {
+ $ap->{mk}->parse_all();
$ap->show_help();
}
+ elsif ( $option eq 'quiet' ) {
+ Autoperl::Logger::set_log_level('error');
+ }
elsif ( $option eq 'verbose' ) {
Autoperl::Logger::set_log_level('info');
}
@@ -677,8 +696,10 @@
}
elsif ( grep /^$option$/, keys %{$ap} ) {
$ap->{$option} = $value;
+ } elsif ( grep /^$key$/, keys %{$mk->{top}->{options}} ) {
+ $mk->{top}->{options}->{$key} = $value;
} else {
- $mk->{top}->{custom_arg}->{$option} = $value;
+ $mk->{top}->{custom_arg}->{$key} = $value;
}
}
1;
@@ -691,37 +712,32 @@
# for various paths.
#
sub finalize($) {
- return; #XXX-THIS IS NOW DEADWOOD
my $ap = shift;
- $ap->{pkgdatadir} = $ap->{datadir};
-
- # Some paths don't have a prefix, but have a suffix
- foreach my $path (qw(pkgdatadir confdir statedir)) {
- $ap->{$path} = '/' . $ap->{$path} . '/' . $ap->{program} . '/';
- }
-
- # Combine the prefix with the path
- foreach my $path (qw(bindir
- sbindir
- libexecdir
- datadir
- pkgdatadir
- mandir
- infodir
- localedir
- )
- ) {
- $ap->{$path} = $ap->prefix . '/' . $ap->{$path} . '/';
- }
+ $ap->{pkgdatadir} ||= $ap->{datadir} . '/' . $ap->{program};
- # Certain paths contain the name of the program (e.g. /etc/myprogram)
- foreach my $path (qw(libdir
- docdir
- )
- ) {
- $ap->{$path} = $ap->prefix . '/' . $ap->{$path} . '/' . $ap->{program} . '/';
- }
+ # Recursively expand all variables
+ #KLUDGE- copy&pasted from Ap::Generator::write_config_h
+ #TODO-generalize as a function
+ # Do this in multiple passes until there are no more candidates
+ my $found;
+ my $pass = 0;
+ do {
+ $found = 0;
+ foreach my $query (keys %{$ap}) {
+ next unless defined $query;
+ my $replace = $ap->{$query};
+ foreach my $x (keys %{$ap}) {
+ my $s = $ap->{$x};
+ #next unless defined $s and defined $x;
+ if ($s =~ /\$[\{\(]$query[\)\}]/) {
+ $ap->{$x} =~ s/\$[\{\(]$query[\}\)]/$replace/g; $found++;
+ }
+ }
+ }
+ $pass++;
+ } until $found == 0 or $pass > 200;
+ die 'infinite recursion detected' if $pass > 200;
# Remove any double slashes (//) and trailing slashes in the paths
foreach my $key (keys %{$ap}) {
@@ -752,7 +768,7 @@
$topdir =~ s/[a-zA-Z0-9\-\_\.]+/\.\./g;
}
- print "writing $target..\n";
+ notice("writing $target..");
open ( MKFILE, ">$target" ) or die $!;
print MKFILE "# Generated by\n#\n# ./configure --" . join("\n#" . ' 'x16 . '--' , at ARGV) . "\n#\n";
@@ -814,8 +830,8 @@
mandir => '${prefix}/man',
includedir => '/usr/local/lib/site_perl',
infodir => '${prefix}/info',
- confdir => '/etc/${program}',
- sysconfdir => '/etc',
+ confdir => '${prefix}/etc/${program}',
+ sysconfdir => '${prefix}/etc',
libdir => '${prefix}/lib',
docdir => '${prefix}/share/doc',
localedir => '${prefix}/locale',
@@ -824,11 +840,9 @@
# Build flags
static => 0,
verbose => 0,
- dependency_tracking => 1,
# Internal structures
mk => new Autoperl::Parser(),
- custom_arg => +{},
topdir => abs_path(getcwd),
sys => +{},
_sources => [],
@@ -866,7 +880,7 @@
my $valid = $self->{_depends}->{$lib};
push @missing, $lib unless $valid;
}
- if ( @missing and $self->{dependency_tracking}) {
+ if ( @missing and $self->{mk}->{options}->{dependency_tracking}) {
print "\nThe following libraries were not found:\n\t" .
join ("\n\t", @missing) . "\n\n";
$self->quit('aborting due to missing or broken dependencies.');
@@ -886,7 +900,7 @@
#
sub quit($$) {
my ($self,$msg) = @_;
- critical("./configure: $msg\n");
+ error("./configure: $msg\n");
debug(Dumper($self));
POSIX::_exit(1);
}
@@ -948,7 +962,7 @@
}
sub raise {
- critical("autoperl: ERROR: " . join("\n", at _));
+ error("autoperl: ERROR: " . join("\n", at _));
debug(Carp::longmess);
exit(255);
}
@@ -1037,6 +1051,12 @@
LD => '$(AUTOPERL) link',
},
+ # Built-in configuration options
+ options => +{
+ static => 0,
+ dependency_tracking => 1,
+ },
+
# User-defined ./configure --help strings
custom_arg => +{},
help_string => +{},
@@ -1133,7 +1153,6 @@
# Strip comments
$raw_line =~ s/(?!\\)(#.*?)(\\?)$//;
$raw_line .= "\\" if $2;
-
# Import Make-style targets
if ($raw_line =~ /^([a-zA-Z0-9\-\_]+?)\:\s*(.*)/) {
@@ -1148,9 +1167,9 @@
$lineno++;
while ($lineno <= $#lines and $lines[$lineno] =~ /^\t/) {
chomp ( my $s = $lines[$lineno]);
- # Strip comments
- $s =~ s/(?!\\)(#.*?)(\\?)$//;
- $s .= "\\" if $2;
+ # DEADWOOD-Strip comments
+ #$s =~ s/(?!\\)(#.*?)(\\?)$//;
+ #$s .= "\\" if $2;
debug(" >> $s");
push @{$mk->{targets}->{$cur_target}->{lines}}, $s;
@@ -1192,11 +1211,9 @@
$mk->{top}->{lc $token} = $value;
} elsif ($token =~ /_ARG$/) {
my $arg = $`;
- $arg =~ tr/_/-/;
$mk->{top}->{custom_arg}->{$arg} = $value;
} elsif ($token =~ /_ARG_HELP$/) {
my $arg = $`;
- $arg =~ tr/_/-/;
$mk->{top}->{help_string}->{$arg} = $value;
} elsif ($token =~ /(.*)_SOURCES/) {
my $binary = "$1.pl";
@@ -1280,7 +1297,7 @@
chop $s;
print "$i: |$s|\n";
}
- raise "Makefile.am:$lineno: parse error";
+ raise "$input:$lineno: parse error";
}
$line = "";
@@ -1289,7 +1306,8 @@
next;
} else {
- raise "Makefile.am:$lineno: parse error";
+ # FIXME this should never happen but breaks on innocent whitespace
+ warn "$input:$lineno: unhandled parser path ";
}
}
}
@@ -2030,11 +2048,15 @@
$cfg->{$key} = $ap->{$key};
}
- # Recursively add all custom arguments
- # Arguments from all parent directories will be merged
+ # Include all variables and custom arguments from parent Makefiles
# If an argument is defined in parent and child, child overrides
my $mk_saved = $mk;
do {
+ foreach my $key (keys %{$mk->{vars}}) {
+ next if exists $cfg->{$key};
+ $cfg->{$key} = $mk->{vars}->{$key};
+ $cfg->{$key} = 1 unless defined $cfg->{$key}
+ }
foreach my $key (keys %{$mk->{custom_arg}}) {
next if exists $cfg->{$key};
$cfg->{$key} = $mk->{custom_arg}->{$key};
@@ -2048,10 +2070,7 @@
foreach my $key (keys %{$mk->{vars}}) {
my $value = $mk->{vars}->{$key};
next if grep /^$key$/, qw( CC LD INSTALL AUTOPERL MAKE );
- if (defined $cfg->{$key}) {
- warning("Variable collision detected: $key");
- next;
- }
+ next if defined $cfg->{$key};
$cfg->{$key} = $value;
}
@@ -2078,23 +2097,31 @@
die 'infinite recursion detected' if $pass > 200;
+ # Force keys to be lower-case and replace dashes with underscores
+ foreach my $key (keys %{$cfg}) {
+ my $new_key = $key;
+ $new_key =~ tr/-/_/;
+ $new_key =~ tr/A-Z/a-z/;
+ next if $key eq $new_key;
+ $cfg->{$new_key} = $cfg->{$key};
+ delete $cfg->{$key};
+ }
+
# Save to disk
open (FH, ">$outfile") or die "$outfile: $!";
- print FH "# Generated by autoperl\n";
+ print FH "# Generated by autoperl ".$ap::config{version}."\n";
print FH "unless (defined \$ap::CONFIG_H) {\n";
print FH "\n\$ap::CONFIG_H = 1;\n";
print FH Data::Dumper->Dump([$cfg],["*ap::config"]);
- #FIXME: This creates problems when require()d multiple times
- #print FH "\n# Accessor methods\n\n";
- #print FH "eval {\n";
- #foreach my $key (keys %{$cfg}) {
- # my $val = $cfg->{$key};
- # $val = '' unless defined $val;
- # print FH "sub ap::$key { '$val' }\n";
- #}
- #print FH "};\n";
- print FH "\n\n# Inconvenience hashref\n";
+ print FH "\n# Allow references to \$ap::foo \n\n";
+ foreach my $key (keys %{$cfg}) {
+ my $val = $cfg->{$key};
+ $val = '' unless defined $val;
+ print FH '$ap::{'.$key.'} = sub { \'' .$val. "' };\n";
+ }
+
+ print FH "\n\n# Allow references to \$ap::config{foo} or \$ap::config->{foo} \n";
print FH '$ap::config = \%ap::config;' . "\n";
print FH "}\n";
@@ -2367,6 +2394,9 @@
AUTHORS COPYING NEWS README BUGS THANKS)) {
push @optional, $opt_fn if -e "$curdir/$opt_fn";
}
+foreach my $wildcard ( 'README.*' ) {
+ push @optional, glob($wildcard);
+}
if (@optional) {
print MOUT "\t\$(INSTALL) " . join(" ", at optional) . " \$(DISTDIR)\n";
}
@@ -2440,7 +2470,7 @@
if ( -d "$curdir/t") {
- print MOUT "\tcd t; \$(PERL) -e 'use Test::Harness; runtests(\@ARGV)' *.t\n";
+ print MOUT "\tcd t; for test in *.t ; do \$(PERL) \$\$test ; done\n";
}
print MOUT "\t\$(APLOCAL) 'post_make_test_hook()'\n"
@@ -2552,6 +2582,19 @@
open (my $infile, "<$fn") or die "$fn: $!";
my @buf = <$infile>;
close ($infile);
+
+ # FIXME- multiple __DATA__ tags will ruin your day
+ die "Unsupported __DATA__ tag found in $fn"
+ if grep /^__DATA__\r?\n$/, @buf;
+
+ # Remove anything after the __END__ tag
+ for (my $x = 0; $x < $#buf; $x++) {
+ if ($buf[$x] =~ /^__END__\r?\n$/) {
+ splice @buf, $x;
+ last;
+ }
+ }
+
$contents{$fn} = \@buf;
# Special case: the main module is processed last
@@ -2593,23 +2636,32 @@
# Parse @lines, looking for 'use' or 'require' statements
for (my $x = 0; $x < $#lines; $x++) {
+ next unless $lines[$x] =~ /^\s*(use|require) /;
my $line = $lines[$x];
- next unless $line =~ /^\s*(use|require) /;
- $line =~ /^\s*(use|require) \"?([A-Za-z\.0-9\_\-\:]+)\"?( ?.*);/;
- my ($method,$target,$imports) = ($1,$2,$3);
+ # Check for 'require config.h'
+ if ($line =~ /^\s*require \".*config\.h\";/ ) {
+ $lines[$x] = $config_h;
+ next;
+ } elsif ($line =~ /\s*require/) {
+ # TODO: require() is not relocatable
+ next;
+ }
+
+ # Check for 'use Foo';
+ # FIXME - doesnt handle multiline statements
+ $line =~ /^\s*use\s*([A-Za-z\.0-9\_\-\:]+)( ?.*);/;
+ my ($target,$imports) = ($1,$2);
if (not $target) {
- warn "parse error: \n$line";
+ warn "warning: parse error: \n$line";
next; #WORKAROUND
}
$imports = "" unless defined $imports;
- # Substitute config.h
- $lines[$x] = $config_h if $target eq 'config.h';
-
# Replace 'use <foo>' with 'import <foo>' for @provides
$lines[$x] = "BEGIN { import $target$imports; }\n"
if grep /$target/, @provides;
+
}
# Do sanity checks on the resulting buffer
@@ -2672,50 +2724,86 @@
#
package Autoperl::Installer;
-# Generated by autoperl
+use strict;
+
+use Getopt::Long qw(:config bundling_override);
+use Pod::Usage;
+
+use File::Copy;
+use File::Basename;
+use File::Compare;
+use File::Spec::Functions ':ALL';
+
+# Generated by autoperl 1.25
unless (defined $ap::CONFIG_H) {
$ap::CONFIG_H = 1;
%ap::config = (
- '' => 1,
- 'docdir' => '/usr/local/share/doc/autoperl',
+ 'docdir' => '/usr/local/share/doc',
'mandir' => '/usr/local/man',
'pkgdatadir' => '/usr/local/share/autoperl',
'author' => 'Mark Heily <devel at heily.com>',
'program' => 'autoperl',
+ 'ovr_custom' => 'default',
'infodir' => '/usr/local/info',
- 'sysconfdir' => 'etc',
- 'htmldir' => 'var/www',
+ 'cc' => '/usr/bin/perl -c',
+ 'sysconfdir' => '/usr/local/etc',
'bindir' => '/usr/local/bin',
- 'confdir' => '/etc/autoperl',
+ 'confdir' => '/usr/local/etc/autoperl',
'libexecdir' => '/usr/local/libexec',
+ 'make' => '/usr/bin/make',
+ 'autoperl' => '$(TOPDIR)/configure --autoperl',
'localedir' => '/usr/local/locale',
- 'version' => '0.9.4',
- 'cgidir' => 'usr/lib/cgi-bin',
+ 'install' => '$(TOPDIR)/configure --autoperl install -p',
+ 'version' => '1.25',
'includedir' => '/usr/local/lib/site_perl',
- 'statedir' => '/var/lib/autoperl',
+ 'statedir' => '/var/lib',
'datadir' => '/usr/local/share',
'sbindir' => '/usr/local/sbin',
- 'libdir' => '/usr/local/lib/autoperl',
- 'srcdir' => undef,
+ 'libdir' => '/usr/local/lib',
+ 'perl' => '/usr/bin/perl',
+ 'def_custom' => 'default',
+ 'ld' => '$(TOPDIR)/configure --autoperl link',
+ 'destdir' => '',
'prefix' => '/usr/local'
);
+# Allow references to $ap::foo
-# Inconvenience hashref
-$ap::config = \%ap::config;
-}
-
+$ap::{docdir} = sub { '/usr/local/share/doc' };
+$ap::{mandir} = sub { '/usr/local/man' };
+$ap::{pkgdatadir} = sub { '/usr/local/share/autoperl' };
+$ap::{author} = sub { 'Mark Heily <devel at heily.com>' };
+$ap::{program} = sub { 'autoperl' };
+$ap::{ovr_custom} = sub { 'default' };
+$ap::{infodir} = sub { '/usr/local/info' };
+$ap::{cc} = sub { '/usr/bin/perl -c' };
+$ap::{sysconfdir} = sub { '/usr/local/etc' };
+$ap::{bindir} = sub { '/usr/local/bin' };
+$ap::{confdir} = sub { '/usr/local/etc/autoperl' };
+$ap::{libexecdir} = sub { '/usr/local/libexec' };
+$ap::{make} = sub { '/usr/bin/make' };
+$ap::{autoperl} = sub { '$(TOPDIR)/configure --autoperl' };
+$ap::{localedir} = sub { '/usr/local/locale' };
+$ap::{install} = sub { '$(TOPDIR)/configure --autoperl install -p' };
+$ap::{version} = sub { '1.25' };
+$ap::{includedir} = sub { '/usr/local/lib/site_perl' };
+$ap::{statedir} = sub { '/var/lib' };
+$ap::{datadir} = sub { '/usr/local/share' };
+$ap::{sbindir} = sub { '/usr/local/sbin' };
+$ap::{libdir} = sub { '/usr/local/lib' };
+$ap::{perl} = sub { '/usr/bin/perl' };
+$ap::{def_custom} = sub { 'default' };
+$ap::{ld} = sub { '$(TOPDIR)/configure --autoperl link' };
+$ap::{destdir} = sub { '' };
+$ap::{prefix} = sub { '/usr/local' };
-use strict;
-use Getopt::Long qw(:config bundling_override);
-use Pod::Usage;
+# Allow references to $ap::config{foo} or $ap::config->{foo}
+$ap::config = \%ap::config;
+}
-use File::Copy;
-use File::Basename;
-use File::Compare;
-use File::Spec::Functions ':ALL';
+1;
sub makedirs;
sub install;
Index: perl-kolab.spec
===================================================================
RCS file: /kolabrepository/server/perl-kolab/perl-kolab.spec,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- perl-kolab.spec 30 Jun 2005 08:57:54 -0000 1.93
+++ perl-kolab.spec 30 Jun 2005 11:12:09 -0000 1.94
@@ -59,7 +59,8 @@
%build
- %{configure}
+ %{configure} --prefix=@l_prefix@ \
+ --includedir=%{perl_sitearch}
make
%install
Index: perl-kolab.spec.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/perl-kolab.spec.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- perl-kolab.spec.in 30 Jun 2005 09:03:35 -0000 1.4
+++ perl-kolab.spec.in 30 Jun 2005 11:12:09 -0000 1.5
@@ -59,7 +59,7 @@
%build
- %{configure} \
+ %{configure} --prefix=@l_prefix@ \
--includedir=%{perl_sitearch}
make
More information about the commits
mailing list