summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-05-06 21:43:50 -0400
committerAdam <Adam@anope.org>2012-05-06 21:43:50 -0400
commit675b113c3e03cf1917b2a731c21fe82b5f1f2b2b (patch)
tree6a80aaeafa829a3cef5c41c938d92ffedd1bdad8
parenteb0e07d5645c06eb034cfcfbf91883158ba9dc00 (diff)
Split up db/conf/lib/locale install directories, and allow alternate ones to be specified at runtime
-rw-r--r--CMakeLists.txt37
-rw-r--r--data/CMakeLists.txt2
-rw-r--r--docs/CMakeLists.txt2
-rw-r--r--docs/XMLRPC/XMLRPC4
-rw-r--r--include/extern.h2
-rw-r--r--language/CMakeLists.txt4
-rw-r--r--modules/CMakeLists.txt4
-rw-r--r--modules/database/db_flatfile.cpp2
-rw-r--r--modules/database/db_old.cpp2
-rw-r--r--modules/database/db_plain.cpp2
-rw-r--r--modules/extra/m_sqlite.cpp2
-rw-r--r--modules/third/language/CMakeLists.txt4
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/bin/CMakeLists.txt2
-rw-r--r--src/config.cpp2
-rw-r--r--src/init.cpp46
-rw-r--r--src/language.cpp6
-rw-r--r--src/logger.cpp2
-rw-r--r--src/main.cpp10
-rw-r--r--src/module.cpp2
-rw-r--r--src/modulemanager.cpp8
-rw-r--r--src/tools/CMakeLists.txt2
22 files changed, 101 insertions, 48 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eeaef2983..737754006 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -379,6 +379,29 @@ else(INSTDIR)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
endif(INSTDIR)
+# Set default paths for various directories if not already defined
+if(NOT BIN_DIR)
+ set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT BIN_DIR)
+if(NOT DB_DIR)
+ set(DB_DIR "${CMAKE_INSTALL_PREFIX}/data")
+endif(NOT DB_DIR)
+if(NOT DOC_DIR)
+ set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/doc")
+endif(NOT DOC_DIR)
+if(NOT CONF_DIR)
+ set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/conf")
+endif(NOT CONF_DIR)
+if(NOT LIB_DIR)
+ set(LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT LIB_DIR)
+if(NOT LOCALE_DIR)
+ set(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/locale")
+endif(NOT LOCALE_DIR)
+if(NOT LOGS_DIR)
+ set(LOGS_DIR "${CMAKE_INSTALL_PREFIX}/logs")
+endif(NOT LOGS_DIR)
+
# Version number processing
# Find all lines in src/version.sh that start with VERSION_
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
@@ -457,20 +480,20 @@ get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# At install time, create the following additional directories
-install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/backups\")")
-install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
-install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
+install(CODE "file(MAKE_DIRECTORY \"${DB_DIR}/backups\")")
+install(CODE "file(MAKE_DIRECTORY \"${LOGS_DIR}\")")
+install(CODE "file(MAKE_DIRECTORY \"${LIB_DIR}/modules/runtime\")")
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
if(NOT WIN32 AND RUNGROUP)
- install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/backups\")")
- install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
- install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${DB_DIR}/backups\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LOGS_DIR}\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LIB_DIR}/modules/runtime\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
endif(NOT WIN32 AND RUNGROUP)
# On Windows platforms, install extra files
if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
- DESTINATION bin
+ DESTINATION ${BIN_DIR}
)
endif(WIN32)
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index b2a521c95..be220d675 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -2,5 +2,5 @@
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
set(DATA example.chk botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf)
install(FILES ${DATA}
- DESTINATION data
+ DESTINATION ${CONF_DIR}
)
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 8525ecc64..082b1da0e 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -9,7 +9,7 @@ if(WIN32)
endif(IN_SOURCE)
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
install(FILES ${DOCS}
- DESTINATION docs
+ DESTINATION ${DOC_DIR}
)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
endif(WIN32)
diff --git a/docs/XMLRPC/XMLRPC b/docs/XMLRPC/XMLRPC
index f710f1502..a183af097 100644
--- a/docs/XMLRPC/XMLRPC
+++ b/docs/XMLRPC/XMLRPC
@@ -17,9 +17,9 @@ channel - Takes one parameter, a channel name, and returns real time information
user - Takes one parameter, a user name, and returns real time information regarding that user.
-XMLRPC was designed to be used with db_mysql, and will not return any information that can be pulled from the SQL
+XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
-as users and channels currently onlive. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
+as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will
be stored by Anope and the same id will be passed back in the result.
diff --git a/include/extern.h b/include/extern.h
index 09d8e69ee..29f84c850 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -43,6 +43,8 @@ E bool enc_decrypt(const Anope::string &src, Anope::string &dest);
/**** init.c ****/
+E Anope::string conf_dir, db_dir, modules_dir, locale_dir, log_dir;
+
E void introduce_user(const Anope::string &user);
E bool GetCommandLineArgument(const Anope::string &name, char shortname = 0);
E bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::string &param);
diff --git a/language/CMakeLists.txt b/language/CMakeLists.txt
index 840412f1e..26b9b40ee 100644
--- a/language/CMakeLists.txt
+++ b/language/CMakeLists.txt
@@ -29,8 +29,8 @@ if(GETTEXT_FOUND)
endif(NOT WIN32)
# Install the new language file
- install(CODE "FILE(MAKE_DIRECTORY \${CMAKE_INSTALL_PREFIX}/data/languages/${LANG_LANG}/LC_MESSAGES/)")
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION data/languages/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS})
+ install(CODE "FILE(MAKE_DIRECTORY \"${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES/\")")
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION ${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS})
endforeach(LANG_PO)
# Generate languages, depends on the mo files
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index e3156de4f..3653a59f1 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -90,7 +90,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
install(TARGETS ${SO}
- DESTINATION data/modules
+ DESTINATION ${LIB_DIR}/modules
)
endif(HAS_FUNCTION)
else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES)
@@ -190,7 +190,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
install(TARGETS ${SO}
- DESTINATION data/modules
+ DESTINATION ${LIB_DIR}/modules
)
else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION)
message(" This is not a fatal error - ${SUBDIR} will not be built.")
diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp
index 14e894e0c..45f39c26d 100644
--- a/modules/database/db_flatfile.cpp
+++ b/modules/database/db_flatfile.cpp
@@ -76,7 +76,7 @@ class DBFlatFile : public Module
void OnReload() anope_override
{
ConfigReader config;
- DatabaseFile = config.ReadValue("db_flatfile", "database", "anope.db", 0);
+ DatabaseFile = db_dir + "/" + config.ReadValue("db_flatfile", "database", "anope.db", 0);
}
EventReturn OnLoadDatabase() anope_override
diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp
index 2783a29b2..d0aceb9f3 100644
--- a/modules/database/db_old.cpp
+++ b/modules/database/db_old.cpp
@@ -264,7 +264,7 @@ static dbFILE *open_db_read(const char *service, const char *filename, int versi
int myversion;
f = new dbFILE;
- strscpy(f->filename, filename, sizeof(f->filename));
+ strscpy(f->filename, (db_dir + "/" + filename).c_str(), sizeof(f->filename));
f->mode = 'r';
fp = fopen(f->filename, "rb");
if (!fp)
diff --git a/modules/database/db_plain.cpp b/modules/database/db_plain.cpp
index 935ef95a2..7ee9a95b4 100644
--- a/modules/database/db_plain.cpp
+++ b/modules/database/db_plain.cpp
@@ -651,7 +651,7 @@ class DBPlain : public Module
void OnReload() anope_override
{
ConfigReader config;
- DatabaseFile = config.ReadValue("db_plain", "database", "anope.db", 0);
+ DatabaseFile = db_dir + "/" + config.ReadValue("db_plain", "database", "anope.db", 0);
}
EventReturn OnLoadDatabase() anope_override
diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp
index fff3e67d1..4cf66cb5f 100644
--- a/modules/extra/m_sqlite.cpp
+++ b/modules/extra/m_sqlite.cpp
@@ -105,7 +105,7 @@ class ModuleSQLite : public Module
if (this->SQLiteServices.find(connname) == this->SQLiteServices.end())
{
- Anope::string database = config.ReadValue("sqlite", "database", "anope", i);
+ Anope::string database = db_dir + "/" + config.ReadValue("sqlite", "database", "anope", i);
try
{
diff --git a/modules/third/language/CMakeLists.txt b/modules/third/language/CMakeLists.txt
index af4dd90a6..85278f5be 100644
--- a/modules/third/language/CMakeLists.txt
+++ b/modules/third/language/CMakeLists.txt
@@ -29,8 +29,8 @@ if(GETTEXT_FOUND)
endif(NOT WIN32)
# Install the new language file
- install(CODE "FILE(MAKE_DIRECTORY \${CMAKE_INSTALL_PREFIX}/data/languages/${LANG_LANG}/LC_MESSAGES/)")
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION data/languages/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS})
+ install(CODE "FILE(MAKE_DIRECTORY ${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES/)")
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION ${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS})
endforeach(LANG_PO)
# Generate languages, depends on the mo files
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 01dc44fbc..13a88bf51 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -124,5 +124,5 @@ add_subdirectory(tools)
# Set Anope to be installed to the bin directory
install(TARGETS ${PROGRAM_NAME}
- DESTINATION bin
+ DESTINATION ${BIN_DIR}
)
diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index cb110edb5..d1cdb5d06 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -2,7 +2,7 @@
if(NOT WIN32)
configure_file(${Anope_SOURCE_DIR}/src/bin/anoperc.in ${Anope_BINARY_DIR}/src/bin/anoperc)
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc
- DESTINATION bin
+ DESTINATION ${BIN_DIR}
)
endif(NOT WIN32)
diff --git a/src/config.cpp b/src/config.cpp
index 74ba31bd2..f192eb3cf 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -1064,7 +1064,7 @@ bool ConfigurationFile::IsOpen() const
bool ConfigurationFile::Open()
{
this->Close();
- this->fp = (this->executable ? popen(this->name.c_str(), "r") : fopen(this->name.c_str(), "r"));
+ this->fp = (this->executable ? popen(this->name.c_str(), "r") : fopen((conf_dir + "/" + this->name).c_str(), "r"));
return this->fp != NULL;
}
diff --git a/src/init.cpp b/src/init.cpp
index 08d4aed08..45262c1dd 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -26,6 +26,8 @@
#include <unistd.h>
#include <grp.h>
+Anope::string conf_dir = "conf", db_dir = "data", modules_dir = "lib", locale_dir = "locale", log_dir = "logs";
+
ServerConfig::Uplink *uplink_server;
void introduce_user(const Anope::string &user)
@@ -308,9 +310,13 @@ void Init(int ac, char **av)
Log(LOG_TERMINAL) << "Anope IRC Services (http://www.anope.org)";
Log(LOG_TERMINAL) << "Usage ./" << services_bin << " [options] ...";
Log(LOG_TERMINAL) << "-c, --config=filename.conf";
+ Log(LOG_TERMINAL) << " --confdir=conf file direcory";
+ Log(LOG_TERMINAL) << " --dbdir=database directory";
Log(LOG_TERMINAL) << "-d, --debug[=level]";
- Log(LOG_TERMINAL) << " --dir=services_directory";
Log(LOG_TERMINAL) << "-h, --help";
+ Log(LOG_TERMINAL) << " --localedir=locale directory";
+ Log(LOG_TERMINAL) << " --logdir=logs directory";
+ Log(LOG_TERMINAL) << " --modulesdir=modules directory";
Log(LOG_TERMINAL) << "-e, --noexpire";
Log(LOG_TERMINAL) << "-n, --nofork";
Log(LOG_TERMINAL) << " --nothird";
@@ -367,11 +373,39 @@ void Init(int ac, char **av)
services_conf = ConfigurationFile(Arg, false);
}
- if (GetCommandLineArgument("dir", 0, Arg))
+ if (GetCommandLineArgument("confdir", 0, Arg))
+ {
+ if (Arg.empty())
+ throw FatalException("The --confdir option requires a path");
+ conf_dir = Arg;
+ }
+
+ if (GetCommandLineArgument("dbdir", 0, Arg))
+ {
+ if (Arg.empty())
+ throw FatalException("The --confdir option requires a path");
+ db_dir = Arg;
+ }
+
+ if (GetCommandLineArgument("localedir", 0, Arg))
+ {
+ if (Arg.empty())
+ throw FatalException("The --localedir option requires a path");
+ locale_dir = Arg;
+ }
+
+ if (GetCommandLineArgument("modulesdir", 0, Arg))
+ {
+ if (Arg.empty())
+ throw FatalException("The --modulesdir option requires a path");
+ modules_dir = Arg;
+ }
+
+ if (GetCommandLineArgument("logdir", 0, Arg))
{
if (Arg.empty())
- throw FatalException("The --dir option requires a directory name");
- services_dir = Arg;
+ throw FatalException("The --logdir option requires a path");
+ log_dir = Arg;
}
/* Chdir to Services data directory. */
@@ -382,9 +416,9 @@ void Init(int ac, char **av)
Log(LOG_TERMINAL) << "Anope " << Anope::Version() << ", " << Anope::VersionBuildString();
#ifdef _WIN32
- Log(LOG_TERMINAL) << "Using configuration file " << services_dir << "\\" << services_conf.GetName();
+ Log(LOG_TERMINAL) << "Using configuration file " << conf_dir << "\\" << services_conf.GetName();
#else
- Log(LOG_TERMINAL) << "Using configuration file " << services_dir << "/" << services_conf.GetName();
+ Log(LOG_TERMINAL) << "Using configuration file " << conf_dir << "/" << services_conf.GetName();
#endif
/* Read configuration file; exit if there are problems. */
diff --git a/src/language.cpp b/src/language.cpp
index 8b680077b..2b41d755e 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -31,7 +31,7 @@ void InitLanguages()
while (sep.GetToken(language))
{
- if (!IsFile("languages/" + language + "/LC_MESSAGES/anope.mo"))
+ if (!IsFile(locale_dir + "/" + language + "/LC_MESSAGES/anope.mo"))
{
Log() << "Error loading language " << language << ", file does not exist!";
}
@@ -42,10 +42,10 @@ void InitLanguages()
}
}
- if (!bindtextdomain("anope", (services_dir + "/languages/").c_str()))
+ if (!bindtextdomain("anope", locale_dir.c_str()))
Log() << "Error calling bindtextdomain, " << Anope::LastError();
else
- Log(LOG_DEBUG) << "Successfully bound anope to " << services_dir << "/languages/";
+ Log(LOG_DEBUG) << "Successfully bound anope to " << locale_dir;
setlocale(LC_ALL, "");
#else
diff --git a/src/logger.cpp b/src/logger.cpp
index 2b27e1478..1b7c48f78 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -63,7 +63,7 @@ static Anope::string GetLogDate(time_t t = Anope::CurTime)
static inline Anope::string CreateLogName(const Anope::string &file, time_t t = Anope::CurTime)
{
- return "logs/" + file + "." + GetLogDate(t);
+ return log_dir + "/" + file + "." + GetLogDate(t);
}
LogFile::LogFile(const Anope::string &name) : filename(name), stream(name.c_str(), std::ios_base::out | std::ios_base::app)
diff --git a/src/main.cpp b/src/main.cpp
index cacfec814..e3fcb8bb2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -43,14 +43,13 @@
/* Command-line options: (note that configuration variables are in config.c) */
Anope::string services_dir; /* -dir dirname */
Anope::string services_bin; /* Binary as specified by the user */
-Anope::string orig_cwd; /* Original current working directory */
+Anope::string binary_dir; /* Used to store base path for Anope */
int debug = 0; /* -debug */
bool readonly = false; /* -readonly */
bool nofork = false; /* -nofork */
bool nothird = false; /* -nothrid */
bool noexpire = false; /* -noexpire */
bool protocoldebug = false; /* -protocoldebug */
-Anope::string binary_dir; /* Used to store base path for Anope */
/* Set to 1 if we are to quit */
bool quitting = false;
@@ -366,10 +365,6 @@ Anope::string GetFullProgDir(const Anope::string &argv0)
int main(int ac, char **av, char **envp)
{
- char cwd[PATH_MAX] = "";
- getcwd(cwd, PATH_MAX);
- orig_cwd = cwd;
-
#ifndef _WIN32
/* If we're root, issue a warning now */
if (!getuid() && !getgid())
@@ -387,11 +382,10 @@ int main(int ac, char **av, char **envp)
#ifdef _WIN32
Anope::string::size_type n = binary_dir.rfind('\\');
- services_dir = binary_dir.substr(0, n) + "\\data";
#else
Anope::string::size_type n = binary_dir.rfind('/');
- services_dir = binary_dir.substr(0, n) + "/data";
#endif
+ services_dir = binary_dir.substr(0, n);
/* Clean out the module runtime directory prior to running, just in case files were left behind during a previous run */
ModuleManager::CleanupRuntimeDirectory();
diff --git a/src/module.cpp b/src/module.cpp
index 8a253042a..c08d25aff 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -35,7 +35,7 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt
for (unsigned i = 0; i < languages.size(); ++i)
if (IsFile("languages/" + languages[i] + "/LC_MESSAGES/" + modname + ".mo"))
{
- if (!bindtextdomain(this->name.c_str(), (services_dir + "/languages/").c_str()))
+ if (!bindtextdomain(this->name.c_str(), locale_dir.c_str()))
Log() << "Error calling bindtextdomain, " << Anope::LastError();
else
domains.push_back(modname);
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index dd41d3940..57b8f850e 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -22,7 +22,7 @@ std::vector<Module *> ModuleManager::EventHandlers[I_END];
void ModuleManager::CleanupRuntimeDirectory()
{
- Anope::string dirbuf = services_dir + "/modules/runtime";
+ Anope::string dirbuf = modules_dir + "/modules/runtime";
Log(LOG_DEBUG) << "Cleaning out Module run time directory (" << dirbuf << ") - this may take a moment please wait";
@@ -57,7 +57,7 @@ void ModuleManager::CleanupRuntimeDirectory()
*/
static ModuleReturn moduleCopyFile(const Anope::string &name, Anope::string &output)
{
- Anope::string input = services_dir + "/modules/" + name + ".so";
+ Anope::string input = modules_dir + "/modules/" + name + ".so";
struct stat s;
if (stat(input.c_str(), &s) == -1)
@@ -134,14 +134,14 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
Log(LOG_DEBUG) << "trying to load [" << modname << "]";
/* Generate the filename for the temporary copy of the module */
- Anope::string pbuf = services_dir + "/modules/runtime/" + modname + ".so.XXXXXX";
+ Anope::string pbuf = modules_dir + "/modules/runtime/" + modname + ".so.XXXXXX";
/* Don't skip return value checking! -GD */
ModuleReturn ret = moduleCopyFile(modname, pbuf);
if (ret != MOD_ERR_OK)
{
if (ret == MOD_ERR_NOEXIST)
- Log(LOG_TERMINAL) << "Error while loading " << modname << " (file not exists)";
+ Log(LOG_TERMINAL) << "Error while loading " << modname << " (file does not exist)";
else if (ret == MOD_ERR_FILE_IO)
Log(LOG_TERMINAL) << "Error while loading " << modname << " (file IO error, check file permissions and diskspace)";
return ret;
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 081470766..c69c2fa7d 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -25,7 +25,7 @@ foreach(SRC ${TOOLS_SRCS})
endif(WIN32 AND ${EXE} STREQUAL anopesmtp)
# Set the executable to be installed to the bin directory under the main directory
install(TARGETS ${EXE}
- DESTINATION bin
+ DESTINATION ${BIN_DIR}
)
# Add the executable to the list of files for CPack to ignore
get_target_property(EXE_BINARY ${EXE} LOCATION)