Skip to content

Commit fee71b4

Browse files
authored
Merge pull request ddclient#789 from rhansen/confdir
Change default location of `ddclient.conf` to `${sysconfdir}/ddclient`
2 parents 60bedd0 + 7248341 commit fee71b4

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed

ChangeLog.md

+25
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ repository history](https://github.com/ddclient/ddclient/commits/main).
55

66
## v4.0.0-rc.2 (unreleased work-in-progress)
77

8+
### Breaking changes
9+
10+
* ddclient now looks for `ddclient.conf` in `${sysconfdir}/ddclient` by
11+
default instead of `${sysconfdir}`.
12+
[#789](https://github.com/ddclient/ddclient/pull/789)
13+
14+
To retain the previous behavior, pass `'--with-confdir=${sysconfdir}'` to
15+
`configure`. For example:
16+
17+
```shell
18+
# Before v4.0.0:
19+
./configure --sysconfdir=/etc
20+
# Equivalent with v4.0.0 and later (the single quotes are intentional):
21+
./configure --sysconfdir=/etc --with-confdir='${sysconfdir}'
22+
```
23+
24+
or:
25+
26+
```shell
27+
# Before v4.0.0:
28+
./configure --sysconfdir=/etc/ddclient
29+
# Equivalent with v4.0.0 and later:
30+
./configure --sysconfdir=/etc
31+
```
32+
833
### New features
934

1035
* New `--mail-from` option to control the "From:" header of email messages.

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ $(subst_files): Makefile
2828
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
2929
-e '1 s|^#\!.*perl$$|#\!$(PERL)|g' \
3030
-e 's|@localstatedir[@]|$(localstatedir)|g' \
31+
-e 's|@confdir[@]|$(confdir)|g' \
3132
-e 's|@runstatedir[@]|$(runstatedir)|g' \
32-
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
3333
-e 's|@CURL[@]|$(CURL)|g' \
3434
"$${in}" >'$@'.tmp && \
3535
{ ! test -x "$${in}" || chmod +x '$@'.tmp; }
@@ -40,7 +40,7 @@ ddclient.conf: $(srcdir)/ddclient.conf.in
4040

4141
bin_SCRIPTS = ddclient
4242

43-
sysconf_DATA = ddclient.conf
43+
conf_DATA = ddclient.conf
4444

4545
install-data-local:
4646
$(MKDIR_P) '$(DESTDIR)$(localstatedir)'/cache/ddclient

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ operating system. See the image to the right for a list of distributions with a
105105
```shell
106106
./configure \
107107
--prefix=/usr \
108-
--sysconfdir=/etc/ddclient \
108+
--sysconfdir=/etc \
109109
--localstatedir=/var
110110
make
111111
make VERBOSE=1 check

configure.ac

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ AC_REQUIRE_AUX_FILE([tap-driver.sh])
2323
AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects parallel-tests])
2424
AM_SILENT_RULES
2525

26+
m4_define([CONFDIR_DEFAULT], [${sysconfdir}/AC_PACKAGE_NAME])
27+
AC_ARG_WITH(
28+
[confdir],
29+
[AS_HELP_STRING(
30+
[--with-confdir=DIR],
31+
m4_expand([[look for ddclient.conf in DIR @<:@default: ]CONFDIR_DEFAULT[@:>@]]))],
32+
[],
33+
# The single quotes are intentional; see:
34+
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html
35+
[with_confdir='CONFDIR_DEFAULT'])
36+
AC_SUBST([confdir], [${with_confdir}])
37+
2638
AC_PROG_MKDIR_P
2739

2840
# The Fedora Docker image doesn't come with the 'findutils' package.

ddclient.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ sub subst_var {
132132
return $subst;
133133
}
134134

135-
my $etc = subst_var('@sysconfdir@', '/etc/ddclient');
135+
my $etc = subst_var('@confdir@', '/etc/ddclient');
136136
my $cachedir = subst_var('@localstatedir@', '/var') . '/cache/ddclient';
137137
our @curl = (subst_var('@CURL@', 'curl'));
138138

0 commit comments

Comments
 (0)