1
use ExtUtils::MakeMaker;
6
($^O =~ m/AIX/i) ? ($ccfl = '-qcpluscmt') : ($ccfl = '');
9
my $include = try_to_find("libsmbclient.h");
10
$include = prompt("Where can I find libsmbclient.h ?", $include);
11
warn_user("$include/libsmbclient.h") if (!-r "$include/libsmbclient.h");
13
# path libsmbclient.so
14
my $lib = try_to_find("libsmbclient.so");
15
$lib = prompt("Where can I find libsmbclient.so ?",$lib);
16
warn_user("libsmbclient.so") if (!-r "$lib/libsmbclient.so");
20
prompt("Do you want make tests ?(you will be prompted for server / \n".
21
"worgroup / share / user / password to make read write access.",
23
if ($ans =~ /^y(es)?$/i)
25
my $server = prompt("Server ?","localhost");
26
my $share = prompt("Share ?","homes");
27
my $workgroup = prompt("Workgroup/Domain ?","");
28
my $user = prompt("Smb user ?",$ENV{'USER'});
29
my $pass = prompt("Smb password ?");
30
open(FILE,">.c") || warn "Can't create .c for test: $!\n";
31
print FILE $server,"\t",$share,"\t",$workgroup,"\t",$user,"\t",$pass;
36
$ans = prompt("Compile module with trace to STDERR ?", "no");
37
if ($ans =~ /^y(es)?$/i) { $define = "-DVERBOSE"; }
39
# Create config.h for alloca via configure
40
my $prefix = $include;
41
$prefix=$1 = $1 if $include=~m!(.*)include$!;
42
system("./configure --with-samba-prefix=$prefix") == 0
43
or die "Can't run configure:$!\n";
48
'NAME' => 'Filesys::SmbClient',
49
'VERSION_FROM' => 'SmbClient.pm',
50
'INC' => "-I$include",
52
'LIBS' => ["-L$lib -lsmbclient"],
53
'OBJECT' => 'libauthSamba.o SmbClient.o',
55
'PREREQ_PM' => { Test::More => 0},
56
'clean' => { FILES => "*~ config.status config.log config.h config.cache .c"},
59
'AUTHOR' => 'Alain BARBET (alian@alianwebserver.com)',
60
'ABSTRACT' => 'Filesys::SmbClient - Interface for access Samba filesystem with libsmclient.so'
69
*************************************************************
71
** I Can't find $file : $!.
72
*************************************************************
73
If you don't have this file you can download last version
74
of Samba on www.samba.org and do:
76
\$ tar zxvf samba-2.2.x.tar.gz
77
\$ cd samba-2.2.x/source
79
\$ make bin/libsmbclient.so
81
Then you can find libsmbclient.h in source/include directory and
82
libsmbclient.so in source/bin directory. You can then put them in
83
/usr/include and /usr/lib (or /usr/local/include and
92
my @path = find_path($name);
93
foreach my $d (@path) {
94
if (-e "$d/$name") { return $d; }
99
my $ext = ($_[0]=~m!\.h$! ? "include" : ( $ENV{HOSTTYPE}=~m!x86_64! ? "lib64" : "lib"));
100
my $defaultsDir = { "/usr" => 1,
102
"/usr/local/samba" => 1,
103
"/usr/local/samba3" => 1 };
104
my @pa = split(/:/, $ENV{PATH});
110
push(@path, $_."/$ext") if !$defaultsDir->{$_};
112
foreach (keys %$defaultsDir) { push(@path, $_."/$ext"); }
113
print "I search in: ",(join "\n", @path),"\n";