~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/perl/BerkeleyDB/Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! perl -w
2
 
 
3
 
# It should not be necessary to edit this file. The configuration for
4
 
# BerkeleyDB is controlled from the file config.in
5
 
 
6
 
 
7
 
BEGIN { die "BerkeleyDB needs Perl 5.004_04 or greater" if $] < 5.004_04 ; }
8
 
 
9
 
use strict ;
10
 
use ExtUtils::MakeMaker ;
11
 
use Config ;
12
 
 
13
 
# Check for the presence of sfio
14
 
if ($Config{'d_sfio'}) {
15
 
   print <<EOM;
16
 
 
17
 
WARNING: Perl seems to have been built with SFIO support enabled.
18
 
         Please read the SFIO Notes in the README file.
19
 
 
20
 
EOM
21
 
}
22
 
 
23
 
my $LIB_DIR ;
24
 
my $INC_DIR ;
25
 
my $DB_NAME ;
26
 
my $LIBS ;
27
 
 
28
 
ParseCONFIG() ;
29
 
 
30
 
if (defined $DB_NAME) 
31
 
  { $LIBS = $DB_NAME }
32
 
else { 
33
 
    if ($^O eq 'MSWin32')
34
 
      { $LIBS = '-llibdb' }
35
 
    else
36
 
      { $LIBS = '-ldb' }
37
 
}
38
 
 
39
 
# OS2 is a special case, so check for it now.
40
 
my $OS2 = "" ;
41
 
$OS2 = "-DOS2" if $^O eq 'os2' ;
42
 
 
43
 
WriteMakefile(
44
 
        NAME            => 'BerkeleyDB',
45
 
        LIBS            => ["-L${LIB_DIR} $LIBS"],
46
 
        #MAN3PODS        => {},         # Pods will be built by installman. 
47
 
        INC             => "-I$INC_DIR",
48
 
        VERSION_FROM    => 'BerkeleyDB.pm',
49
 
        XSPROTOARG      => '-noprototypes',
50
 
        DEFINE          => "$OS2",
51
 
        #'macro'                => { INSTALLDIRS => 'perl' },
52
 
        'dist'          => {COMPRESS=>'gzip', SUFFIX=>'gz'},    
53
 
        ($] >= 5.005
54
 
            ? (ABSTRACT_FROM    => 'BerkeleyDB.pod',
55
 
               AUTHOR   => 'Paul Marquess <Paul.Marquess@btinternet.com>')
56
 
            : ()
57
 
        ),
58
 
        );
59
 
 
60
 
 
61
 
sub MY::postamble {
62
 
        '
63
 
$(NAME).pod:    $(NAME).pod.P t/examples.t.T t/examples3.t.T mkpod
64
 
        perl ./mkpod
65
 
 
66
 
$(NAME).xs:     typemap
67
 
        $(TOUCH) $(NAME).xs
68
 
 
69
 
Makefile:       config.in 
70
 
 
71
 
 
72
 
' ;
73
 
}
74
 
 
75
 
sub ParseCONFIG
76
 
{
77
 
    my ($k, $v) ;
78
 
    my @badkey = () ;
79
 
    my %Info = () ;
80
 
    my @Options = qw( INCLUDE LIB DBNAME ) ;
81
 
    my %ValidOption = map {$_, 1} @Options ;
82
 
    my %Parsed = %ValidOption ;
83
 
    my $CONFIG = 'config.in' ;
84
 
 
85
 
    print "Parsing $CONFIG...\n" ;
86
 
 
87
 
    # DBNAME is optional, so pretend it has been parsed.
88
 
    delete $Parsed{'DBNAME'} ;
89
 
 
90
 
    open(F, "$CONFIG") or die "Cannot open file $CONFIG: $!\n" ;
91
 
    while (<F>) {
92
 
        s/^\s*|\s*$//g ;
93
 
        next if /^\s*$/ or /^\s*#/ ;
94
 
        s/\s*#\s*$// ;
95
 
 
96
 
        ($k, $v) = split(/\s+=\s+/, $_, 2) ;
97
 
        $k = uc $k ;
98
 
        if ($ValidOption{$k}) {
99
 
            delete $Parsed{$k} ;
100
 
            $Info{$k} = $v ;
101
 
        }
102
 
        else {
103
 
            push(@badkey, $k) ;
104
 
        }
105
 
    }
106
 
    close F ;
107
 
 
108
 
    print "Unknown keys in $CONFIG ignored [@badkey]\n"
109
 
        if @badkey ;
110
 
 
111
 
    # check parsed values
112
 
    my @missing = () ;
113
 
    die "The following keys are missing from $CONFIG file: [@missing]\n" 
114
 
        if @missing = keys %Parsed ;
115
 
 
116
 
    $INC_DIR =  $ENV{'BERKELEYDB_INCLUDE'} || $Info{'INCLUDE'} ;
117
 
    $LIB_DIR =  $ENV{'BERKELEYDB_LIB'} || $Info{'LIB'} ;
118
 
    $DB_NAME = $Info{'DBNAME'} if defined $Info{'DBNAME'} ;
119
 
    print "Looks Good.\n" ;
120
 
 
121
 
}
122
 
 
123
 
# end of file Makefile.PL