summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--ebin/catlfish.app7
-rwxr-xr-xmakerelease.erl7
-rw-r--r--reltool.config16
-rw-r--r--src/catlfish_app.erl29
5 files changed, 65 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2efdd34..a9f4683 100644
--- a/Makefile
+++ b/Makefile
@@ -2,3 +2,13 @@ build all:
erl -make
clean:
-rm ebin/*.beam
+release:
+ rm -rf rel
+ mkdir rel
+ ./makerelease.erl
+ (cd rel; \
+ ln -s ../../plop/Mnesia.nonode@nohost .; \
+ ln -s ../../plop/test .)
+ cp httpd_props.conf rel
+ mkdir rel/catlfish
+ cp -r webroot rel/catlfish
diff --git a/ebin/catlfish.app b/ebin/catlfish.app
index 4dbb166..5e3b7ee 100644
--- a/ebin/catlfish.app
+++ b/ebin/catlfish.app
@@ -7,7 +7,6 @@
{application, catlfish,
[{description, "catlfish -- Certificate Transparency Log Server"},
{vsn, "0.1.1"},
- {modules, [v1]},
- {applications, [kernel, stdlib, plop, inets]}]}.
-%% {registered, [catlfish]}]}.
-%% {mod, {catlfish, ["test/eckey.pem", "test/eckey-public.pem"]}}]}.
+ {modules, [v1, catlfish_app]},
+ {applications, [kernel, stdlib, plop, inets, jiffy]},
+ {mod, {catlfish_app, []}}]}.
diff --git a/makerelease.erl b/makerelease.erl
new file mode 100755
index 0000000..f72fdb6
--- /dev/null
+++ b/makerelease.erl
@@ -0,0 +1,7 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+
+main(_) ->
+ {ok, Conf} = file:consult("reltool.config"),
+ {ok, Spec} = reltool:get_target_spec(Conf),
+ ok = reltool:eval_target_spec(Spec, code:root_dir(), "rel").
diff --git a/reltool.config b/reltool.config
new file mode 100644
index 0000000..c0e1b2c
--- /dev/null
+++ b/reltool.config
@@ -0,0 +1,16 @@
+%% -*- mode: erlang -*-
+{sys, [
+ {lib_dirs, [".."]},
+ {erts, [{mod_cond, derived}, {app_file, strip}]},
+ {app_file, strip},
+ {rel, "catlfish", "0.1.1",
+ [
+ kernel,
+ stdlib,
+ sasl,
+ catlfish
+ ]},
+ {boot_rel, "catlfish"},
+ {app, catlfish, [{app_file, all}]}
+%% {app, plop, [{mod_cond, app}, {incl_cond, include}, {lib_dir, "../plop"}]}
+ ]}.
diff --git a/src/catlfish_app.erl b/src/catlfish_app.erl
new file mode 100644
index 0000000..9c9bdad
--- /dev/null
+++ b/src/catlfish_app.erl
@@ -0,0 +1,29 @@
+-module(catlfish_app).
+
+-behaviour(application).
+
+%% Application callbacks
+-export([start/2, stop/1]).
+
+%% ===================================================================
+%% Application callbacks
+%% ===================================================================
+
+dummy() ->
+ receive
+ after
+ infinity ->
+ none
+ end.
+
+start(_StartType, _StartArgs) ->
+ io:format("starting catlfish~n", []),
+ InetsResult = inets:start(httpd, [{proplist_file, "httpd_props.conf"}]),
+ io:format("catlfish: tried to start inets service: ~p~n", [InetsResult]),
+ Pid = spawn(fun () ->
+ dummy()
+ end),
+ {ok, Pid}.
+
+stop(_State) ->
+ ok.