Bug 152693

Summary: [patch] databases/dbf2mysql can be compiled with current MySQL client library
Product: Ports & Packages Reporter: Miroslav Lachman <000.fbsd>
Component: Individual Port(s)Assignee: Beech Rintoul <beech>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Miroslav Lachman 2010-11-30 02:10:12 UTC
The port databases/dbf2mysql has hardoced dependency on mysql-client-3.23.59.n.20050301_2 which is too old in these days and can't be compiled with newer gcc.

root@roxy dbf2mysql/# make
===>  Extracting for dbf2mysql-1.14_2
=> MD5 Checksum OK for dbf2mysql-1.14.tar.gz.
=> SHA256 Checksum OK for dbf2mysql-1.14.tar.gz.
===>  Patching for dbf2mysql-1.14_2
===>  Applying FreeBSD patches for dbf2mysql-1.14_2
===>   dbf2mysql-1.14_2 depends on shared library: mysqlclient.10 - not found
===>    Verifying install for mysqlclient.10 in /usr/ports/databases/mysql323-client
===>  mysql-client-3.23.59.n.20050301_2 obsolete and does not build with gcc4.2; use mysql 5 or later.
*** Error code 1

Stop in /usr/ports/databases/mysql323-client.
*** Error code 1

Stop in /usr/ports/databases/dbf2mysql. 



It is better to make it compilable with current versions of MySQL client library (5.0 or 5.1 for example) and use generic:

USE_MYSQL=	yes

instead of

LIB_DEPENDS=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client

Fix: The problem is first discussed here
http://lists.freebsd.org/pipermail/freebsd-ports/2010-November/064714.html

And working patch is attached. 
Now it works with MySQL 5.0.90 client library.

Patch attached with submission follows:
How-To-Repeat: Try to build and use dbf2mysql in todays systems (GCC 4.2, MySQL 5.0.x etc.)
Comment 1 Miroslav Lachman 2010-12-02 11:29:24 UTC
There are additional improvements from Debian's patch
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg787955.html

It adds support for charset settings.

But charset support is incomplete, it needs CHARACTER SET in LOAD DATA 
query:

sprintf (query, "LOAD DATA LOCAL INFILE '%s' REPLACE INTO table %s 
CHARACTER SET %s FIELDS TERMINATED BY ',' ENCLOSED BY ''''", datafile, 
table, charset);

If somebody is willing to test & committ it, I can produce the patches 
for FreeBSD ports system. Just let me know.

Miroslav Lachman
Comment 2 Beech Rintoul freebsd_committer freebsd_triage 2010-12-03 23:23:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->beech

I'll take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-12-04 21:21:18 UTC
beech       2010-12-04 21:21:14 UTC

  FreeBSD ports repository

  Modified files:
    databases/dbf2mysql  Makefile 
  Added files:
    databases/dbf2mysql/files patch-mysql2dbf.c 
  Log:
  Fix can be compiled with current MySQL client library
  
  PR:             ports/152693
  Submitted by:   Miroslav Lachman (000.fbsd@quip.cz) (maintainer)
  Approved by:    itetcu (mentor) (implicit)
  
  Revision  Changes    Path
  1.16      +1 -1      ports/databases/dbf2mysql/Makefile
  1.1       +88 -0     ports/databases/dbf2mysql/files/patch-mysql2dbf.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Beech Rintoul freebsd_committer freebsd_triage 2010-12-04 21:22:17 UTC
State Changed
From-To: open->closed

Committed, Thanks!