Subject: pkg/22936: databases/php4-mysql: current setup doesn't allow easy linking against wip/mysql4
To: None <gnats-bugs@gnats.netbsd.org>
From: Michal Pasternak <dotz@irc.pl>
List: netbsd-bugs
Date: 09/24/2003 19:36:16
>Number:         22936
>Category:       pkg
>Synopsis:       databases/php4-mysql: current setup doesn't allow easy linking against wip/mysql4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 24 17:41:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Michal Pasternak
>Release:        NetBSD 1.6.1
>Organization:
drum-and-bass annoymous
>Environment:
Architecture: i386
Machine: i386
>Description:

	Currently php4-mysql builds only against mysql-3.x. MySQL is
	stable MySQL release, but it's getting more and more obsolete.

	To allow php4-mysql to be linked against mysql-4.0.x, which is, 
	at the time of this writing, available only via pkgsrc-wip, I have
	created (after receiving some clues from wiz@netbsd.org):

	- a new file: databases/php4-mysql/Makefile.common

	- diff to current databases/php4-mysql/Makefile

	- a new pkgsrc-wip package: databases/php4-mysql4/ (uncommited at the
	  time of this writing)

	Please review the diffs. 

	I have tested php4-mysql4 and it works and compiles okay.

>How-To-Repeat:

>Fix:

	3 stages.

	First, install Makefile.common in databases/php4-mysql:


----------------------------------------------------------
# $NetBSD$

PKGMODNAME=             mysql
CATEGORIES+=            databases
PKGREVISION?=           # empty

COMMENT?=               PHP4 extension for MySQL databases

USE_BUILDLINK2?=        # defined

EVAL_PREFIX+=           MYSQLDIR=mysql-client
CONFIGURE_ARGS+=        --with-${MODNAME}=shared,${MYSQLDIR}
LDFLAGS+=               -Wl,${RPATH_FLAG}${LOCALBASE}/lib/mysql
----------------------------------------------------------




	Then, apply the following diff to current databases/php4-mysql Makefile:


----------------------------------------------------------
diff -ur php4-mysql/Makefile php4-mysql-new/Makefile
--- php4-mysql/Makefile Fri Mar 14 19:37:35 2003
+++ php4-mysql-new/Makefile     Wed Sep 24 19:23:32 2003
@@ -1,17 +1,8 @@
 # $NetBSD: Makefile,v 1.7 2003/03/14 19:37:35 jlam Exp $
 
 MODNAME=               mysql
-CATEGORIES+=           databases
-PKGREVISION=           # empty
-COMMENT=               PHP4 extension for MySQL databases
 
+.include "../../databases/php4-mysql/Makefile.common"
 .include "../../www/php4/Makefile.module"
-
-USE_BUILDLINK2=                # defined
-
-EVAL_PREFIX+=          MYSQLDIR=mysql-client
-CONFIGURE_ARGS+=       --with-${MODNAME}=shared,${MYSQLDIR}
-LDFLAGS+=              -Wl,${RPATH_FLAG}${LOCALBASE}/lib/mysql
-
 .include "../../databases/mysql-client/buildlink2.mk"
 .include "../../mk/bsd.pkg.mk"
----------------------------------------------------------



	...then I can commit php4-mysql4 to pkgsrc-wip, which will consist only
	of the DESCR and Makefile:

	(notice different MODNAME and mysql4-client buildlink)

----------------------------------------------------------
# $NetBSD$

MODNAME=                mysql4

.include "../../databases/php4-mysql/Makefile.common"
.include "../../www/php4/Makefile.module"
.include "../../wip/mysql4-client/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"
----------------------------------------------------------
>Release-Note:
>Audit-Trail:
>Unformatted: