summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorChrisTX <xpipe@hotmail.de>2012-09-23 12:30:30 +0200
committerattilamolnar <attilamolnar@hush.com>2012-10-04 15:14:04 +0200
commitc2f7fc047c2e5bbb899c820590ce07fee593b28f (patch)
treedca97896004c71a484d6dd189e78e40732a5f041 /configure
parent6f5414e1bf63228471e078f29a5889f44e598a8c (diff)
Replace hardcoded paths with configurable ones
This patchset aims to ease the packaging of InspIRCd for a system-wide installation scenario. Changes in detail: configure: Add the options --log-path and --data-path m_ssl_gnutls, openssl: Change the hardcoded "conf/" to the existent CONFIG_PATH macro m_xline_db: Make the location of xline.db configurable. It will use --data-path as default value, but this can be changed using the configuration files.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure26
1 files changed, 23 insertions, 3 deletions
diff --git a/configure b/configure
index 6021a805d..2db2b98d0 100755
--- a/configure
+++ b/configure
@@ -61,7 +61,7 @@ our ($opt_use_gnutls, $opt_rebuild, $opt_use_openssl, $opt_nointeractive, $opt_p
$opt_noipv6, $opt_maxbuf, $opt_disable_debug, $opt_freebsd_port,
$opt_system, $opt_uid);
-our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir);
+our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir, $opt_data_dir, $opt_log_dir);
sub list_extras ();
@@ -93,6 +93,8 @@ GetOptions (
'config-dir=s' => \$opt_config_dir,
'module-dir=s' => \$opt_module_dir,
'binary-dir=s' => \$opt_binary_dir,
+ 'data-dir=s' => \$opt_data_dir,
+ 'log-dir=s' => \$opt_log_dir,
'disable-debuginfo' => sub { $opt_disable_debug = 1 },
'help' => sub { showhelp(); },
'update' => sub { update(); },
@@ -120,6 +122,8 @@ our $interactive = !(
(defined $opt_module_dir) ||
(defined $opt_base_dir) ||
(defined $opt_binary_dir) ||
+ (defined $opt_data_dir) ||
+ (defined $opt_log_dir) ||
(defined $opt_nointeractive) ||
(defined $opt_cc) ||
(defined $opt_noipv6) ||
@@ -157,12 +161,16 @@ if (defined $opt_system || defined $opt_uid) {
$config{MODULE_DIR} = '/usr/lib/inspircd';
$config{BINARY_DIR} = '/usr/sbin/';
$config{BUILD_DIR} = resolve_directory($config{ME}."/build"); # Build Directory
+ $config{DATA_DIR} = '/var/inspircd';
+ $config{LOG_DIR} = '/var/log/inspircd';
} else {
$config{UID} = $<;
$config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
$config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
$config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
$config{BUILD_DIR} = resolve_directory($config{ME}."/build"); # Build Directory
+ $config{DATA_DIR} = resolve_directory($config{BASE_DIR}."/data"); # Data directory
+ $config{LOG_DIR} = resolve_directory($config{BASE_DIR}."/logs"); # Log directory
}
if (defined $opt_config_dir) {
@@ -174,6 +182,12 @@ if (defined $opt_module_dir) {
if (defined $opt_binary_dir) {
$config{BINARY_DIR} = $opt_binary_dir;
}
+if (defined $opt_data_dir) {
+ $config{DATA_DIR} = $opt_data_dir;
+}
+if (defined $opt_log_dir) {
+ $config{LOG_DIR} = $opt_log_dir;
+}
chomp($config{HAS_GNUTLS} = `pkg-config --modversion gnutls 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
if (defined $opt_freebsd_port)
@@ -531,14 +545,18 @@ should NOT be used. You should probably specify a newer compiler.\n\n";
if ($tmpbase ne $config{BASE_DIR}) {
$config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Dir
$config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
+ $config{DATA_DIR} = resolve_directory($config{BASE_DIR}."/data"); # Data Directory
+ $config{LOG_DIR} = resolve_directory($config{BASE_DIR}."/logs"); # Log Directory
$config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
}
dir_check("are the configuration files", "CONFIG_DIR");
dir_check("are the modules to be compiled to", "MODULE_DIR");
dir_check("is the IRCd binary to be placed", "BINARY_DIR");
+ dir_check("are variable data files to be located in", "DATA_DIR");
+ dir_check("are the logs to be stored in", "LOG_DIR");
dir_check("do you want the build to take place", "BUILD_DIR");
-
+
my $chose_hiperf = 0;
if ($has_kqueue) {
yesno('USE_KQUEUE',"You are running a BSD operating system, and kqueue\nwas detected. Would you like to enable kqueue support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable kqueue?");
@@ -867,6 +885,8 @@ sub writefiles {
#define DllExport /**/
#define CONFIG_PATH "$config{CONFIG_DIR}"
+#define DATA_PATH "$config{DATA_DIR}"
+#define LOG_PATH "$config{LOG_DIR}"
#define MOD_PATH "$config{MODULE_DIR}"
#define SOMAXCONN_S "$config{_SOMAXCONN}"
#define ENTRYPOINT int main(int argc, char** argv)
@@ -998,7 +1018,7 @@ EOF
$config{BUILD_DIR} ||= resolve_directory($config{ME}."/build");
for my $var (qw(
- CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR UID
+ CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR DATA_DIR UID
STARTSCRIPT DESTINATION SOCKETENGINE
)) {
s/\@$var\@/$config{$var}/g;