Installing 'config' file with port
Wesley Shields
wxs at FreeBSD.org
Mon Mar 2 10:55:54 PST 2009
On Mon, Mar 02, 2009 at 06:58:57PM +0100, Torfinn Ingolfsen wrote:
> Hello,
>
> On Mon, Mar 2, 2009 at 3:02 PM, Jerry <gesbbb at 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:
> > ? ?@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
More information about the freebsd-ports
mailing list