From owner-freebsd-ports@FreeBSD.ORG Mon Mar 2 18:55:33 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C721065BEB for ; Mon, 2 Mar 2009 18:55:33 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.60.158]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1578FC60 for ; Mon, 2 Mar 2009 18:55:28 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: by syn.atarininja.org (Postfix, from userid 1001) id 815C85C7D; Mon, 2 Mar 2009 13:55:27 -0500 (EST) Date: Mon, 2 Mar 2009 13:55:27 -0500 From: Wesley Shields To: Torfinn Ingolfsen Message-ID: <20090302185527.GE89771@atarininja.org> References: <20090302090221.7948106f@scorpio> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Cc: freebsd-ports@freebsd.org Subject: Re: Installing 'config' file with port X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2009 18:55:54 -0000 On Mon, Mar 02, 2009 at 06:58:57PM +0100, Torfinn Ingolfsen wrote: > Hello, > > On Mon, Mar 2, 2009 at 3:02 PM, Jerry wrote: > > I am creating a port that will install a 'config' file in the > > "/usr/local/etc" directory. Reading through the 'Porters Handbook", I > > cam across this example. > > > > post-install: > > ? ?@if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \ > > ? ? ? ?${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orbit.conf ; \ > > ? ?fi > > This is done so that the config file is not overwritten if it is > already there (think port upgrade). If the config file exists already, > just copy the *.conf.sample file without renaming it. Don't forget the corresponding part in pkg-plist so that the same thing is done when the package is used. -- WXS