From owner-freebsd-ports Sun Apr 21 17:52:57 2002 Delivered-To: freebsd-ports@freebsd.org Received: from h1.generalresources.com (h1.generalresources.com [211.21.66.250]) by hub.freebsd.org (Postfix) with ESMTP id 9383B37B400 for ; Sun, 21 Apr 2002 17:52:53 -0700 (PDT) Received: from server.tucheng.generalresources.com (int-1-253.generalresources.com [192.168.1.253]) by h1.generalresources.com (8.11.6/8.11.6) with ESMTP id g3M0qks14920; Mon, 22 Apr 2002 08:52:47 +0800 (CST) (envelope-from hsw@acm.org) Received: from x4.tucheng.generalresources.com (x4.tucheng.generalresources.com [192.168.2.4]) by server.tucheng.generalresources.com (8.11.4/8.11.4) with ESMTP id g3M0qkC44648; Mon, 22 Apr 2002 08:52:46 +0800 (CST) (envelope-from hsw@acm.org) Received: from x4.tucheng.generalresources.com (localhost [127.0.0.1]) by x4.tucheng.generalresources.com (8.12.2/8.12.2) with ESMTP id g3M0qkg6057445; Mon, 22 Apr 2002 08:52:46 +0800 (CST) (envelope-from hsw@acm.org) Message-Id: <200204220052.g3M0qkg6057445@x4.tucheng.generalresources.com> To: Henrik Motakef Cc: ports@FreeBSD.org From: Christopher Hall Reply-To: Christopher Hall Subject: Re: Configuration files In-reply-to: Message of "19 Apr 2002 18:12:05 +0200." <87g01r652i.fsf@apo.hmotakef.int> Content-transfer-encoding: 8bit Content-type: text/plain; charset=big5 X-Operating-System: FreeBSD X-Mailer: Exmh Date: Mon, 22 Apr 2002 08:52:46 +0800 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <87g01r652i.fsf@apo.hmotakef.int>, Henrik Motakef writes: >Hi. > >I am unsure about how to handle configuration files best. > >I am preparing ports for some Objective Caml libraries, some of wich >depend on something called "findlib" at build-time. Basically, findlib >keeps track of necessary compiler flags for installed libraries, like, >e.g. gtk2-config does for GTK. > >Findlib needs a configuration file to work. It is highly likely that >it will be installed as a dependency of other ports, so requiring >manual intervention, like renaming a ${PREFIX}/etc/findlib.conf.sample, >is not a good idea, scince the build of the other ports will break. > >On the other hand, the Porter's Handbook says that it's a bad idea to >install configuration files in a way that they will be deleted by >pkg_delete, which sounds reasonable. > >So, what should I do? > >- Install the config file and list it in pkg-plist >- Install the config file and don't list it in pkg-plist, eventually > with a "default" config file parallel to it How about: a) @exec to copy X.default file to X b) @unexec to cmp if X and X.default are the same, if they are rm X c) X.default is listed in pkg-plist so gets deleted by pkg_delete d) The port Makefile must also do the same copy as (a) so make install works. >It is also possible to substitute the config file with some >environment variables. However, that would make writing ports that >depend on it harder - they would have to check whether the file >already exists, and only if it doesn't, set the environment variables >accordingly. > >Any hints? Have a look at 1) net/samba/Makefile - makefile adds commands to TMPPLIST so commands can make use of Makefile macros. 2) japanese/samba/pkg-plist - commands were justs added to end of pkg-plist and only use %D. Method 1 is more flexible. >tia >Henrik > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-ports" in the body of the message > --- Christopher Hall Fax: +886-2-2795-3030 Christopher Hall Phone: +886-2-2795-5799 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message