diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | .rebar/templates/production.template | 8 | ||||
-rw-r--r-- | Makefile (renamed from .rebar/templates/Makefile) | 13 | ||||
-rwxr-xr-x | configure | 21 | ||||
-rw-r--r-- | rebar.config (renamed from .rebar/templates/rebar.config) | 0 | ||||
-rw-r--r-- | rel/overlay/etc/default.ini (renamed from .rebar/templates/etc/default.ini) | 0 | ||||
-rw-r--r-- | rel/reltool.config | 12 |
7 files changed, 33 insertions, 27 deletions
@@ -6,11 +6,9 @@ erl_crash.dump # building apps/*/ebin/ -rel/overlay/etc/default*.ini rel/dbcore -rel/overlay/erts-vsn/bin/erl_call -Makefile -rebar.config +rel/overlay.config +install.mk # scons building couchjs/.sconf_temp/ diff --git a/.rebar/templates/production.template b/.rebar/templates/production.template deleted file mode 100644 index ef367fc2..00000000 --- a/.rebar/templates/production.template +++ /dev/null @@ -1,8 +0,0 @@ -{variables, [{prefix, "{{prefix}}"}, - {core_dir, "{{prefix}}/dbcore"}, - {data_dir, "/srv/db"}, - {view_dir, "/srv/view_index"}, - {user, "dbcore"}]}. -{template, "./Makefile", "Makefile"}. -{template, "./etc/default.ini", "rel/overlay/etc/default.ini"}. -{file, "rebar.config", "rebar.config"}. diff --git a/.rebar/templates/Makefile b/Makefile index dacd2012..d80f5fbe 100644 --- a/.rebar/templates/Makefile +++ b/Makefile @@ -25,10 +25,11 @@ distclean: clean @rm -rf rel/dbcore @rm -f rel/overlay/etc/default.ini +include install.mk install: dist - @mkdir -p {{prefix}}/dbcore/ - @cp -R rel/dbcore/* {{prefix}}/dbcore/ - @mkdir -p {{data_dir}} - @chown {{user}} {{data_dir}} - @mkdir -p {{view_dir}} - @chown {{user}} {{view_dir}} + @mkdir -p $(prefix) + @cp -R rel/dbcore/* $(prefix) + @mkdir -p $(data_dir) + @chown $(user) $(data_dir) + @mkdir -p $(view_dir) + @chown $(user) $(view_dir) @@ -5,7 +5,6 @@ function quit { } PREFIX="/opt" -TEMPLATE="production" DATA="/srv/db" VIEW="/srv/view_index" DBCORE_USER=`whoami` @@ -41,9 +40,21 @@ do esac done +echo "==> configuring dbcore in rel/overlay.config" +cat > rel/overlay.config << EOF +{prefix, "$PREFIX"}. +{core_dir, "$PREFIX/dbcore"}. +{data_dir, "$DATA"}. +{view_dir, "$VIEW"}. +{user, "$DBCORE_USER"}. +EOF -echo "configuring dbcore" +cat > install.mk << EOF +# The contents of this file are auto-generated by configure +prefix = $PREFIX +data_dir = $DATA +view_dir = $VIEW +user = $DBCORE_USER +EOF -rm -f rebar.config -# dbcore template -./rebar create template=$TEMPLATE prefix=$PREFIX data_dir=$DATA view_dir=$VIEW user=$DBCORE_USER force=1 +cat rel/overlay.config diff --git a/.rebar/templates/rebar.config b/rebar.config index f2b91397..f2b91397 100644 --- a/.rebar/templates/rebar.config +++ b/rebar.config diff --git a/.rebar/templates/etc/default.ini b/rel/overlay/etc/default.ini index d055217e..d055217e 100644 --- a/.rebar/templates/etc/default.ini +++ b/rel/overlay/etc/default.ini diff --git a/rel/reltool.config b/rel/reltool.config index fe845140..1bfe94e8 100644 --- a/rel/reltool.config +++ b/rel/reltool.config @@ -34,8 +34,12 @@ {app, chttpd, [{incl_cond, include}]} ]}. +{overlay_vars, "overlay.config"}. {overlay, [ - {copy, "overlay/bin"}, - {copy, "overlay/etc"}, - {copy, "overlay/var"} - ]}. + {copy, "overlay/bin"}, + {copy, "overlay/etc"}, + {copy, "overlay/var"}, + {copy, "../couchjs/build/couchjs", "bin/couchjs"}, + {copy, "../couchjs/build/main.js", "var/share/server/main.js"}, + {template, "overlay/etc/default.ini", "etc/default.ini"} +]}. |