Subject: Re: databases/freetds
To: None <tech-pkg@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: tech-pkg
Date: 11/09/2002 18:45:42
On Sat, 9 Nov 2002 14:22:35 -0800, "Johnny C. Lam" <jlam@netbsd.org>
wrote:
> On Sat, Nov 09, 2002 at 12:30:32PM -0500, James K. Lowden wrote:
> > 
> > ... the files are installed in /usr/pkg/freetds/*,
> > which I think is wrong.  That seems to be driven by
> > "GNU_CONFIGURE_PREFIX=
> >   ${PREFIX}/freetds" in the Makefile.  
> > 
> The package has installed into ${PREFIX}/freetds since it was created. 
> I would like to see it move into ${PREFIX}, but I'm not the maintainer,
> and I don't know too much about the package, so I don't feel qualified
> to make that decision.

Greetings, Johnny, and thanks.  

I can shed some light.  Prior to version 0.60, FreeTDS's default --prefix
(in the configure script) was "/usr/local/freetds".  Partly that's a
linuxy thing, partly the notion was you could uninstall it by just nuking
that directory, and partly FreeTDS was perpetuating Sybase's directory
scheme.  I whined about documenting the nonstandard behavior (you have to
putz with ldconfig), and suggested /usr/local instead.  And that's what we
did.  

The maintainer is tsarna.  I don't recognize the name from the list.  Must
be a compentent lurker, though, because the NetBSD package followed the
general release by only about a month.  I'm cc'ing him; let's see what he
says.  

> > The general question is how to affect dependencies. 
> > FreeTDS-the-package depends on libiconv-1.8.  FreeTDS-the-library
> > doesn't.  It can use libiconv, or not, and there's certainly nothing
> > in 1.8 that it requires. I know this because I hack on the project.  
> 
> We have the option of splitting freetds into freetds-lib and
> freetds-utils, with freetds-utils being the part that depends on
> libiconv.

It's the library that uses libiconv.  The low-level library, libtds,
communicates with Microsoft servers using Unicode UCS-2 encoding.  Most of
its client applications OTOH expect ASCII.  libtds performs the conversion
on the applications' behalf, using libiconv if so configured.  Else it
lops off the high byte and hopes for the best.  

> > I know a policy was chosen (which I don't dispute) to tell packages
> > they always need the latest
> 
> The policy is to depend on the latest version of a library package in
> which the major version of the shared library was bumped, or in which
> the ABI changed.

Thanks, that's clear now.  

> > I created ../../converters/libiconv/buildlink2.jkl.mk, which is a copy
> > of buildlink2.mk with the minimum version reduced, and changed
> > /usr/pkgsrc/databases/freetds/Makefile to include it.  Worked like a
> > charm.  
> 
> You can just set BUILDLINK_DEPENDS.iconv in databases/freetds/Makefile,
> i.e.,
> 
> 	BUILDLINK_DEPENDS.iconv=	libiconv-[0-9]*

Just insert that line somewhere before the first target?  Where can I
rtfm?  Buildlink is still black magic to me.  

> but if one of the programs, e.g. freetds/bin/tsql, links against
> libiconv.so, then we actually want to keep the dependency in
> textproc/libiconv/buildlink2.mk.

Does this answer that question?:

	$ ldd /usr/pkg/freetds/lib/libtds.so
	/usr/pkg/freetds/lib/libtds.so:
 	        -liconv.2 => /usr/pkg/lib/libiconv.so.2

Thanks again and regards, 

--jkl