Skip to content
Snippets Groups Projects
Commit 26668c55 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

configure: add --with-configdir option, defaults to $(sysconfdir)/knot

issue #64
parent 5c053845
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,12 @@ AC_ARG_WITH([storage], ...@@ -177,6 +177,12 @@ AC_ARG_WITH([storage],
[storage_dir=$withval]) [storage_dir=$withval])
AC_SUBST(storage_dir) AC_SUBST(storage_dir)
config_dir="${sysconfdir}/knot"
AC_ARG_WITH([configdir],
AC_HELP_STRING([--with-configdir=path], [Default directory for configuration. [default=$(sysconfdir)/knot]]),
[config_dir=$withval])
AC_SUBST(config_dir)
# Checks for libraries. # Checks for libraries.
# FIXME: Replace `main' with a function in `-lm': # FIXME: Replace `main' with a function in `-lm':
......
...@@ -3,7 +3,8 @@ edit = sed \ ...@@ -3,7 +3,8 @@ edit = sed \
-e 's|@package[@]|$(PACKAGE_NAME)|g' \ -e 's|@package[@]|$(PACKAGE_NAME)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \ -e 's|@prefix[@]|$(prefix)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@config_dir[@]|$(config_dir)|g'
knot.sample.conf: knot.sample.conf.in knot.sample.conf: knot.sample.conf.in
rm -f $@ $@.tmp rm -f $@ $@.tmp
...@@ -15,16 +16,16 @@ knot.sample.conf: knot.sample.conf.in ...@@ -15,16 +16,16 @@ knot.sample.conf: knot.sample.conf.in
EXTRA_DIST = knot.sample.conf.in knot.full.conf knot.keys.conf example.com.zone EXTRA_DIST = knot.sample.conf.in knot.full.conf knot.keys.conf example.com.zone
install-data-local: knot.sample.conf install-data-local: knot.sample.conf
[ -d $(DESTDIR)/$(sysconfdir) ] || \ [ -d $(DESTDIR)/$(config_dir) ] || \
$(INSTALL) -d $(DESTDIR)/$(sysconfdir) $(INSTALL) -d $(DESTDIR)/$(config_dir)
[ -f $(DESTDIR)/$(sysconfdir)/knot.sample.conf ] || \ [ -f $(DESTDIR)/$(config_dir)/knot.sample.conf ] || \
$(INSTALL_DATA) knot.sample.conf $(srcdir)/example.com.zone $(DESTDIR)/$(sysconfdir) $(INSTALL_DATA) knot.sample.conf $(srcdir)/example.com.zone $(DESTDIR)/$(config_dir)
uninstall-local: uninstall-local:
[ -f $(DESTDIR)/$(sysconfdir)/knot.sample.conf ] && \ [ -f $(DESTDIR)/$(config_dir)/knot.sample.conf ] && \
rm -f $(DESTDIR)/$(sysconfdir)/knot.sample.conf rm -f $(DESTDIR)/$(config_dir)/knot.sample.conf
[ -f $(DESTDIR)/$(sysconfdir)/example.com.zone ] && \ [ -f $(DESTDIR)/$(config_dir)/example.com.zone ] && \
rm -f $(DESTDIR)/$(sysconfdir)/example.com.zone rm -f $(DESTDIR)/$(config_dir)/example.com.zone
clean-local: clean-local:
rm -f knot.sample.conf rm -f knot.sample.conf
...@@ -61,7 +61,7 @@ control { ...@@ -61,7 +61,7 @@ control {
zones { zones {
# Example master zone # Example master zone
# example.com { # example.com {
# file "@sysconfdir@/example.com.zone"; # file "@config_dir@/example.com.zone";
# xfr-out slave0; # xfr-out slave0;
# notify-out slave0; # notify-out slave0;
# } # }
......
...@@ -8,8 +8,8 @@ noinst_LTLIBRARIES = libknot.la libknotd.la libknots.la libzscanner.la ...@@ -8,8 +8,8 @@ noinst_LTLIBRARIES = libknot.la libknotd.la libknots.la libzscanner.la
# $(YACC) will generate header file # $(YACC) will generate header file
AM_CPPFLAGS = -I$(top_srcdir)/src/libknot -DSYSCONFDIR='"$(sysconfdir)"' \ AM_CPPFLAGS = -I$(top_srcdir)/src/libknot -DSYSCONFDIR='"$(sysconfdir)"' \
-DSBINDIR='"$(sbindir)"' -DSTORAGE_DIR='"${storage_dir}"' \ -DSBINDIR='"$(sbindir)"' -DCONFIG_DIR='"${config_dir}"' \
-DRUN_DIR='"${run_dir}"' -DSTORAGE_DIR='"${storage_dir}"' -DRUN_DIR='"${run_dir}"'
AM_YFLAGS = -d AM_YFLAGS = -d
libknotd_la_YFLAGS = -pcf_ -d libknotd_la_YFLAGS = -pcf_ -d
libknotd_la_LFLAGS = # TODO: reentrant parser, prefix libknotd_la_LFLAGS = # TODO: reentrant parser, prefix
...@@ -316,5 +316,6 @@ zscanner_tool_LDADD = libknots.la libknot.la libknotd.la libzscanner.la @LIBOBJS ...@@ -316,5 +316,6 @@ zscanner_tool_LDADD = libknots.la libknot.la libknotd.la libzscanner.la @LIBOBJS
# Create storage and run-time directories # Create storage and run-time directories
install-data-hook: install-data-hook:
$(INSTALL) -d $(DESTDIR)/@config_dir@
$(INSTALL) -d $(DESTDIR)/@run_dir@ $(INSTALL) -d $(DESTDIR)/@run_dir@
$(INSTALL) -d $(DESTDIR)/@storage_dir@ $(INSTALL) -d $(DESTDIR)/@storage_dir@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment