summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: bf6e40f7df429e7c7742a7d9d427ffb7c83f983c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use 5.006;
use ExtUtils::MakeMaker;

my $DBUS_LIBS = `pkg-config --libs dbus-glib-1`;
my $DBUS_CFLAGS = `pkg-config --cflags dbus-glib-1`;

if (!defined $DBUS_LIBS || !defined DBUS_CFLAGS) {
    die "could not run 'pkg-config' to determine compiler/linker flags for dbus-glib-1 library: $!\n";
}
if (!$DBUS_LIBS || !$DBUS_CFLAGS) {
    die "'pkg-config' didn't report any compiler/linker flags for dbus-glib-1 library\n";
}

WriteMakefile(
	      'NAME' => 'Net::DBus::GLib',
	      'VERSION_FROM' => 'lib/Net/DBus/GLib.pm',
	      'PREREQ_PM' => {
		  'Test::More'  => 0,
		  'Net::DBus' => "0.33.2",
		  'Glib' => 0,
		  },
	      'AUTHOR' => 'Daniel Berrange <dan@berrange.com>',
	      'LIBS' => [$DBUS_LIBS],
	      'DEFINE' => "-DDBUS_API_SUBJECT_TO_CHANGE",
	      'INC' => "-Wall $DBUS_CFLAGS",
              'NO_META' => 1,
	      'depend' => {
		  Net-DBus-GLib.spec => '$(VERSION_FROM)',
		  Makefile => '$(VERSION_FROM)',
	      },
	      'realclean' => {
		  FILES => 'Net-DBus-GLib.spec',
	      },
);

package MY;

sub libscan
  {
    my ($self, $path) = @_;
    ($path =~ /\~$/ || $path =~ m,/CVS/,) ? undef : $path;
  }

__END__