Move a bit more stuff over to the datadir (issue #6967 reported by tzafrir patch...
authorJoshua Colp <jcolp@digium.com>
Sat, 15 Apr 2006 23:37:29 +0000 (23:37 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 15 Apr 2006 23:37:29 +0000 (23:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20358 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
asterisk.c
channels/chan_iax2.c

index 4498524..1f4945c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -682,18 +682,18 @@ bininstall: all
        mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds
        mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
        mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
-       mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
-       mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
-       mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
+       mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
+       mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
+       mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
        mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-       $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-       $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+       $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
+       $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
        $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
        $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
        $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
        $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
        if [ -d contrib/firmware/iax ]; then \
-               $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+               $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
        else \
                echo "You need to do cvs update -d not just cvs update" ; \
        fi 
@@ -942,7 +942,7 @@ _uninstall:
        rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
        rm -rf $(DESTDIR)$(ASTHEADERDIR)
        rm -rf $(DESTDIR)$(ASTDATADIR)/sounds
-       rm -rf $(DESTDIR)$(ASTVARLIBDIR)/firmware
+       rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
        rm -rf $(DESTDIR)$(ASTMANDIR)/man8
        for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done
 
index 9fd9674..2db0ea6 100644 (file)
@@ -2118,9 +2118,9 @@ static void ast_readconfig(void)
                } else if (!strcasecmp(v->name, "astvarlibdir")) {
                        ast_copy_string(ast_config_AST_VAR_DIR, v->value, sizeof(ast_config_AST_VAR_DIR));
                        snprintf(ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value);
-                       snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
                } else if (!strcasecmp(v->name, "astdatadir")) {
                        ast_copy_string(ast_config_AST_DATA_DIR, v->value, sizeof(ast_config_AST_DATA_DIR));
+                       snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
                } else if (!strcasecmp(v->name, "astlogdir")) {
                        ast_copy_string(ast_config_AST_LOG_DIR, v->value, sizeof(ast_config_AST_LOG_DIR));
                } else if (!strcasecmp(v->name, "astagidir")) {
index 2727086..7a5b381 100644 (file)
@@ -1530,7 +1530,7 @@ static void reload_firmware(void)
                cur = cur->next;
        }
        /* Now that we've freed them, load the new ones */
-       snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_VAR_DIR);
+       snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_DATA_DIR);
        fwd = opendir(dir);
        if (fwd) {
                while((de = readdir(fwd))) {