FreeBSD port of CONNECT BY patch for pgsql

Palle Girgensohn girgen at FreeBSD.org
Wed Mar 16 06:16:34 PST 2005



--On tisdag, mars 15, 2005 22.38.33 -0700 John Nielsen <john at jnielsen.net> 
wrote:

> All-
>
> I am interested in creating a FreeBSD port of PostgreSQL 8.0.1 that
> incorporates the CONNECT BY patch found here:
>
> http://gppl.moonbone.ru
>
> I have successfully compiled and installed the modified postgres on my
> system, and I'd like to save myself and others in the future the trouble
> I  went to.  Before I proceed, I have a few questions.
>
> First, am I duplicating anyone else's effort?

Not as far as I know.

> Second, what would be the best approach in structuring the port?  Mr.
> Potemkin distributes his modifications as a single diff against the
> postgres source tree.  In addition to needing this file, the port will
> also  need to add devel/bison as a build dependency due to the way the
> diff is  built and applied (I didn't have bison installed, and had to
> scratch my  head for a while on that one).

OK. Here I see a problem, we have to use a modern enough bison. It seems 
that detecting on ${LOCALBASE}/bin/bison-devel is enough? Are you sure that 
bison1875 won't work? It does work for unpatched postgresql sources.


> The procedure I followed (and the one I'd like the port to emulate) was
> this:
> fetch (including patch)
> extract
> install FreeBSD patches from existing port (make patch)
> install hier patchset
> make
> install
>
> I followed this procedure for both the client and the server, since they
> are  distinct FreeBSD ports (even though they are both built from the
> same  source tree).

I would imagine that the patches are all for the server, though? Not that 
it matters much. It does modify some header files as well, though I 
wouldn't know if they are needed for anything outside the backend anyway. 
For reasons of simplicity, the client part of the port installs *all* 
headers...


> Would it be possible to do all this as a slave port of the existing
> postgresql80?  Would it be better/easier to duplicate the existing port
> and  make changes on top of it?

My suggestion is this: Add an option to the current postgresql80-server 
port (something like "use hier patch (EXPERIMENTAL)"). When this option is 
checked, add PATCH_SITES and PATCHFILES, and probably an extra 
PKGNAMESUFFIX hier. Also, add some blurbs to README files, and perhaps 
install en extra README for this (could be practical since it could be used 
to differentiate a standard pg install from a pg-hier install, in case some 
new port you create would need this functionality).

Since the patch should probably be considered "experimental", there's 
really no need to have a port of its own, IMHO. It seems easier to just add 
an optional patch for the normal port? Maybe I'm wrong here?

Potential problem is if the hier patchset is not updated fast enough when 
postgresql is updated.

> What would be the best way to apply the patchset within the ports
> framework?   As written, the diff needs to be applied from the work
> directory rather  than the base of the source distribution directory, so
> I can't just drop it  in the port's files directory (can I?).

patch takes the -p argument, use it with -p1 or perhaps -p2 will fix this.


> Third, what's the protocol for updating the CONFLICTS of other affected
> ports?

I'm not sure I understand this question? Check porter's handbook, CONFLICTS 
takes normal shell wildcards. What other affected ports would conflict?


> And finally, what would be a good naming convention?  I've considered
> postresql_hier-server with postgresql_hier80-server as the directory name.

I'm not sure. Again, see if the Porter's handbook helps here.


> Please CC me on replies, as I'm not subscribed to ports at .
>
> Thanks!
>
> John Nielsen



Cheers,
Palle



More information about the freebsd-ports mailing list