Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 2009 18:58:57 +0100
From:      Torfinn Ingolfsen <tingox@gmail.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: Installing 'config' file with port
Message-ID:  <ef8c8a880903020958w4d0f999bu2d603f2904b11bba@mail.gmail.com>
In-Reply-To: <20090302090221.7948106f@scorpio>
References:  <20090302090221.7948106f@scorpio>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

On Mon, Mar 2, 2009 at 3:02 PM, Jerry <gesbbb@yahoo.com> 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:
> =A0 =A0@if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \
> =A0 =A0 =A0 =A0${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orb=
it.conf ; \
> =A0 =A0fi

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.


> First, when I write the 'config' file, do I place it under the ports
> 'files' directory and give it a ".in".

Yes, the files directory is a good place.
Why not simply call it 'application.conf' (if that is the name it will
have) or 'application.conf.sample'?


> Second, what do I have to do to get the file installed in the config
> directory?

copy it in the post-install target?

> The program does not come with a config file by default. If that should
> change, how would I go about using it instead of the one I created?

Change the port when you know the location and name of the file, perhaps?
However, if you think that distributing a config file with this
application wold be useful, perhaps you should talk to the upstream
developers and get them to include a config file?

HTH
--=20
Regards,
Torfinn Ingolfsen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ef8c8a880903020958w4d0f999bu2d603f2904b11bba>