From yazzy@yazzy.org  Wed Sep 10 02:29:35 2003
Return-Path: <yazzy@yazzy.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7C97716A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 10 Sep 2003 02:29:35 -0700 (PDT)
Received: from lapdance.yazzy.org (mail.wrs.no [213.236.173.130])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4D71E43FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 10 Sep 2003 02:29:34 -0700 (PDT)
	(envelope-from yazzy@yazzy.org)
Received: from lapdance (localhost [127.0.0.1])
	by lapdance.yazzy.org (Postfix) with ESMTP id BAB4C4098
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 10 Sep 2003 11:29:15 +0200 (CEST)
Message-Id: 1063186155@lapdance
Date: Wed, 10 Sep 2003 11:29:15 +0200
From: "YazzY" <yazzy@yazzy.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Support for MySQL 4.x for courier-imap-2.1.1
X-Send-Pr-Version: gtk-send-pr 0.1 
X-GNATS-Notify:

>Number:         56676
>Category:       ports
>Synopsis:       Support for MySQL 4.x for courier-imap-2.1.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    oliver
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 10 02:30:17 PDT 2003
>Closed-Date:    Wed Sep 24 07:53:57 PDT 2003
>Last-Modified:  Wed Sep 24 07:53:57 PDT 2003
>Originator:     YazzY
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
YazzY.org 
>Environment:


System: FreeBSD lapdance 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Mon Sep  8 16:58:13 CEST 2003     root@lapdance:/usr/obj/usr/src/sys/LAPDANCE i386  


>Description:


Included automatic detection of the version of installed MySQL libraries. Support for MySQL 4.x with a patch.


>How-To-Repeat:





>Fix:


--- courier-imap-2.1.1.diff begins here ---
diff -ruN courier-imap.orig/Makefile courier-imap/Makefile
--- courier-imap.orig/Makefile	Wed Sep 10 11:11:56 2003
+++ courier-imap/Makefile	Wed Sep 10 11:12:41 2003
@@ -1,6 +1,6 @@
 # New ports collection makefile for: courierimap
-# Date created:		19 Feb 2000
-# Whom:			Neil Blakey-Milner
+# Date created:         19 Feb 2000
+# Whom:                 Neil Blakey-Milner
 #
 # $FreeBSD: ports/mail/courier-imap/Makefile,v 1.57 2003/09/01 14:51:03 dinoex Exp $
 #
@@ -105,11 +105,19 @@
 CONFIGURE_ARGS+=--without-authmysql
 PLIST_SUB+=	MYSQLFLAG="@comment "
 .else
+.if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.10)
+LIB_DEPENDS+=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
+PLIST_SUB+=	MYSQLFLAG=""
+.elif exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.14)
+LIB_DEPENDS+=	mysqlclient.14:${PORTSDIR}/databases/mysql41-client
+PLIST_SUB+=	MYSQLFLAG=""
+.else
+LIB_DEPENDS+=	mysqlclient.12:${PORTSDIR}/databases/mysql40-client
+PLIST_SUB+=	MYSQLFLAG=""
+.endif
 CONFIGURE_ARGS+=--with-authmysql \
 		--with-mysql-libs=${LOCALBASE}/lib/mysql \
 		--with-mysql-includes=${LOCALBASE}/include/mysql
-LIB_DEPENDS+=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
-PLIST_SUB+=	MYSQLFLAG=""
 .endif
 
 .if !defined(WITH_POSTGRESQL)
diff -ruN courier-imap.orig/files/patch-mysql courier-imap/files/patch-mysql
--- courier-imap.orig/files/patch-mysql	Thu Jan  1 01:00:00 1970
+++ courier-imap/files/patch-mysql	Wed Sep 10 04:13:47 2003
@@ -0,0 +1,148 @@
+--- authlib/configure.orig	Wed Sep 10 00:51:36 2003
++++ authlib/configure	Wed Sep 10 01:04:27 2003
+@@ -6766,9 +6766,9 @@
+ if test "$doauthmysql" = ""
+ then
+ 	LIBS="$MYSQL_LIBS $LIBS"
+-	echo "$as_me:$LINENO: checking for mysql_connect" >&5
+-echo $ECHO_N "checking for mysql_connect... $ECHO_C" >&6
+-if test "${ac_cv_func_mysql_connect+set}" = set; then
++       echo "$as_me:$LINENO: checking for mysql_real_connect" >&5
++echo $ECHO_N "checking for mysql_real_connect... $ECHO_C" >&6
++if test "${ac_cv_func_mysql_real_connect+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+@@ -6779,7 +6779,7 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ /* System header to define __stub macros and hopefully few prototypes,
+-    which can conflict with char mysql_connect (); below.
++    which can conflict with char mysql_real_connect (); below.  */
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
+ #ifdef __STDC__
+@@ -6794,14 +6794,14 @@
+ #endif
+ /* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+-char mysql_connect ();
++char mysql_real_connect ();
+ /* The GNU C library defines this for functions which it implements
+     to always fail with ENOSYS.  Some functions are actually named
+     something starting with __ and the normal name is an alias.  */
+-#if defined (__stub_mysql_connect) || defined (__stub___mysql_connect)
++#if defined (__stub_mysql_real_connect) || defined (__stub___mysql_real_connect)
+ choke me
+ #else
+-char (*f) () = mysql_connect;
++char (*f) () = mysql_real_connect;
+ #endif
+ #ifdef __cplusplus
+ }
+@@ -6810,7 +6810,7 @@
+ int
+ main ()
+ {
+-return f != mysql_connect;
++return f != mysql_real_connect;
+   ;
+   return 0;
+ }
+@@ -6827,18 +6827,18 @@
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+-  ac_cv_func_mysql_connect=yes
++  ac_cv_func_mysql_real_connect=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+-ac_cv_func_mysql_connect=no
++ac_cv_func_mysql_real_connect=no
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_func_mysql_connect" >&5
+-echo "${ECHO_T}$ac_cv_func_mysql_connect" >&6
+-if test $ac_cv_func_mysql_connect = yes; then
++echo "$as_me:$LINENO: result: $ac_cv_func_mysql_real_connect" >&5
++echo "${ECHO_T}$ac_cv_func_mysql_real_connect" >&6
++if test $ac_cv_func_mysql_real_connect = yes; then
+   doauthmysql="yes"
+ 
+ fi
+@@ -6930,9 +6930,9 @@
+ else
+ 	saveLIBS="$LIBS"
+ 	LIBS="$MYSQL_LIBS $LIBS"
+-	echo "$as_me:$LINENO: checking for mysql_connect" >&5
+-echo $ECHO_N "checking for mysql_connect... $ECHO_C" >&6
+-if test "${ac_cv_func_mysql_connect+set}" = set; then
++	echo "$as_me:$LINENO: checking for mysql_real_connect" >&5
++echo $ECHO_N "checking for mysql_real_connect... $ECHO_C" >&6
++if test "${ac_cv_func_mysql_real_connect+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+@@ -6943,7 +6943,7 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ /* System header to define __stub macros and hopefully few prototypes,
+-    which can conflict with char mysql_connect (); below.
++    which can conflict with char mysql_real_connect (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
+ #ifdef __STDC__
+@@ -6958,14 +6958,14 @@
+ #endif
+ /* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+-char mysql_connect ();
++char mysql_real_connect ();
+ /* The GNU C library defines this for functions which it implements
+     to always fail with ENOSYS.  Some functions are actually named
+     something starting with __ and the normal name is an alias.  */
+-#if defined (__stub_mysql_connect) || defined (__stub___mysql_connect)
++#if defined (__stub_mysql_real_connect) || defined (__stub___mysql_real_connect)
+ choke me
+ #else
+-char (*f) () = mysql_connect;
++char (*f) () = mysql_real_connect;
+ #endif
+ #ifdef __cplusplus
+ }
+@@ -6974,7 +6974,7 @@
+ int
+ main ()
+ {
+-return f != mysql_connect;
++return f != mysql_real_connect;
+   ;
+   return 0;
+ }
+@@ -6991,18 +6991,18 @@
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+-  ac_cv_func_mysql_connect=yes
++  ac_cv_func_mysql_real_connect=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+-ac_cv_func_mysql_connect=no
++ac_cv_func_mysql_real_connect=no
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_func_mysql_connect" >&5
+-echo "${ECHO_T}$ac_cv_func_mysql_connect" >&6
+-if test $ac_cv_func_mysql_connect = yes; then
++echo "$as_me:$LINENO: result: $ac_cv_func_mysql_real_connect" >&5
++echo "${ECHO_T}$ac_cv_func_mysql_real_connect" >&6
++if test $ac_cv_func_mysql_real_connect = yes; then
+   AUTHMYSQL="authmysql"
+ 		HAVE_AUTHMYSQL=1
+ else

--- courier-imap-2.1.1.diff ends here ---



>Release-Note:
>Audit-Trail:

From: Clement Laforet <sheepkiller@cultdeadsheep.org>
To: "YazzY" <yazzy@yazzy.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/56676: Support for MySQL 4.x for courier-imap-2.1.1
Date: Wed, 10 Sep 2003 11:34:00 +0200

 >  CONFIGURE_ARGS+=--without-authmysql
 >  PLIST_SUB+=	MYSQLFLAG="@comment "
 >  .else
 > +.if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.10)
 > +LIB_DEPENDS+=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
 > +PLIST_SUB+=	MYSQLFLAG=""
 > +.elif exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.14)
 > +LIB_DEPENDS+=	mysqlclient.14:${PORTSDIR}/databases/mysql41-client
 > +PLIST_SUB+=	MYSQLFLAG=""
 > +.else
 > +LIB_DEPENDS+=	mysqlclient.12:${PORTSDIR}/databases/mysql40-client
 > +PLIST_SUB+=	MYSQLFLAG=""
 > +.endif
 
 You should use USE_MYSQL :-)
 .else
 USE_MYSQL=	yes
 PLIST_SUB+=	MYSQLFLAG=""
 
 regards,
 clem
Responsible-Changed-From-To: freebsd-ports-bugs->oliver 
Responsible-Changed-By: oliver 
Responsible-Changed-When: Sun Sep 21 10:59:52 PDT 2003 
Responsible-Changed-Why:  
mine! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56676 
State-Changed-From-To: open->closed 
State-Changed-By: oliver 
State-Changed-When: Wed Sep 24 07:53:47 PDT 2003 
State-Changed-Why:  
committed, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56676 
>Unformatted:
