What's the appropriate Makefile-fu to change someport.conf to
someport.conf.sample?
Pete Fritchman
petef at FreeBSD.org
Mon Dec 22 19:17:59 PST 2003
* 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
More information about the freebsd-ports
mailing list