[Hw4mdl-svn] SF.net SVN: hw4mdl: [103] trunk/moodle
Brought to you by:
jhlinder,
trollinger
|
From: <hu...@us...> - 2006-11-29 12:32:23
|
Revision: 103
http://svn.sourceforge.net/hw4mdl/?rev=103&view=rev
Author: hugues
Date: 2006-11-29 04:32:21 -0800 (Wed, 29 Nov 2006)
Log Message:
-----------
Created the build script
Added Paths:
-----------
trunk/moodle/bin/
trunk/moodle/bin/package.sh
Added: trunk/moodle/bin/package.sh
===================================================================
--- trunk/moodle/bin/package.sh (rev 0)
+++ trunk/moodle/bin/package.sh 2006-11-29 12:32:21 UTC (rev 103)
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+DEBUG=1
+
+TARGET=liveclassroom
+#TARGET=liveclassroom, voicetool, pronto
+
+SVN_USER_PARAM=
+SVN_PASS_PARAM=
+SVN_TAG_PARAM=liveclassroom_0.9
+
+SVN_URL_BASE=https://svn.sourceforge.net/svnroot/hw4mdl
+SVN_URL_TRUNK=${SVN_URL_BASE}/trunk
+SVN_URL_TAG=${SVN_URL_BASE}/tags/${SVN_TAG_PARAM}
+
+if [ -n "$DEBUG" ]; then
+ echo "Using SVN_TRUNK"
+fi
+SVN_URL=${SVN_URL_TRUNK}
+
+
+ BASEDIR=`pwd`
+ SVN_EXPORT_DIR=${BASEDIR}/export
+ BUILD_DIR=${BASEDIR}/build
+
+
+function initdir()
+{
+ echo -n "Creating build directories..."
+ if [ -d ${SVN_EXPORT_DIR} ]; then
+ rm -rf ${SVN_EXPORT_DIR}
+ fi
+ if [ -d "${BUILD_DIR}" ]; then
+ rm -rf ${BUILD_DIR}
+ fi
+
+ mkdir -p ${BUILD_DIR}/${TARGET}/mod
+ mkdir -p ${BUILD_DIR}/${TARGET}/lang
+ echo "ok!"
+}
+
+
+function export_files () {
+ SVN_ARGS="-q --non-interactive"
+
+ if [ -n "$SVN_USER_PARAM" ]; then
+ if [ -n "$DEBUG" ]; then
+ echo "Using username: ${SVN_USERNAME}";
+ fi
+ SVN_ARGS="${SVN_ARGS} --username ${SVN_USER_PARAM}"
+ fi
+
+ if [ -n "$SVN_PASS_PARAM" ]; then
+ if [ -z "$SVN_USER_PARAM" ]; then
+ echo "error: pass without username"
+ exit -1
+ fi
+ SVN_ARGS="${SVN_ARGS} --password ${SVN_PASS_PARAM}"
+ fi
+
+ if [ -n "$DEBUG" ]; then
+ echo "Using args: $SVN_ARGS"
+ fi
+ echo -n "Exporting source code..."
+ svn export ${SVN_ARGS} ${SVN_URL} ${SVN_EXPORT_DIR}
+ echo "ok!"
+}
+
+
+
+function prepare ()
+{
+
+ target=$1;
+
+ echo -n "Building distribution for ${target}..."
+ cp -r ${SVN_EXPORT_DIR}/moodle/mod/${target} ${BUILD_DIR}/${target}/mod/
+
+ LANG_EXPORT_DIR="${SVN_EXPORT_DIR}/moodle/lang"
+ LANG_BUILD_DIR="${BUILD_DIR}/${target}/lang"
+ for afile in `find ${LANG_EXPORT_DIR} -name "${target}.php"` ; do
+ src=`dirname ${afile}`
+ dst=${src/#${LANG_EXPORT_DIR}/${LANG_BUILD_DIR}}
+ mkdir -p ${dst}
+ cp -r ${afile} ${dst}
+ done
+
+ cp \
+ ${SVN_EXPORT_DIR}/moodle/README.txt\
+ ${SVN_EXPORT_DIR}/moodle/LICENSE.txt\
+ ${SVN_EXPORT_DIR}/moodle/INSTALL.txt\
+ ${BUILD_DIR}
+
+ echo "ok!"
+}
+
+function pack ()
+{
+ target=$1;
+
+ echo -n "Packing ${target}..."
+ tar czf ${target}-`date +"%d-%m-%Y"`.tar.gz -C ${BUILD_DIR} ${target}
+ echo "ok!"
+}
+
+
+
+initdir;
+export_files;
+prepare $TARGET;
+pack $TARGET;
Property changes on: trunk/moodle/bin/package.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ LF
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|