From owner-freebsd-ports@FreeBSD.ORG Sat Apr 23 06:31:44 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 6844316A4CE for ; Sat, 23 Apr 2005 06:31:44 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2AF543D3F for ; Sat, 23 Apr 2005 06:31:43 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 2E1D851FDD; Fri, 22 Apr 2005 23:31:43 -0700 (PDT) Date: Fri, 22 Apr 2005 23:31:43 -0700 From: Kris Kennaway To: "Paul A. Hoadley" Message-ID: <20050423063143.GA96226@xor.obsecurity.org> References: <20050423062648.GE61472@bigbird.logicsquad.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <20050423062648.GE61472@bigbird.logicsquad.net> User-Agent: Mutt/1.4.2.1i cc: freebsd-ports@freebsd.org Subject: Re: Depending on other ports with OPTIONS 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: Sat, 23 Apr 2005 06:31:44 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 23, 2005 at 03:56:48PM +0930, Paul A. Hoadley wrote: > Hello, >=20 > I am currently making my first port: RefDB [1]. I have been quite > carefully reading the Porter's Handbook, and examining other ports, > and on the whole it is proceeding quite smoothly. >=20 > I am using OPTIONS in the Makefile for RefDB (a user can choose MySQL, > PostgreSQL or SQLite as the back-end DB). RefDB depends on libdbi, > and, of course, the specific libdbi-driver corresponding to the chosen > database. >=20 > Based on another port's Makefile, I have been setting RUN_DEPENDS to > check for the specific libdbi-driver. For example, if a user chooses > MySQL as the backend for RefDB, I have this: >=20 > .if defined(WITH_MYSQL) > USE_MYSQL=3D yes > RUN_DEPENDS+=3D ${LOCALBASE}/lib/dbd/libmysql.so:${PORTSDIR}/databases/li= bdbi-drivers > CONFIGURE_ARGS+=3D --with-db-server=3Dmysql > .endif >=20 > The problem is this. Say I run 'make install' for my new port, and > choose MySQL. If libdbi-drivers has never been installed, that's fine > and I can select the MySQL driver from it's options. Say I don't > install any other drivers, then run 'make deinstall clean rmconfig > install' for RefDB, but this time choose PostgreSQL as the DB from my > options. It will certainly notice that libpgsql.so is missing, and > run install in libdbi-drivers, but the options there are already saved > and obviously not re-presented. Hence libpgsql.so remains unbuilt and > uninstalled. >=20 > This must be a common problem, and I hope it's not too much of a FAQ > for the list. How can I do the equivalent of 'rmconfig install' in > libdbi-drivers when I change options when building the RefDB port? It is a FAQ, and the answer is: you can't do it that way - think about what happens if someone already had the port installed, or if they are trying to install your software from the precompiled packages. The solution is to make a slave port that enables the option you need, depend on that, and make it conflict with the other non-enabled versions of the port. Kris --jRHKVT23PllUwdXP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCaevOWry0BWjoQKURAmVkAKCmSaza2wucWrhbcdeO06FVMfWUZQCeOLxL B0uTTuSSGDDru6ubPuD2Gac= =58ke -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--