Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2003 21:17:57 -0600
From:      Pete Fritchman <petef@FreeBSD.org>
To:        Tillman Hodgson <tillman@seekingfire.com>
Cc:        FreeBSD-Ports <freebsd-ports@freebsd.org>
Subject:   Re: What's the appropriate Makefile-fu to change someport.conf to someport.conf.sample? 
Message-ID:  <20031223031757.6063D1778D@sirius.firepipe.net>
In-Reply-To: Message from Tillman Hodgson <tillman@seekingfire.com>  <20031222231159.GO42615@seekingfire.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
* Mon, 22 Dec 2003 17:11:59 CST - Tillman Hodgson:
| Is the following acceptable practice?
| 
| pre-configure:
| 	@${CP} ${WRKSRC}/latd.conf ${WRKSRC}/latd.conf.sample
| 	@${SED} -i .dist -e 's/sysconf_DATA = latd.conf/sysconf_DATA = latd.con
| f.sample/' ${WRKSRC}/Makefile.in

USE_REINPLACE=	yes
[...]
post-patch:
	@${REINPLACE_CMD} -e 's/foo/bar/' ${WRKSRC}/Makefile.in

This is a good start.  But there's more to config file management; it'd
be good form to install both latd.conf + latd.conf.sample.  Upon deinstall,
cmp latd.conf and latd.conf.sample -- if they're the same, remove latd.conf,
if not - leave the user's customizations.  On install, check if latd.conf
exists (think a custom config from a previous install) -- if not, install
the .sample one.

Like I said, the editors/joe-devel port provides (what I think is) a good
example.

Thanks,

--pete



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