Permalink
Browse files

no more rebar templates in configure

  • Loading branch information...
1 parent a70b91c commit 264cb29e3014acdece32f2e0167b060e22fc9060 @kocolosk kocolosk committed Aug 24, 2010
View
6 .gitignore
@@ -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/
View
8 .rebar/templates/production.template
@@ -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"}.
View
13 .rebar/templates/Makefile → 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)
View
21 configure
@@ -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
View
0 .rebar/templates/rebar.config → rebar.config
File renamed without changes.
View
0 .rebar/templates/etc/default.ini → rel/overlay/etc/default.ini
File renamed without changes.
View
12 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"}
+]}.

0 comments on commit 264cb29

Please sign in to comment.