File: 02_use_openldap.patch

package info (click to toggle)
libmozilla-ldap-perl 1.5.3-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 808 kB
  • sloc: perl: 4,080; ansic: 966; makefile: 51; sh: 2
file content (42 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download | duplicates (4)
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
--- libmozilla-ldap-perl-1.5.3.orig/Makefile.PL.rpm
+++ libmozilla-ldap-perl-1.5.3/Makefile.PL.rpm
@@ -53,15 +37,25 @@
 
 # name of package to use for pkg-config
 $ldappkgname = $ENV{"LDAPPKGNAME"} || "mozldap6";
-
+my ($DEFINES, $cflags, $libs);
+if (lc($ldappkgname) eq 'openldap') {
+	$cflags = `pkg-config --cflags nss`;
+	chomp($cflags);
+	$libs = `pkg-config --libs nss`;
+	chomp($libs);
+	$libs = "-lldap -llber $libs";
+	$DEFINES = "-DUSE_OPENLDAP -DUSE_SSL -DPRLDAP";
+} else {
+	$cflags = `pkg-config --cflags $ldappkgname`;
+	chomp($cflags);
+	$libs = `pkg-config --libs $ldappkgname`;
+	chomp($libs);
+	$DEFINES = "-DUSE_SSL -DPRLDAP";
+}
 print "\nPerLDAP - Perl 5 Module for LDAP\n";
 print     "================================\n";
-$cflags = `pkg-config --cflags $ldappkgname`;
-chomp($cflags);
 print "Using CFLAGS = $cflags\n";
 print     "================================\n";
-$libs = `pkg-config --libs $ldappkgname`;
-chomp($libs);
 print "Using LIBS = $libs\n";
 
 #
@@ -78,7 +78,7 @@ WriteMakefile(
 	      'INC'		=> $cflags,
 	      'LIBS'		=> [$libs],
 	      'MYEXTLIB'	=> $my_extlib,
-	      'DEFINE'		=> "-DUSE_SSL -DPRLDAP",
+	      'DEFINE'		=> $DEFINES,
 	      'XSOPT'		=> "-nolinenumbers",
 	      @extras
 );