checking gtkdbi into cvs
[gtkdbi.git] / Makefile.PL
1 #
2 #   Makefile.PL for gtkdbi
3 #    - version 0.01 - This file was created by Glade::PerlSource
4 #
5 require 5.000;
6 use ExtUtils::MakeMaker;
7 use strict;
8
9 #--- Configuration section ---
10
11 my @programs_to_install = qw();
12 #my @programs_to_install = qw(src/gtkdbi);
13
14 my @need_perl_modules = (
15     # Check for Gtk::Types rather than the Gtk supermodule
16     #   this avoids dumping MakeMaker
17     {'name'     => 'Gtk',
18     'test'      => 'Gtk::Types',
19     'version'   => '0.7000',
20     'reason'    => "implements the perl bindings to Gtk+.\n".
21                     "The module is called Gtk-Perl on CPAN or ".
22                     "module gnome-perl in the Gnome CVS"},
23
24     # Check for Gnome::Types rather than the Gnome supermodule
25     #   this avoids dumping MakeMaker
26     {'name'     => 'Gnome',
27     'test'      => 'Gnome::Types',
28     'version'   => '0.7000',
29     'reason'    => "implements the perl bindings to Gnome.\n".
30                    "It is a submodule of the Gtk-Perl package and needs to be built separately.\n".
31                    "Read the Gtk-Perl INSTALL file for details of how to do this.\n".
32                    "Glade-Perl will still work but you will not be able to \n".
33                    "use any Gnome widgets in your Glade projects"},
34     );
35 #--- End Configuration - You should not have to change anything below this line
36
37 # Allow us to suppress all program installation with the -n (library only)
38 # option.  This is for those that don't want to mess with the configuration
39 # section of this file.
40 use Getopt::Std;
41 use vars qw($opt_n);
42 unless (getopts("n")) {
43     die "Usage: $0 [-n]\n";
44 }
45 @programs_to_install = () if $opt_n;
46
47 # Check for non-standard modules that are used by this library.
48 $| = 1; # autoflush on
49 my $missing_modules = 0;
50
51 foreach my $mod (@need_perl_modules) {
52     print "Checking for $mod->{'name'}..";
53     eval "require $mod->{'test'}";
54     if ($@) {
55         $missing_modules++;
56         print " failed\n";
57         print   "-------------------------------------------------------".
58                 "\n$@\n",
59                 "$mod->{'name'} is needed, it $mod->{'reason'}\n",
60                 "We need at least version $mod->{'version'}\n".
61                 "-------------------------------------------------------\n";
62         sleep(2);  # Don't hurry too much
63     } else {
64         print " ok\n";
65     }
66 }
67
68 #--------------------------------------
69 print "-------------------------------------------------------
70 The missing modules can be obtained from CPAN. Visit
71 <URL:http://www.perl.com/CPAN/> to find a CPAN site near you.
72 -------------------------------------------------------\n\n"
73      if $missing_modules;
74
75 #--------------------------------------
76 # Last of all generate the Makefile
77 WriteMakefile(
78     'DISTNAME'     => 'gtkdbi',
79     'NAME'         => 'src',
80     'VERSION_FROM' => 'src/gtkdbiUI.pm',
81     'EXE_FILES'    => [ @programs_to_install ],
82     'clean'        => { FILES => '$(EXE_FILES)' },
83     'dist'         => { COMPRESS => 'gzip', SUFFIX => 'gz' }
84 );
85
86 package MY;
87
88 # Pass Glade-Perl version number to pod2man
89 sub manifypods
90 {
91     my $self = shift;
92     my $ver = $self->{'VERSION'} || "";
93     local($_) = $self->SUPER::manifypods(@_);
94     s/pod2mans*$/pod2man --release gtkdbi-$ver/m;
95     $_;
96 }
97
98 exit(0);
99
100 # End of Makefile.PL