0

I'm wondering how to process a data template so as to install properly configurations files accordingly to "make distcheck".

For instance I try severals ways like this but either the template (here rsyslog.conf) is finally installed by "make install" or it leaks for "make distcheck".

The one bellow is based on this thread : Install data directory tree with massive number of files using automake

rsyslogdir = $(sysconfdir)/rsyslog.d
dist_rsyslog_DATA = $(name).conf

install-data-hook: rsyslog.conf
    cp rsyslog.conf $(name)$.conf
    sed $(rsyslogdir)$(name).conf -i -e \
        "s!TEMPLATE!$(name)!"

Do I have to process my template file like a source file even if it concern a configuration file ?

Thanks for your advices.

Community
  • 1
  • 1
  • 1
    The `-i` option to sed is non-standard. Using it in a Makefile.am is not a good idea. – William Pursell Dec 31 '13 at 13:35
  • 1
    "either the template is finally installed by 'make install' or it leakds for 'make distcheck'". Choose the version that makes it be installed by 'make install' and you're done. But I think you are saying that when you get a version that installs, it also causes a distcheck error, in which case you need an uninstall hook to delete the file. – William Pursell Dec 31 '13 at 13:37

1 Answers1

0

So, I continue on my first tries and it finaly works. Thanks William.

EXTRA_DIST = rsyslog.conf

rsyslogdir = $(sysconfdir)/rsyslog.d
dist_rsyslog_DATA = $(name).conf

$(name).conf: rsyslog.conf
    sed rsyslog.conf \
        -e "s!TEMPLATE!$(name)!" \
        > $@

clean-local:
    rm -f $(name).conf