aboutsummaryrefslogtreecommitdiff
path: root/net/ruby-ldap
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2009-02-19 19:38:02 +0000
committerStanislav Sedov <stas@FreeBSD.org>2009-02-19 19:38:02 +0000
commitc139b6c7a9612050946143c63e31d8076d0370cb (patch)
tree0751c099c8e5b533b455304fa31335aa5d24af15 /net/ruby-ldap
parent6b315feb08ef94d54a49148359c03e537e10fed9 (diff)
downloadports-c139b6c7a9612050946143c63e31d8076d0370cb.tar.gz
ports-c139b6c7a9612050946143c63e31d8076d0370cb.zip
Notes
Diffstat (limited to 'net/ruby-ldap')
-rw-r--r--net/ruby-ldap/Makefile21
-rw-r--r--net/ruby-ldap/files/extra::patch-conn.c48
-rw-r--r--net/ruby-ldap/files/extra::patch-ldap.c25
3 files changed, 93 insertions, 1 deletions
diff --git a/net/ruby-ldap/Makefile b/net/ruby-ldap/Makefile
index e07e2ccba5a3..9e2972f5dc7c 100644
--- a/net/ruby-ldap/Makefile
+++ b/net/ruby-ldap/Makefile
@@ -34,6 +34,25 @@ IGNORE= you should set WITH_LDAP variable to openldap1, openldap2 or ldapsdk
USE_RUBY= yes
USE_RUBY_EXTCONF= yes
+.include <bsd.port.pre.mk>
+
+.if ${WITH_LDAP} == openldap2
+. if exists(${LOCALBASE}/bin/ldapwhoami)
+_OPENLDAP_VER!= ${LOCALBASE}/bin/ldapwhoami -VV 2>&1 | ${GREP} ldapwhoami | ${SED} -E 's/.*OpenLDAP: ldapwhoami (2)\.(3|4).*/\1\2/'
+. endif
+
+. if defined(_OPENLDAP_VER)
+LDAPVER= ${_OPENLDAP_VER}
+. elif defined(DEFAULT_OPENLDAP_VER)
+LDAPVER= ${DEFAULT_OPENLDAP_VER}
+. else
+LDAPVER= 24
+. endif
+. if ${LDAPVER} == 24
+EXTRA_PATCHES= ${FILESDIR}/extra::patch-ldap.c ${FILESDIR}/extra::patch-conn.c
+. endif
+.endif
+
# Configure options:
# --with-ldap specify the ldap directory
# --with-ldap-incdir specify the directory which contains ldap.h and lber.h
@@ -70,4 +89,4 @@ post-install:
${INSTALL_DATA} ${DOCS_EN:S,^,${WRKSRC}/,} ${RUBY_MODDOCDIR}/
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/net/ruby-ldap/files/extra::patch-conn.c b/net/ruby-ldap/files/extra::patch-conn.c
new file mode 100644
index 000000000000..dfd19436d93a
--- /dev/null
+++ b/net/ruby-ldap/files/extra::patch-conn.c
@@ -0,0 +1,48 @@
+--- conn.c.orig 2009-02-19 21:50:36.000000000 +0300
++++ conn.c 2009-02-19 21:52:45.000000000 +0300
+@@ -497,8 +497,20 @@
+ #ifdef LDAP_OPT_X_TLS_KEYFILE
+ case LDAP_OPT_X_TLS_KEYFILE:
+ #endif
+-#ifdef LDAP_OPT_X_TLS_PROTOCOL
+- case LDAP_OPT_X_TLS_PROTOCOL:
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL2
++ case LDAP_OPT_X_TLS_PROTOCOL_SSL2:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_SSL3:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_0:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_1:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_2:
+ #endif
+ #ifdef LDAP_OPT_X_TLS_CIPHER_SUITE
+ case LDAP_OPT_X_TLS_CIPHER_SUITE:
+@@ -627,8 +639,20 @@
+ #ifdef LDAP_OPT_X_TLS_KEYFILE
+ case LDAP_OPT_X_TLS_KEYFILE:
+ #endif
+-#ifdef LDAP_OPT_X_TLS_PROTOCOL
+- case LDAP_OPT_X_TLS_PROTOCOL:
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL2
++ case LDAP_OPT_X_TLS_PROTOCOL_SSL2:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_SSL3:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_0:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_1:
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ case LDAP_OPT_X_TLS_PROTOCOL_TLS1_2:
+ #endif
+ #ifdef LDAP_OPT_X_TLS_CIPHER_SUITE
+ case LDAP_OPT_X_TLS_CIPHER_SUITE:
diff --git a/net/ruby-ldap/files/extra::patch-ldap.c b/net/ruby-ldap/files/extra::patch-ldap.c
new file mode 100644
index 000000000000..1eaefd2c6783
--- /dev/null
+++ b/net/ruby-ldap/files/extra::patch-ldap.c
@@ -0,0 +1,25 @@
+--- ldap.c.orig 2009-02-19 21:53:02.000000000 +0300
++++ ldap.c 2009-02-19 21:53:58.000000000 +0300
+@@ -420,8 +420,20 @@
+ #ifdef LDAP_OPT_X_TLS
+ rb_ldap_define_opt (LDAP_OPT_X_TLS);
+ #endif
+-#ifdef LDAP_OPT_X_TLS_PROTOCOL
+- rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL);
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL2
++ rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL_SSL2);
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_SSL3
++ rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL_SSL3);
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_TLS1_0
++ rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL_TLS1_0);
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_TLS1_1
++ rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL_TLS1_1);
++#endif
++#ifdef LDAP_OPT_X_TLS_PROTOCOL_TLS1_2
++ rb_ldap_define_opt (LDAP_OPT_X_TLS_PROTOCOL_TLS1_2);
+ #endif
+ #ifdef LDAP_OPT_X_TLS_CIPHER_SUITE
+ rb_ldap_define_opt (LDAP_OPT_X_TLS_CIPHER_SUITE);