From owner-freebsd-ports@FreeBSD.ORG Tue Feb 1 02:40:00 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A93E16A4CE for ; Tue, 1 Feb 2005 02:40:00 +0000 (GMT) Received: from melon.pingpong.net (82.milagro.bahnhof.net [195.178.168.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 885EC43D4C for ; Tue, 1 Feb 2005 02:39:59 +0000 (GMT) (envelope-from girgen@FreeBSD.org) Received: from localhost (localhost.pingpong.net [127.0.0.1]) by melon.pingpong.net (Postfix) with ESMTP id 116804AC2B; Tue, 1 Feb 2005 03:39:58 +0100 (CET) Received: from melon.pingpong.net ([127.0.0.1]) by localhost (melon.pingpong.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29217-03-11; Tue, 1 Feb 2005 03:39:57 +0100 (CET) Received: from palle.girgensohn.se (1-2-8-5a.asp.sth.bostream.se [82.182.157.66]) by melon.pingpong.net (Postfix) with ESMTP id 806BB4AC28; Tue, 1 Feb 2005 03:39:57 +0100 (CET) Date: Tue, 01 Feb 2005 03:39:57 +0100 From: Palle Girgensohn To: Ion-Mihai Tetcu Message-ID: <2992741329D5A6EBD8D20A79@palle.girgensohn.se> In-Reply-To: <20050131170126.43e2dc78@it.buh.tecnik93.com> References: <20050131025453.GA81974@nowhere> <20050131153816.128e4623@it.buh.tecnik93.com> <20050131170126.43e2dc78@it.buh.tecnik93.com> X-Mailer: Mulberry/3.1.6 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at pingpong.net cc: freebsd-ports@freebsd.org Subject: Re: [HEADS UP] PostgreSQL ports split into -server & -client X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2005 02:40:00 -0000 --On m=E5ndag, januari 31, 2005 17.01.26 +0200 Ion-Mihai Tetcu=20 wrote: > On Mon, 31 Jan 2005 15:51:27 +0100 > Palle Girgensohn wrote: > >> >> >> --On m=E5ndag, januari 31, 2005 15.38.16 +0200 Ion-Mihai Tetcu >> wrote: >> >> > On Mon, 31 Jan 2005 07:49:34 +0100 >> > dirk.meyer@dinoex.sub.org (Dirk Meyer) wrote: >> > >> >> Craig Boston schrieb:, >> >> >> >> > With 8.0 out and and 7.x likely continuing to be used in production >> >> > environments for quite some time, it would be nice to have a >> >> > standard way to select which combination of version and >> >> > server/client to be used (if there isn't one already; I'm about to >> >> > go look at the new ports). >> >> >> >> I used this macro in bind9-dlz/Makefile: >> >> POSTGRESQL_PORT?=3D databases/postgresql7 >> >> LIB_DEPENDS=3D pq.3:${PORTSDIR}/${POSTGRESQL_PORT} >> > >> > What about a user settable WITH_PGSQL_VER equivalent of >> > DEFAULT_PGSQL_VER like in MySQL case ? >> > >> > >> > And: I've set in my mail/dspam's Makefile: >> > ...... >> > .if defined(WITH_POSTGRESQL) >> > USE_PGSQL=3D yes >> > + WANT_PGSQL_VER=3D 99 >> > + DEFAULT_PGSQL_VER=3D 99 >> > + BROKEN_WITH_PGSQL=3D 74 >> > ....... >> > >> > and it doesn't complain, just goes on and compiles with the install >> > headers; having this installed: >> > # pkg_info -I postg\* >> > postgresql-7.4.6 The most advanced open-source database available >> > anywhere postgresql-docs-7.4.6 The PostgreSQL documentation set >> > >> > And I don't understand it, it should bark on this else: >> ># And now we are checking if we can use it >> > .if exists(${PORTSDIR}/databases/postgresql${PGSQL_VER}-client) >> > ...... >> > .else >> > BROKEN=3D "unknown PostgreSQL version: ${PGSQL_VER}" >> >> Well, in this case it is because pre.mk is loaded *before* the variables >> are set. Hmm, this seems like a bug, but it works, kind of... I would >> have believed that USE_PGSQL would not work either in this case, but it >> does. This surprises me a bit. >> >> Standard procedure is to set stuff like USE_PGSQL, WITH_PGSQL_VER and >> BROKEN_WITH_PGSQL etc *before* including . > > Maybe portlint should yes a warning if not ? > > From what I can tell, it should work when set in ENV or command line, > right ? And that would count as " before bsd.* " ? But it doesn't. > >> There is a catch-22 when using OPTIONS, though...the OPTIONS stuff is >> not competent enought, really. You need to include in >> order to read stuff from OPTIONS, but then it is too late for setting >> USE_XXX knobs... :( > > I was thinking about splitting the port in 3 slaves - one for each DB > and a master and this would serve also as a kind of workaround in this > case. > >> But you're right that it does not do exactly what I would expect in this >> case. I'll look into it tonight, > > Thanks. > Hi, I've looked at this a bit more. Here's how it works, more or less: Setting USE_PGSQL=3Dyes is equivalent to setting LIB_DEPENDS=3Dpq:${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=3D80, what = will happen? Well, you will have LIB_DEPENDS=3Dpq:${PORTSDIR}/databases/postgresql80-client Anyone just a little more than remotely familiar with the ports system=20 knows that this will not install a new postgresql version 8.0, since=20 LIB_DEPENDS will find the libpq.so (from the existing pg-7.4.6=20 installation), build and link against that lib, and then register a (false) = port dependency to the not installed postgresql80-client port instead. Maybe this is not optimal, but this is how the ports collection works. I've = designed this so that the USE_PGSQL=3Dyes normally is all you need in a = port.=20 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=20 install the default version if none is installed. It will not work=20 perfectly when you have one version installed and the port wants another.=20 It will keep your version, which is the most important part. It might fail=20 to warn that about the problem, and this is an issue I have to look into, I = guess. I have shamelessly snatched much of mysql's entry in bsd.ports.mk for the=20 USE_PGSQL knob. Using a WITH_PGSQL_VER is something I did not adopt,=20 though, partly because it is rarely needed with postgresql (most stuff=20 works on all versions) but mostly because WITH_ knobs should not go inte=20 bsd.ports.mk, IMO, they should be reserved to use in ports. There a big=20 difference between the versioniitis of mysql, a database engine has lacked=20 so many important features in very recent versions, and postgresql, where=20 most important features have been there for a long time. With mysql, the=20 need to track versions and pin down which versions work with a certain port = is so much greater. In short: If you want a certain version of postgresql, just install it and=20 you're set, everything should work fine from that point. ports only need a=20 USE_PGSQL=3Dyes. /Palle