2011-08-11 23:00:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
pecho() { printf %s\\n "$*"; }
|
|
|
|
log() { pecho "$@"; }
|
|
|
|
error() { log "ERROR: $@" >&2; }
|
|
|
|
fatal() { error "$@"; exit 1; }
|
2020-05-17 17:17:45 +02:00
|
|
|
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
|
|
|
|
2020-05-14 23:25:51 +02:00
|
|
|
# Move to the folder where ep-lite is installed
|
2020-05-14 23:43:45 +02:00
|
|
|
cd "$(dirname "$0")"/..
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:25:51 +02:00
|
|
|
# Is wget installed?
|
2020-05-14 23:28:53 +02:00
|
|
|
is_cmd wget || fatal "Please install wget"
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:25:51 +02:00
|
|
|
# Is zip installed?
|
2020-05-14 23:28:53 +02:00
|
|
|
is_cmd zip || fatal "Please install zip"
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:25:51 +02:00
|
|
|
# Is zip installed?
|
2020-05-14 23:28:53 +02:00
|
|
|
is_cmd unzip || fatal "Please install unzip"
|
2011-08-11 23:00:52 +02:00
|
|
|
|
|
|
|
START_FOLDER=$(pwd);
|
2016-03-14 21:56:02 +01:00
|
|
|
TMP_FOLDER=$(mktemp -d)
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "create a clean environment in $TMP_FOLDER..."
|
2020-05-14 23:40:16 +02:00
|
|
|
cp -ar . "$TMP_FOLDER"
|
|
|
|
cd "$TMP_FOLDER"
|
2011-08-11 23:00:52 +02:00
|
|
|
rm -rf node_modules
|
|
|
|
rm -f etherpad-lite-win.zip
|
|
|
|
|
2019-10-20 03:12:39 +02:00
|
|
|
# setting NODE_ENV=production ensures that dev dependencies are not installed,
|
|
|
|
# making the windows package smaller
|
|
|
|
export NODE_ENV=production
|
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "do a normal unix install first..."
|
2011-08-11 23:00:52 +02:00
|
|
|
bin/installDeps.sh || exit 1
|
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "copy the windows settings template..."
|
2012-06-29 16:28:05 +02:00
|
|
|
cp settings.json.template settings.json
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "resolve symbolic links..."
|
2011-08-11 23:00:52 +02:00
|
|
|
cp -rL node_modules node_modules_resolved
|
|
|
|
rm -rf node_modules
|
|
|
|
mv node_modules_resolved node_modules
|
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "download windows node..."
|
2011-08-11 23:00:52 +02:00
|
|
|
cd bin
|
2020-06-01 19:14:39 +02:00
|
|
|
wget "https://nodejs.org/dist/latest-erbium/win-x86/node.exe" -O ../node.exe
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "remove git history to reduce folder size"
|
2012-11-15 15:16:12 +01:00
|
|
|
rm -rf .git/objects
|
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "remove windows jsdom-nocontextify/test folder"
|
2020-05-14 23:40:16 +02:00
|
|
|
rm -rf "$TMP_FOLDER"/src/node_modules/wd/node_modules/request/node_modules/form-data/node_modules/combined-stream/test
|
|
|
|
rm -rf "$TMP_FOLDER"/src/node_modules/nodemailer/node_modules/mailcomposer/node_modules/mimelib/node_modules/encoding/node_modules/iconv-lite/encodings/tables
|
2012-11-16 21:51:08 +01:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "create the zip..."
|
2020-05-14 23:40:16 +02:00
|
|
|
cd "$TMP_FOLDER"
|
|
|
|
zip -9 -r "$START_FOLDER"/etherpad-lite-win.zip ./*
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "clean up..."
|
2020-05-14 23:40:16 +02:00
|
|
|
rm -rf "$TMP_FOLDER"
|
2011-08-11 23:00:52 +02:00
|
|
|
|
2020-05-14 23:28:53 +02:00
|
|
|
log "Finished. You can find the zip in the Etherpad root folder, it's called etherpad-lite-win.zip"
|