Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2012 09:01:44 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to create 2 versions of a port
Message-ID:  <4F34DCF8.1030003@infracaninophile.co.uk>
In-Reply-To: <4F34A914.3040201@a1poweruser.com>
References:  <4F34A914.3040201@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig97C51F2481C597D3C5804470
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 10/02/2012 05:20, Fbsd8 wrote:
> I maintain a port that accesses the release distribution files. Now wit=
h
> 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.
>=20
> I would like to leave the current version in the ports as is which work=
s
> fine with the 8.x world and add a second version that only works with
> 9.0 and newer.
>=20
> 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?
>=20
> 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=3D1.8;content-type=3Dtext%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=
:

=2Eif ${OSVERSION} >=3D 900000
# FreeBSD 9.x and above

=2E..

=2Eelse
# FreeBSD 8.x and below

=2E..

=2Eendif

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

=2Eif ${OSVERSION} >=3D 900000
BROKEN=3D	only supported for FreeBSD 8.x or below
=2Eendif

and in the other port:

=2Eif ${OSVERSION} < 900000
BROKEN=3D only supported for FreeBSD 9.x or above
=2Eendif

	Cheers,

	Matthew

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


--------------enig97C51F2481C597D3C5804470
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk803P8ACgkQ8Mjk52CukIxoXgCeOVAD5HNuMI7N2FkNtqkE1S0l
X8UAoJPCjYFccT+OMNkZkt5SanJxaI90
=5bkd
-----END PGP SIGNATURE-----

--------------enig97C51F2481C597D3C5804470--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F34DCF8.1030003>