Skip to content

Commit e6e70cf

Browse files
vstaxmocchira
authored andcommitted
Conditional build with sd_notify library
1 parent cfa5ad0 commit e6e70cf

File tree

8 files changed

+28
-4
lines changed

8 files changed

+28
-4
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ rel/leo_manager/files/leo_manager.schema
1212
# ignore this because it is env dependent
1313
rel/common/launch.environment
1414

15+
# reltool.config files are generated from reltool.config.in
16+
rel/leo_gateway/reltool.config
17+
rel/leo_manager/reltool.config
18+
rel/leo_storage/reltool.config
19+
1520
apps/leo_gateway/cache/
1621

1722
docs/_book/

Makefile

+14-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,20 @@ generate:
4444
(cd rel/leo_manager && ../../rebar generate)
4545
(cd rel/leo_storage && ../../rebar generate)
4646
(cd rel/leo_gateway && ../../rebar generate)
47-
release:
47+
sd_notify:
48+
make -C deps/sd_notify
49+
reltool:
50+
ifeq ($(with_sd_notify),yes)
51+
for reltool_config in rel/leo_*/reltool.config.in; do \
52+
sed 's/%% SD_NOTIFY_PLACEHOLDER/,{app, sd_notify, [{incl_cond, include}]}/' \
53+
$$reltool_config > $${reltool_config/.in/}; \
54+
done
55+
else
56+
for reltool_config in rel/leo_*/reltool.config.in; do \
57+
sed '/%% SD_NOTIFY_PLACEHOLDER/d' $$reltool_config > $${reltool_config/.in/}; \
58+
done
59+
endif
60+
release: reltool
4861
@./rebar compile
4962
rm -rf package/leo_*
5063
#

apps/leo_gateway/rebar.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
{nfs_rpc_server, ".*", {git, "https://github.com/leo-project/nfs_rpc_server.git", {tag, "0.2.6"}}},
3838
{cowboy, ".*", {git, "https://github.com/leo-project/cowboy.git", {branch, "for-leofs-1.4"}}},
3939
{cowlib, ".*", {git, "https://github.com/ninenines/cowlib.git", {tag, "1.0.0"}}},
40-
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
40+
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
41+
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
4142
]}.
4243

4344
{erl_opts, [{d, 'NOTEST'},

apps/leo_manager/rebar.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
{leo_statistics, ".*", {git, "https://github.com/leo-project/leo_statistics.git", {tag, "1.1.20"}}},
3232
{leo_s3_libs, ".*", {git, "https://github.com/leo-project/leo_s3_libs.git", {tag, "1.2.16"}}},
3333
{jiffy, ".*", {git, "https://github.com/davisp/jiffy.git", {tag, "0.14.8"}}},
34-
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
34+
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
35+
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
3536
]}.
3637

3738
{erl_opts, [{d, 'NOTEST'},

apps/leo_storage/rebar.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
{leo_rpc, ".*", {git, "https://github.com/leo-project/leo_rpc.git", {tag, "0.10.15"}}},
3333
{leo_statistics, ".*", {git, "https://github.com/leo-project/leo_statistics.git", {tag, "1.1.20"}}},
3434
{leo_watchdog, ".*", {git, "https://github.com/leo-project/leo_watchdog.git", {tag, "1.0.4"}}},
35-
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
35+
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
36+
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
3637
]}.
3738

3839
{erl_opts, [{d, 'NOTEST'},

rel/leo_gateway/reltool.config rel/leo_gateway/reltool.config.in

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
{app, leo_watchdog, [{incl_cond, include}]},
9696
{app, savanna_agent, [{incl_cond, include}]},
9797
{app, savanna_commons, [{incl_cond, include}]}
98+
%% SD_NOTIFY_PLACEHOLDER
9899
]}.
99100

100101
{target_dir, "leo_gateway"}.

rel/leo_manager/reltool.config rel/leo_manager/reltool.config.in

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
{app, leo_statistics, [{incl_cond, include}]},
8080
{app, recon, [{incl_cond, include}]},
8181
{app, savanna_commons, [{incl_cond, include}]}
82+
%% SD_NOTIFY_PLACEHOLDER
8283
]}.
8384

8485
{target_dir, "leo_manager"}.

rel/leo_storage/reltool.config rel/leo_storage/reltool.config.in

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
{app, leo_watchdog, [{incl_cond, include}]},
8282
{app, recon, [{incl_cond, include}]},
8383
{app, savanna_commons, [{incl_cond, include}]}
84+
%% SD_NOTIFY_PLACEHOLDER
8485
]}.
8586

8687
{target_dir, "leo_storage"}.

0 commit comments

Comments
 (0)