From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 09:01:56 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E116106566B for ; Fri, 10 Feb 2012 09:01:56 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 81B108FC18 for ; Fri, 10 Feb 2012 09:01:55 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [IPv6:2001:8b0:151:1:fa1e:dfff:feda:c0bb]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id q1A91pYZ060034 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Fri, 10 Feb 2012 09:01:51 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: OpenDKIM Filter v2.4.3 smtp.infracaninophile.co.uk q1A91pYZ060034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1328864512; bh=6eKfXQwB10jPIv0bk5LE5e+leQs+0vWn+7ByDDK3XQg=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Cc; b=ZGf7j/dPU5O+we9EgBJWMapJ2Tnutzxh7WV4tnMeNvQqNZWTpFCB4Rd8DpOkObeiC vFLdoPdndSfuh3wV0dDPVXaNKSNO6IomQk8NegFel7eAbmqHPq2pyv0Pyz3DpmFa2Q FalIt6HBkRUSMfDrKb7mX2ypcOUjPyJPWQVbg6Rs= Message-ID: <4F34DCF8.1030003@infracaninophile.co.uk> Date: Fri, 10 Feb 2012 09:01:44 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4F34A914.3040201@a1poweruser.com> In-Reply-To: <4F34A914.3040201@a1poweruser.com> X-Enigmail-Version: 1.3.5 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig97C51F2481C597D3C5804470" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Subject: Re: How to create 2 versions of a port X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:01:56 -0000 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--