automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: make install not overwriting progname.conf


From: Robert Collins
Subject: RE: make install not overwriting progname.conf
Date: Wed, 17 Apr 2002 21:05:43 +1000

> -----Original Message-----
> From: Lucas Nussbaum [mailto:address@hidden 
> Sent: Wednesday, April 17, 2002 8:42 PM
> To: address@hidden
> Subject: make install not overwriting progname.conf
> 
> 
> Hi,
> 
> I've been unable to find out how to achieve this behaviour : 
> make installs config file in a directory if a config file 
> already exists then
>     write to progname.conf.new
>     warn the user about possible changes
> else
>     write to progname.conf
> fi

Squid does something similar...

sysconf_DATA = squid.conf.default

=== makefile.am snippet ===
install-data-local: install-sysconfDATA install-dataDATA
        @if test -f $(DESTDIR)$(sysconfdir)/squid.conf ; then \
                echo "$@ will not overwrite existing
$(DESTDIR)$(sysconfdir)/squ
id.conf" ; \
        else \
                echo "$(INSTALL_DATA) squid.conf.default
$(DESTDIR)$(sysconfdir)
/squid.conf"; \
                $(INSTALL_DATA) squid.conf.default
$(DESTDIR)$(sysconfdir)/squid
.conf; \
        fi

uninstall-local:
        @if test -f $(DESTDIR)$(sysconfdir)/squid.conf ; then \
                echo "rm -f $(DESTDIR)$(sysconfdir)/squid.conf"; \
                $(RM) -f $(DESTDIR)$(sysconfdir)/squid.conf; \
        fi

======



reply via email to

[Prev in Thread] Current Thread [Next in Thread]