~ubuntu-branches/ubuntu/saucy/libfilesys-smbclient-perl/saucy

« back to all changes in this revision

Viewing changes to .pc/10_Makefile.PL.patch/Makefile.PL

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard, gregor herrmann, Nathan Handler, Ansgar Burchardt, Xavier Guimard
  • Date: 2013-01-17 06:17:42 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130117061742-8i0z4k5fhou06ce5
Tags: 3.2-1
[ gregor herrmann ]
* debian/control: Added: ${misc:Depends} to Depends: field.
* debian/control: update {versioned,alternative} (build) dependencies.

[ Nathan Handler ]
* debian/watch: Update to ignore development releases.

[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ Xavier Guimard ]
* Imported Upstream version 3.2
* Update source format to 3.0 (quilt)
* Bump Standards-Version to 3.9.4
* Use debhelper 9.20120312
* Update debian/copyright (years and format)
* Fix upstream license to Artistic or GPL-1+
* Update debian/rules to use "dh $@"
* Add description in 10_Makefile.PL.patch
* Add spelling and pod patch
* Force the use of perl_makemaker in dh
* override_dh_fixperms to change example files mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use ExtUtils::MakeMaker;
 
2
 
 
3
my ($define, $ccfl);
 
4
 
 
5
# special flag for AIX
 
6
($^O =~ m/AIX/i) ? ($ccfl = '-qcpluscmt') : ($ccfl = '');
 
7
 
 
8
# path libsmbclient.h
 
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");
 
12
 
 
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");
 
17
 
 
18
# tests demande ?
 
19
my $ans = 
 
20
  prompt("Do you want make tests ?(you will be prompted for server / \n".
 
21
           "worgroup / share / user / password to make read write access.",
 
22
           "yes");
 
23
if ($ans =~ /^y(es)?$/i) 
 
24
  {
 
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;
 
32
    close FILE;
 
33
  }
 
34
 
 
35
# Trace for debug
 
36
$ans = prompt("Compile module with trace to STDERR ?", "no");
 
37
if ($ans =~ /^y(es)?$/i) { $define = "-DVERBOSE"; }
 
38
 
 
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";
 
44
 
 
45
# Create makefile
 
46
WriteMakefile
 
47
  (
 
48
   'NAME'         => 'Filesys::SmbClient',
 
49
   'VERSION_FROM' => 'SmbClient.pm',
 
50
   'INC'          => "-I$include",
 
51
   'DEFINE'       => $define,
 
52
   'LIBS'         => ["-L$lib -lsmbclient"],
 
53
   'OBJECT'       => 'libauthSamba.o SmbClient.o',
 
54
   'CCFLAGS'      => $ccfl,
 
55
   'PREREQ_PM'    => { Test::More => 0},
 
56
   'clean' => { FILES => "*~ config.status config.log config.h config.cache .c"},
 
57
   ($] ge '5.005') ?
 
58
   (
 
59
    'AUTHOR' => 'Alain BARBET (alian@alianwebserver.com)',
 
60
    'ABSTRACT' => 'Filesys::SmbClient - Interface for access Samba filesystem with libsmclient.so'
 
61
   )
 
62
   : ()
 
63
  );
 
64
 
 
65
sub warn_user
 
66
  {
 
67
    my $file = $_[0];
 
68
    warn <<EOF;
 
69
*************************************************************
 
70
** WHAT !!!!
 
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:
 
75
 
 
76
\$ tar zxvf samba-2.2.x.tar.gz
 
77
\$ cd samba-2.2.x/source
 
78
\$ ./configure
 
79
\$ make bin/libsmbclient.so
 
80
 
 
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 
 
84
/usr/local/lib)
 
85
 
 
86
EOF
 
87
 
 
88
  }
 
89
 
 
90
sub try_to_find {
 
91
  my $name = shift;
 
92
  my @path = find_path($name);
 
93
  foreach my $d (@path) {
 
94
    if (-e "$d/$name") { return $d; }
 
95
  }
 
96
}
 
97
 
 
98
sub find_path {
 
99
  my $ext = ($_[0]=~m!\.h$! ? "include" : ( $ENV{HOSTTYPE}=~m!x86_64! ? "lib64" : "lib"));
 
100
  my $defaultsDir = { "/usr" => 1,
 
101
                      "/usr/local" => 1,
 
102
                      "/usr/local/samba" => 1,
 
103
                      "/usr/local/samba3" => 1 };
 
104
  my @pa = split(/:/, $ENV{PATH});
 
105
  my @path;
 
106
  foreach (@pa) {
 
107
    s/bin//;
 
108
    s!//!/!g;
 
109
    s!/$!!g;
 
110
    push(@path, $_."/$ext") if !$defaultsDir->{$_};
 
111
  }
 
112
  foreach (keys %$defaultsDir) { push(@path, $_."/$ext"); }
 
113
  print "I search in: ",(join "\n", @path),"\n";
 
114
  return @path;
 
115
}