On 10/02/2012 05:20, Fbsd8 wrote:
> I maintain a port that accesses the release distribution files. Now with
> 9.0 having a different path /i386/i386 and the files being compressed
> first with tar and then again with xz I need to change the port to
> access the new layout and file format.
> 
> I would like to leave the current version in the ports as is which works
> fine with the 8.x world and add a second version that only works with
> 9.0 and newer.
> 
> Question is how do i change the port description of the current port to
> say it supports 8.x with out re-adding the complete port again?
> 
> I know I have to add the new port version that supports ge 9.0.

Not a precise analogy, but take a look at:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/p5-RT-Authen-ExternalAuth/Makefile?rev=1.8;content-type=text%2Fx-cvsweb-markup

This is an add-on module for RT which had (at the time) to adapt to the
radically different layouts between rt-3.6.x and rt-3.8.x

In your case, look at ${OSVERSION} to switch between different behaviours:

.if ${OSVERSION} >= 900000
# FreeBSD 9.x and above

...

.else
# FreeBSD 8.x and below

...

.endif

Or you can have two different ports, and just use a test on ${OSVERSION}
to say if the port is appropriate on that version:

.if ${OSVERSION} >= 900000
BROKEN= only supported for FreeBSD 8.x or below
.endif

and in the other port:

.if ${OSVERSION} < 900000
BROKEN= only supported for FreeBSD 9.x or above
.endif

        Cheers,

        Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matt...@infracaninophile.co.uk               Kent, CT11 9PW

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to