Date: Mon, 22 Apr 2002 08:52:46 +0800 From: Christopher Hall <hsw@acm.org> To: Henrik Motakef <henrik.motakef@web.de> Cc: ports@FreeBSD.org Subject: Re: Configuration files Message-ID: <200204220052.g3M0qkg6057445@x4.tucheng.generalresources.com> In-Reply-To: Message of "19 Apr 2002 18:12:05 %2B0200." <87g01r652i.fsf@apo.hmotakef.int>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <hsw@generalresources.com> Fax: +886-2-2795-3030 Christopher Hall <hsw@acm.org> Phone: +886-2-2795-5799 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204220052.g3M0qkg6057445>