2013-04-08 11:12:54 +02:00
|
|
|
%%%-------------------------------------------------------------------
|
|
|
|
%%% @author Evgeniy Khramtsov <ekhramtsov@process-one.net>
|
|
|
|
%%% @copyright (C) 2013, Evgeniy Khramtsov
|
|
|
|
%%% @doc
|
|
|
|
%%%
|
|
|
|
%%% @end
|
|
|
|
%%% Created : 8 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
|
|
|
|
%%%-------------------------------------------------------------------
|
|
|
|
Vars = case file:consult(filename:join(["..", "vars.config"])) of
|
|
|
|
{ok, Terms} ->
|
|
|
|
Terms;
|
|
|
|
_Err ->
|
|
|
|
[]
|
|
|
|
end,
|
|
|
|
|
|
|
|
RequiredOTPApps = [sasl, crypto, public_key, ssl,
|
2013-06-18 13:54:30 +02:00
|
|
|
mnesia, inets, compiler, asn1,
|
|
|
|
syntax_tools, os_mon, xmerl],
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
ConfiguredOTPApps = lists:flatmap(
|
|
|
|
fun({tools, true}) ->
|
|
|
|
[tools, runtime_tools];
|
2013-06-18 13:54:30 +02:00
|
|
|
({odbc, true}) ->
|
|
|
|
[odbc];
|
2013-04-08 11:12:54 +02:00
|
|
|
(_) ->
|
|
|
|
[]
|
|
|
|
end, Vars),
|
|
|
|
|
|
|
|
OTPApps = RequiredOTPApps ++ ConfiguredOTPApps,
|
|
|
|
|
2014-10-12 17:23:25 +02:00
|
|
|
DepRequiredApps = [p1_cache_tab, p1_tls, p1_stringprep, p1_xml, p1_yaml, p1_utils],
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
DepConfiguredApps = lists:flatmap(
|
|
|
|
fun({mysql, true}) -> [p1_mysql];
|
|
|
|
({pgsql, true}) -> [p1_pgsql];
|
|
|
|
({pam, true}) -> [p1_pam];
|
|
|
|
({zlib, true}) -> [p1_zlib];
|
|
|
|
({stun, true}) -> [p1_stun];
|
|
|
|
({json, true}) -> [jiffy];
|
|
|
|
({iconv, true}) -> [p1_iconv];
|
2013-08-12 14:25:05 +02:00
|
|
|
({lager, true}) -> [lager, goldrush];
|
2013-07-06 19:10:35 +02:00
|
|
|
({lager, false}) -> [p1_logger];
|
2013-04-08 11:12:54 +02:00
|
|
|
(_) -> []
|
|
|
|
end, Vars),
|
|
|
|
|
|
|
|
DepApps = DepRequiredApps ++ DepConfiguredApps,
|
|
|
|
|
|
|
|
Sys = [{lib_dirs, []},
|
|
|
|
{erts, [{mod_cond, derived}, {app_file, strip}]},
|
|
|
|
{app_file, strip},
|
|
|
|
{rel, "ejabberd", proplists:get_value(vsn, Vars),
|
|
|
|
[
|
|
|
|
kernel,
|
|
|
|
stdlib,
|
|
|
|
ejabberd
|
|
|
|
] ++ OTPApps ++ DepApps},
|
|
|
|
{rel, "start_clean", "",
|
|
|
|
[
|
|
|
|
kernel,
|
|
|
|
stdlib
|
|
|
|
]},
|
|
|
|
{boot_rel, "ejabberd"},
|
|
|
|
{profile, embedded},
|
|
|
|
{incl_cond, exclude},
|
|
|
|
{excl_archive_filters, [".*"]}, %% Do not archive built libs
|
|
|
|
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
|
|
|
|
"^erts.*/(doc|info|include|lib|man|src)"]},
|
|
|
|
{excl_app_filters, ["\.gitignore"]},
|
|
|
|
{app, stdlib, [{incl_cond, include}]},
|
|
|
|
{app, kernel, [{incl_cond, include}]},
|
|
|
|
{app, ejabberd, [{incl_cond, include}, {lib_dir, ".."}]}]
|
|
|
|
++ lists:map(
|
|
|
|
fun(App) ->
|
|
|
|
{app, App, [{incl_cond, include},
|
|
|
|
{lib_dir, "../deps/" ++ atom_to_list(App)}]}
|
|
|
|
end, DepApps)
|
|
|
|
++ lists:map(
|
|
|
|
fun(App) ->
|
|
|
|
{app, App, [{incl_cond, include}]}
|
|
|
|
end, OTPApps).
|
|
|
|
|
|
|
|
Overlay = [
|
|
|
|
{mkdir, "var/log/ejabberd"},
|
|
|
|
{mkdir, "var/lock"},
|
|
|
|
{mkdir, "var/lib/ejabberd"},
|
|
|
|
{mkdir, "etc/ejabberd"},
|
|
|
|
{mkdir, "doc"},
|
|
|
|
{template, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
|
|
|
|
{template, "../ejabberdctl.template", "bin/ejabberdctl"},
|
|
|
|
{copy, "../ejabberdctl.cfg.example", "etc/ejabberd/ejabberdctl.cfg"},
|
2013-08-12 14:25:05 +02:00
|
|
|
{copy, "../ejabberd.yml.example", "etc/ejabberd/ejabberd.yml"},
|
2013-04-08 11:12:54 +02:00
|
|
|
{copy, "../inetrc", "etc/ejabberd/inetrc"},
|
|
|
|
{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"}
|
|
|
|
],
|
|
|
|
|
|
|
|
Config = [{sys, Sys},
|
|
|
|
{overlay_vars, "../vars.config"},
|
|
|
|
{target_dir, "ejabberd"},
|
|
|
|
{overlay, Overlay}],
|
|
|
|
|
|
|
|
%%io:format("ejabberd release:~n ~p~n", [Config]),
|
|
|
|
Config.
|
|
|
|
|
|
|
|
%% Local Variables:
|
|
|
|
%% mode: erlang
|
|
|
|
%% End:
|
|
|
|
%% vim: set filetype=erlang tabstop=8:
|