diff --git a/.gitignore b/.gitignore index df6d75be..13f01feb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ node_modules settings.json -static/js/jquery.min.js \ No newline at end of file +static/js/jquery.min.js +bin/abiword.exe +bin/node.exe +etherpad-lite-win.zip diff --git a/bin/buildForWindows.sh b/bin/buildForWindows.sh new file mode 100755 index 00000000..f3442488 --- /dev/null +++ b/bin/buildForWindows.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +NODE_VERSION="0.5.3" + +#Move to the folder where ep-lite is installed +cd `dirname $0` + +#Was this script started in the bin folder? if yes move out +if [ -d "../bin" ]; then + cd "../" +fi + +#Is wget installed? +hash wget > /dev/null 2>&1 || { + echo "Please install wget" >&2 + exit 1 +} + +#Is zip installed? +hash zip > /dev/null 2>&1 || { + echo "Please install zip" >&2 + exit 1 +} + +#Is zip installed? +hash unzip > /dev/null 2>&1 || { + echo "Please install unzip" >&2 + exit 1 +} + +START_FOLDER=$(pwd); + +echo "create a clean enviroment in /tmp/etherpad-lite-win..." +rm -rf /tmp/etherpad-lite-win +cp -ar . /tmp/etherpad-lite-win +cd /tmp/etherpad-lite-win +rm -rf node_modules +rm -f etherpad-lite-win.zip + +echo "do a normal unix install first..." +bin/installDeps.sh || exit 1 + +echo "copy the windows settings template..." +cp settings.json.template_windows settings.json + +echo "resolve symbolic links..." +cp -rL node_modules node_modules_resolved +rm -rf node_modules +mv node_modules_resolved node_modules + +echo "remove sqlite, cause we can't use it with windows..." +rm -rf node_modules/ueberDB/node_modules/sqlite3 + +echo "replace log4js with a patched log4js, this log4js runs on windows too..." +rm -rf node_modules/log4js/* +wget https://github.com/Pita/log4js-node/zipball/master -O log4js.zip +unzip log4js.zip +mv Pita-log4js-node*/* node_modules/log4js +rm -rf log4js.zip Pita-log4js-node* + +echo "download windows node..." +cd bin +wget "http://nodejs.org/dist/v$NODE_VERSION/node.exe" -O node.exe + +echo "create the zip..." +cd /tmp +zip -9 -r etherpad-lite-win.zip etherpad-lite-win +mv etherpad-lite-win.zip $START_FOLDER + +echo "clean up..." +rm -rf /tmp/etherpad-lite-win + +echo "finished. You can find the zip in the etherpad lite root folder, its called etherpad-lite-win.zip" diff --git a/package.json b/package.json index 4ae1a087..6005e5fb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ ], "dependencies" : { "socket.io" : "0.7.8", - "ueberDB" : "0.0.14", + "ueberDB" : "0.0.15", "async" : "0.1.9", "joose" : "3.18.0", "express" : "2.4.4", diff --git a/settings.json.template_windows b/settings.json.template_windows new file mode 100644 index 00000000..235ec71a --- /dev/null +++ b/settings.json.template_windows @@ -0,0 +1,38 @@ +/* + This file must be valid JSON. But comments are allowed + + Please edit settings.json, not settings.json.template +*/ +{ + //Ip and port which etherpad should bind at + "ip": "0.0.0.0", + "port" : 9001, + + //The Type of the database. You can choose between sqlite and mysql + "dbType" : "dirty", + //the database specific settings + "dbSettings" : { + "filename" : "../var/dirty.db" + }, + + /* An Example of MySQL Configuration + "dbType" : "mysql", + "dbSettings" : { + "user" : "root", + "host" : "localhost", + "password": "", + "database": "store" + }, + */ + + //the default text of a pad + "defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n", + + /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly, + but makes it impossible to debug the javascript/css */ + "minify" : false, + + /* This is the path to the Abiword executable. Setting it to null, disables abiword. + Abiword is needed to enable the import/export of pads*/ + "abiword" : null +} diff --git a/start.bat b/start.bat new file mode 100644 index 00000000..cf6a60f1 --- /dev/null +++ b/start.bat @@ -0,0 +1,2 @@ +cd node +..\bin\node server.js