[HEADS UP] PostgreSQL ports split into -server & -client

Ion-Mihai Tetcu itetcu at people.tecnik93.com
Mon Jan 31 19:34:51 PST 2005

 [ Palle, sorry, I forgot to cc ports@ ]

On Tue, 01 Feb 2005 03:39:57 +0100
Palle Girgensohn <girgen at FreeBSD.org> wrote:

 [ ... ]

> Hi,
> I've looked at this a bit more. Here's how it works, more or less:
> Setting USE_PGSQL=yes is equivalent to setting
> LIB_DEPENDS=pq:${PORTSDIR}/databases/postgresql${PGSQL_VER}-client
> where PGSQL_VER is
>   WANT_PGSQL_VER if set
> else
>   existing installed version of postgresql client (if it is installed)
> else
>   DEFAULT_PGSQL_VER (defaults to conservative 74)
> So, if postgresql-7.4.6 is installed, and you set WANT_PGSQL_VER=80, what 
> will happen?
> Well, you will have
> LIB_DEPENDS=pq:${PORTSDIR}/databases/postgresql80-client
> Anyone just a little more than remotely familiar with the ports system 
> knows that this will not install a new postgresql version 8.0, since 
> LIB_DEPENDS will find the libpq.so (from the existing pg-7.4.6 
> installation), 

That's way I was checking against another lib (ecpg.4) in my port to
differentiate between 73 and 74.

> build and link against that lib, and then register a (false) 
> port dependency to the not installed postgresql80-client port instead.

Maybe you should do the check like MySQL ( see _MYSQL_VER ) to prevent
this ?
> Maybe this is not optimal, but this is how the ports collection works.

I keep wondering if we shouldn't check first for the pkg-info and then
that the file actually exists or something like that. After all, we do
assume pkg information is correct.

>  I've designed this so that the USE_PGSQL=yes normally is all you need in a port. 
> Unless you specify WANT_PGSQL_VER or BROKEN_WITH_PGSQL, it will pick up the 
> installed version of postgresql and add dependencies for that version, or 
> install the default version if none is installed. It will not work 
> perfectly when you have one version installed and the port wants another. 
> It will keep your version, which is the most important part. It might fail 
> to warn that about the problem, and this is an issue I have to look into, I 
> guess.

 :-) we need a way to protect us about this; it is possible that one
port will not work (or compile) with the wrong PGSQL version; but the
LIB check, as you say, won't yield this.
> I have shamelessly snatched much of mysql's entry in bsd.ports.mk for the 
> USE_PGSQL knob. Using a WITH_PGSQL_VER is something I did not adopt, 
> though, partly because it is rarely needed with postgresql (most stuff 
> works on all versions) but mostly because WITH_ knobs should not go inte 
> bsd.ports.mk, IMO, they should be reserved to use in ports.

Well, I don't argue for the name of the knob, is its functionality that
I'm after :)

 [ ... ]

> In short: If you want a certain version of postgresql, just install it and 
> you're set, everything should work fine from that point. ports only need a 
> USE_PGSQL=yes.

Yes, no argument here. I was just trying to be user friendly.

Unregistered ;) FreeBSD "user"

More information about the freebsd-ports mailing list