-
-# If the user has specified a distribution label then we use it in
-# place of the label from src/version.sh or Git.
-if (defined $opt_distribution_label) {
- $version{LABEL} = $opt_distribution_label;
-}
-
-if (defined $opt_system) {
- $config{BASE_DIR} = $opt_prefix || '/var/lib/inspircd';
- $config{BINARY_DIR} = $opt_binary_dir || '/usr/sbin';
- $config{CONFIG_DIR} = $opt_config_dir || '/etc/inspircd';
- $config{DATA_DIR} = $opt_data_dir || '/var/inspircd';
- $config{LOG_DIR} = $opt_module_dir || '/var/log/inspircd';
- $config{MANUAL_DIR} = $opt_manual_dir || '/usr/share/man/man1';
- $config{MODULE_DIR} = $opt_module_dir || '/usr/lib/inspircd';
+$config{SOCKETENGINE} = $opt_socketengine // $socketengines[0];
+
+if (defined $opt_portable) {
+ print_error '--portable and --system can not be used together!' if defined $opt_system;
+ $config{DESTDIR} = catfile $RealDir, 'run', '';
+ $config{BASE_DIR} = $opt_prefix // '';
+ $config{BINARY_DIR} = $opt_binary_dir // 'bin';
+ $config{CONFIG_DIR} = $opt_config_dir // 'conf';
+ $config{DATA_DIR} = $opt_data_dir // 'data';
+ $config{EXAMPLE_DIR} = $opt_example_dir // catdir $config{CONFIG_DIR}, 'examples';
+ $config{LOG_DIR} = $opt_log_dir // 'logs';
+ $config{MANUAL_DIR} = $opt_manual_dir // 'manuals';
+ $config{MODULE_DIR} = $opt_module_dir // 'modules';
+ $config{RUNTIME_DIR} = $opt_runtime_dir // $config{DATA_DIR};
+ $config{SCRIPT_DIR} = $opt_script_dir // $config{BASE_DIR};
+} elsif (defined $opt_system) {
+ $config{BASE_DIR} = $opt_prefix // '/';
+ $config{BINARY_DIR} = $opt_binary_dir // catdir $config{BASE_DIR}, 'usr/sbin';
+ $config{CONFIG_DIR} = $opt_config_dir // catdir $config{BASE_DIR}, 'etc/inspircd';
+ $config{DATA_DIR} = $opt_data_dir // catdir $config{BASE_DIR}, 'var/lib/inspircd';
+ $config{EXAMPLE_DIR} = $opt_example_dir // catdir $config{BASE_DIR}, 'usr/share/doc/inspircd';
+ $config{LOG_DIR} = $opt_log_dir // catdir $config{BASE_DIR}, 'var/log/inspircd';
+ $config{MANUAL_DIR} = $opt_manual_dir // catdir $config{BASE_DIR}, 'usr/share/man/man1';
+ $config{MODULE_DIR} = $opt_module_dir // catdir $config{BASE_DIR}, 'usr/lib/inspircd';
+ $config{RUNTIME_DIR} = $opt_runtime_dir // catdir $config{BASE_DIR}, 'var/run/inspircd';
+ $config{SCRIPT_DIR} = $opt_script_dir // catdir $config{BASE_DIR}, 'usr/share/inspircd';