Permalink
Browse files

Added a 'make release' target in the top makefile. he release

file picks up the versions of installed applications (erts,
kernel, stdlib, sasl and mnesia).

The product of this is a release package file (e.g. yaws-1.73.tar.gz)
which can be installed on an embedded system using the SASL
application release_handler.

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1249 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent d508b52 commit 2ae9701bb6778acd496b46187e3edca4eccb8fc7 @klacke committed May 20, 2008
Showing with 180 additions and 2 deletions.
  1. +25 −0 Makefile
  2. +132 −1 configure
  3. +6 −0 configure.in
  4. +5 −0 include.mk.in
  5. +12 −1 src/yaws.app.src
View
@@ -1,13 +1,16 @@
SUBDIRS = c_src src man www/shopingcart www/code doc scripts
include ./include.mk
+include ./vsn.mk
all debug clean:
@set -e ; \
for d in $(SUBDIRS) ; do \
if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \
done
+ rm -rf yaws-${YAWS_VSN}.script yaws-${YAWS_VSN}.boot
+ rm -rf yaws-${YAWS_VSN}.rel yaws-${YAWS_VSN}.tar.gz
install: all
@@ -36,6 +39,28 @@ local_install: all
(cd scripts && $(MAKE) local_install)
+# Target for folks that want to build a proper OTP release
+# to be used with regular OTP release management.
+release: vsn.mk include.mk yaws.rel.src all
+ sed -e "s/%YAWS_VSN%/${YAWS_VSN}/g" \
+ -e "s/%ERTS_VSN%/${ERTS_VSN}/" \
+ -e "s/%KERNEL_VSN%/${KERNEL_VSN}/" \
+ -e "s/%STDLIB_VSN%/${STDLIB_VSN}/" \
+ -e "s/%SASL_VSN%/${SASL_VSN}/" \
+ -e "s/%MNESIA_VSN%/${MNESIA_VSN}/" \
+ < yaws.rel.src > yaws-${YAWS_VSN}.rel
+ erlc -pa ./ebin yaws-${YAWS_VSN}.rel
+ erl -pa ./ebin -noinput -run systools make_tar yaws-${YAWS_VSN} \
+ -s erlang halt
+ @echo "-------------------------------"
+ @echo
+ @echo "Best to rerun this in an Erlang shell to pick up include directory:"
+ @echo
+ @echo "$$ erl -pa ./ebin"
+ @echo "1> systools:make_tar(\"yaws-${YAWS_VSN}\", [{dirs,[include,examples,src]}])."
+ @echo
+ @echo "--------------------------------"
+
touch:
find . -name '*' -print | xargs touch -m
find . -name '*.erl' -print | xargs touch -m
View
@@ -634,6 +634,11 @@ EXTRAINCLUDE
EPAM
ERL_DLL_LIB
ERLDIR
+ERTS_VSN
+KERNEL_VSN
+STDLIB_VSN
+SASL_VSN
+MNESIA_VSN
CC
CFLAGS
LDFLAGS
@@ -1990,6 +1995,127 @@ fi
+
+ { echo "$as_me:$LINENO: checking erts version" >&5
+echo $ECHO_N "checking erts version... $ECHO_C" >&6; }
+ if test "${bt_cv_erts_vsn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ bt_cv_erts_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^erts-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_erts_vsn" in
+ "")
+ { { echo "$as_me:$LINENO: error: \"Could not figure out version Erlang library: erts\"" >&5
+echo "$as_me: error: \"Could not figure out version Erlang library: erts\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ ERTS_VSN=$bt_cv_erts_vsn
+ { echo "$as_me:$LINENO: result: $bt_cv_erts_vsn" >&5
+echo "${ECHO_T}$bt_cv_erts_vsn" >&6; }
+
+
+ { echo "$as_me:$LINENO: checking kernel version" >&5
+echo $ECHO_N "checking kernel version... $ECHO_C" >&6; }
+ if test "${bt_cv_kernel_vsn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ bt_cv_kernel_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^kernel-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_kernel_vsn" in
+ "")
+ { { echo "$as_me:$LINENO: error: \"Could not figure out version Erlang library: kernel\"" >&5
+echo "$as_me: error: \"Could not figure out version Erlang library: kernel\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ KERNEL_VSN=$bt_cv_kernel_vsn
+ { echo "$as_me:$LINENO: result: $bt_cv_kernel_vsn" >&5
+echo "${ECHO_T}$bt_cv_kernel_vsn" >&6; }
+
+
+ { echo "$as_me:$LINENO: checking stdlib version" >&5
+echo $ECHO_N "checking stdlib version... $ECHO_C" >&6; }
+ if test "${bt_cv_stdlib_vsn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ bt_cv_stdlib_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^stdlib-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_stdlib_vsn" in
+ "")
+ { { echo "$as_me:$LINENO: error: \"Could not figure out version Erlang library: stdlib\"" >&5
+echo "$as_me: error: \"Could not figure out version Erlang library: stdlib\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ STDLIB_VSN=$bt_cv_stdlib_vsn
+ { echo "$as_me:$LINENO: result: $bt_cv_stdlib_vsn" >&5
+echo "${ECHO_T}$bt_cv_stdlib_vsn" >&6; }
+
+
+ { echo "$as_me:$LINENO: checking sasl version" >&5
+echo $ECHO_N "checking sasl version... $ECHO_C" >&6; }
+ if test "${bt_cv_sasl_vsn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ bt_cv_sasl_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^sasl-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_sasl_vsn" in
+ "")
+ { { echo "$as_me:$LINENO: error: \"Could not figure out version Erlang library: sasl\"" >&5
+echo "$as_me: error: \"Could not figure out version Erlang library: sasl\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ SASL_VSN=$bt_cv_sasl_vsn
+ { echo "$as_me:$LINENO: result: $bt_cv_sasl_vsn" >&5
+echo "${ECHO_T}$bt_cv_sasl_vsn" >&6; }
+
+
+ { echo "$as_me:$LINENO: checking mnesia version" >&5
+echo $ECHO_N "checking mnesia version... $ECHO_C" >&6; }
+ if test "${bt_cv_mnesia_vsn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ bt_cv_mnesia_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^mnesia-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_mnesia_vsn" in
+ "")
+ { { echo "$as_me:$LINENO: error: \"Could not figure out version Erlang library: mnesia\"" >&5
+echo "$as_me: error: \"Could not figure out version Erlang library: mnesia\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ MNESIA_VSN=$bt_cv_mnesia_vsn
+ { echo "$as_me:$LINENO: result: $bt_cv_mnesia_vsn" >&5
+echo "${ECHO_T}$bt_cv_mnesia_vsn" >&6; }
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4318,6 +4444,11 @@ EXTRAINCLUDE!$EXTRAINCLUDE$ac_delim
EPAM!$EPAM$ac_delim
ERL_DLL_LIB!$ERL_DLL_LIB$ac_delim
ERLDIR!$ERLDIR$ac_delim
+ERTS_VSN!$ERTS_VSN$ac_delim
+KERNEL_VSN!$KERNEL_VSN$ac_delim
+STDLIB_VSN!$STDLIB_VSN$ac_delim
+SASL_VSN!$SASL_VSN$ac_delim
+MNESIA_VSN!$MNESIA_VSN$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
LDFLAGS!$LDFLAGS$ac_delim
@@ -4347,7 +4478,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
View
@@ -99,6 +99,12 @@ fi
AC_SUBST(ERLDIR)
AC_SUBST(ERL_DLL_LIB)
+BT_ERL_LIB_VSN(erts)
+BT_ERL_LIB_VSN(kernel)
+BT_ERL_LIB_VSN(stdlib)
+BT_ERL_LIB_VSN(sasl)
+BT_ERL_LIB_VSN(mnesia)
+
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
View
@@ -45,6 +45,11 @@ OUT=@OUT@
FPIC=@FPIC@
LIBS=@LIBS@
+ERTS_VSN=@ERTS_VSN@
+KERNEL_VSN=@KERNEL_VSN@
+STDLIB_VSN=@STDLIB_VSN@
+SASL_VSN=@SASL_VSN@
+MNESIA_VSN=@MNESIA_VSN@
ERLDIR=@ERLDIR@
View
@@ -4,5 +4,16 @@
{modules,[%MODULES%]},
{registered, []},
{mod,{yaws_app,[]}},
- {env, []},
+ {env, [
+ % {debug, false}, % true | false
+ % {trace, false}, % http | traffic | false
+ % {traceoutput, false}, % true | false
+ % {conf, "/etc/yaws.conf"}, % string()
+ % {runmod, mymodule}, % atom()
+ % {embedded, false}, % true | false
+ % {id, "default"}, % string()
+ % {pam_service, "system-auth"}, % string()
+ % {pam_use_acct, true}, % true | false
+ % {pam_use_sess, true} % true | false
+ ]},
{applications,[kernel,stdlib]}]}.

0 comments on commit 2ae9701

Please sign in to comment.