diff --git a/CHANGELOG.md b/CHANGELOG.md index 5351c10a..e88aff81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,10 @@ ### API changes on existing features (you may need to change your code) +* Replaced `CLIXON_DATADIR` with two configurable options defining where Clixon installs Yang files. + * use `--with-yang-installdir=DIR` to install Clixon yang files in DIR + * use `--with-std-yang-installdir=DIR` to install standard yang files that Clixon may use in DIR + * Default is (as before) `/usr/local/share/clixon` * New clixon-config@2019-06-05.yang revision * Added: `CLICON_YANG_REGEXP, CLICON_CLI_TAB_MODE, CLICON_CLI_HIST_FILE, CLICON_CLI_HIST_SIZE, CLICON_XML_CHANGELOG, CLICON_XML_CHANGELOG_FILE`. * Renamed: `CLICON_XMLDB_CACHE` to `CLICON_DATASTORE_CACHE` and type changed. diff --git a/configure b/configure index 79ba3200..a308e81c 100755 --- a/configure +++ b/configure @@ -621,7 +621,8 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS -CLIXON_DATADIR +STD_YANG_INSTALLDIR +YANG_INSTALLDIR EGREP GREP LEXLIB @@ -637,7 +638,6 @@ wwwuser wwwdir enable_stdyangs with_restconf -RANLIB SH_SUFFIX CLIXON_DEFAULT_CONFIG INSTALLFLAGS @@ -718,6 +718,8 @@ with_restconf with_wwwuser with_configfile with_libxml2 +with_yang_installdir +with_std_yang_installdir ' ac_precious_vars='build_alias host_alias @@ -1367,6 +1369,8 @@ Optional Packages: --with-wwwuser= Set www user different from www-data --with-configfile=FILE set default path to config file --with-libxml2 use gnome/libxml2 regex engine + --with-yang-installdir=DIR Install Clixon yang files here (default: ${prefix}/share/clixon) + --with-std-yang-installdir=DIR Install standard yang files here (default: ${prefix}/share/clixon) Some influential environment variables: CC C compiler command @@ -2463,7 +2467,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - # If yes, compile apps/restconf wwwdir=/www-data @@ -4493,13 +4496,39 @@ fi done -# CLIXON_DATADIR is where clixon installs the "system" yang files in yang/Makfile -# This directory should most probably be included in each application, -# so each application designer may need to place CLIXON_DATADIR in their config -# (last in yang dir list): -# $CLIXON_DATADIR +# YANG_INSTALLDIR is where clixon installs the Clixon yang files +# (the files in in yang/clixon) +# Each application designer may need to place CLIXON_YANG_DIR in their config: +# $YANG_INSTALLDIR -CLIXON_DATADIR="${prefix}/share/clixon" +# Check whether --with-yang-installdir was given. +if test "${with_yang_installdir+set}" = set; then : + withval=$with_yang_installdir; YANG_INSTALLDIR="$withval" +else + YANG_INSTALLDIR="${prefix}/share/clixon" + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Clixon yang files are installed in ${YANG_INSTALLDIR}" >&5 +$as_echo "Clixon yang files are installed in ${YANG_INSTALLDIR}" >&6; } + +# STD_YANG_INSTALLDIR is where clixon installs standard yang files +# (the files in in yang/standard) +# that Clixon needs to run (or examples rely on). These may be retreived from +# elsewhere (eg yangmodels repo) + +# Check whether --with-std-yang-installdir was given. +if test "${with_std_yang_installdir+set}" = set; then : + withval=$with_std_yang_installdir; STD_YANG_INSTALLDIR="$withval" +else + STD_YANG_INSTALLDIR="${prefix}/share/clixon" + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Standard yang files are installed in ${STD_YANG_INSTALLDIR}" >&5 +$as_echo "Standard yang files are installed in ${STD_YANG_INSTALLDIR}" >&6; } # Default location for config file diff --git a/configure.ac b/configure.ac index ee1946d2..4fcbe5d6 100644 --- a/configure.ac +++ b/configure.ac @@ -89,7 +89,6 @@ AC_SUBST(INSTALLFLAGS) AC_SUBST(CLIXON_DEFAULT_CONFIG) AC_SUBST(LIBS) AC_SUBST(SH_SUFFIX) -AC_SUBST(RANLIB) AC_SUBST(with_restconf) # If yes, compile apps/restconf AC_SUBST(enable_stdyangs) AC_SUBST(wwwdir,/www-data) @@ -232,13 +231,29 @@ fi # AC_CHECK_FUNCS(inet_aton sigaction sigvec strlcpy strsep strndup alphasort versionsort) -# CLIXON_DATADIR is where clixon installs the "system" yang files in yang/Makfile -# This directory should most probably be included in each application, -# so each application designer may need to place CLIXON_DATADIR in their config -# (last in yang dir list): -# $CLIXON_DATADIR -AC_SUBST(CLIXON_DATADIR) -CLIXON_DATADIR="${prefix}/share/clixon" +# YANG_INSTALLDIR is where clixon installs the Clixon yang files +# (the files in in yang/clixon) +# Each application designer may need to place CLIXON_YANG_DIR in their config: +# $YANG_INSTALLDIR +AC_ARG_WITH(yang-installdir, + [ --with-yang-installdir=DIR Install Clixon yang files here (default: ${prefix}/share/clixon) ], + [YANG_INSTALLDIR="$withval"], + [YANG_INSTALLDIR="${prefix}/share/clixon"] + ) +AC_SUBST(YANG_INSTALLDIR) +AC_MSG_RESULT(Clixon yang files are installed in ${YANG_INSTALLDIR}) + +# STD_YANG_INSTALLDIR is where clixon installs standard yang files +# (the files in in yang/standard) +# that Clixon needs to run (or examples rely on). These may be retreived from +# elsewhere (eg yangmodels repo) +AC_ARG_WITH(std-yang-installdir, + [ --with-std-yang-installdir=DIR Install standard yang files here (default: ${prefix}/share/clixon) ], + [STD_YANG_INSTALLDIR="$withval"], + [STD_YANG_INSTALLDIR="${prefix}/share/clixon"] + ) +AC_SUBST(STD_YANG_INSTALLDIR) +AC_MSG_RESULT(Standard yang files are installed in ${STD_YANG_INSTALLDIR}) # Default location for config file AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${CLIXON_DEFAULT_CONFIG}",[Location for apps to find default config file]) diff --git a/yang/clixon/Makefile.in b/yang/clixon/Makefile.in index 23771a33..c982ddc2 100644 --- a/yang/clixon/Makefile.in +++ b/yang/clixon/Makefile.in @@ -38,7 +38,8 @@ bindir = @bindir@ includedir = @includedir@ datarootdir = @datarootdir@ -CLIXON_DATADIR = @CLIXON_DATADIR@ +# See also STD_YANG_INSTALLDIR for the standard yang files +YANG_INSTALLDIR = @YANG_INSTALLDIR@ YANGSPECS = clixon-config@2019-06-05.yang YANGSPECS += clixon-lib@2019-06-05.yang @@ -55,11 +56,11 @@ distclean: clean rm -f Makefile *~ .depend install: $(YANGSPECS) - install -d -m 0755 $(DESTDIR)$(CLIXON_DATADIR) - install -m 0644 $(YANGSPECS) $(DESTDIR)$(CLIXON_DATADIR) + install -d -m 0755 $(DESTDIR)$(YANG_INSTALLDIR) + install -m 0644 $(YANGSPECS) $(DESTDIR)$(YANG_INSTALLDIR) uninstall: - (cd $(DESTDIR)$(CLIXON_DATADIR); rm -rf *.yang) + (cd $(DESTDIR)$(YANG_INSTALLDIR); rm -rf *.yang) install-include: diff --git a/yang/standard/Makefile.in b/yang/standard/Makefile.in index 6da576ae..47061637 100644 --- a/yang/standard/Makefile.in +++ b/yang/standard/Makefile.in @@ -38,8 +38,8 @@ bindir = @bindir@ includedir = @includedir@ datarootdir = @datarootdir@ -# Could place them in separate standards dir? -CLIXON_DATADIR = @CLIXON_DATADIR@ +# See also YANG_INSTALLDIR for the clixon-specific yang files +STD_YANG_INSTALLDIR = @STD_YANG_INSTALLDIR@ YANGSPECS = iana-if-type@2014-05-08.yang YANGSPECS += ietf-interfaces@2018-02-20.yang @@ -61,11 +61,11 @@ distclean: clean rm -f Makefile *~ .depend install: $(YANGSPECS) - install -d -m 0755 $(DESTDIR)$(CLIXON_DATADIR) - install -m 0644 $(YANGSPECS) $(DESTDIR)$(CLIXON_DATADIR) + install -d -m 0755 $(DESTDIR)$(STD_YANG_INSTALLDIR) + install -m 0644 $(YANGSPECS) $(DESTDIR)$(STD_YANG_INSTALLDIR) uninstall: - (cd $(DESTDIR)$(CLIXON_DATADIR); rm -rf *.yang) + (cd $(DESTDIR)$(STD_YANG_INSTALLDIR); rm -rf *.yang) install-include: