2013-05-08 11:27:25 +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>
|
|
|
|
%%%-------------------------------------------------------------------
|
2013-05-09 11:05:35 +02:00
|
|
|
Vars = case file:consult(filename:join(["..", "vars.config"])) of
|
2013-05-08 11:27:25 +02:00
|
|
|
{ok, Terms} ->
|
|
|
|
Terms;
|
|
|
|
_Err ->
|
|
|
|
[]
|
|
|
|
end,
|
|
|
|
|
|
|
|
OTPApps = [sasl, crypto, public_key, ssl,
|
2013-05-08 15:51:21 +02:00
|
|
|
mnesia, inets, odbc, tools, compiler],
|
2013-05-08 11:27:25 +02:00
|
|
|
|
|
|
|
DepRequiredApps = [logger, cache_tab, tls, stringprep, xml, xmlrpc],
|
|
|
|
|
|
|
|
DepConfiguredApps = lists:flatmap(
|
|
|
|
fun({mysql, true}) -> [mysql];
|
|
|
|
({pgsql, true}) -> [pgsql];
|
|
|
|
({pam, true}) -> [epam];
|
|
|
|
({zlib, true}) -> [ezlib];
|
|
|
|
({stun, true}) -> [stun];
|
2013-05-08 13:56:29 +02:00
|
|
|
({riak, true}) -> [riakc, riak_pb, protobuffs];
|
2013-05-08 11:27:25 +02:00
|
|
|
({json, true}) -> [jiffy];
|
|
|
|
({iconv, true}) -> [iconv];
|
|
|
|
({http, true}) -> [ibrowse, lhttpc];
|
|
|
|
(_) -> []
|
|
|
|
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 = [
|
2013-05-08 15:11:17 +02:00
|
|
|
{mkdir, "log/ejabberd"},
|
2013-05-08 13:56:29 +02:00
|
|
|
{mkdir, "lock"},
|
|
|
|
{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"},
|
|
|
|
{copy, "../ejabberd.cfg.example", "etc/ejabberd/ejabberd.cfg"},
|
|
|
|
{copy, "../inetrc", "etc/ejabberd/inetrc"},
|
|
|
|
{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"}
|
2013-05-08 11:27:25 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
Config = [{sys, Sys},
|
2013-05-09 11:05:35 +02:00
|
|
|
{overlay_vars, "../vars.config"},
|
2013-05-08 11:27:25 +02:00
|
|
|
{target_dir, "ejabberd"},
|
|
|
|
{overlay, Overlay}],
|
|
|
|
|
2013-05-08 15:51:56 +02:00
|
|
|
%%io:format("ejabberd release:~n ~p~n", [Config]),
|
2013-05-08 11:27:25 +02:00
|
|
|
Config.
|
|
|
|
|
|
|
|
%% Local Variables:
|
|
|
|
%% mode: erlang
|
|
|
|
%% End:
|
|
|
|
%% vim: set filetype=erlang tabstop=8:
|