aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-28 22:14:31 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-28 22:14:31 +0200
commitc6c9281b939ca20b351a9c178254f05e69ced28b (patch)
tree85a47b0cca536d34d873528ab329fa3aecdd2851 /bin
parent7b93e5093e4a181e94eb61b9321e45c01df1feb9 (diff)
downloadetherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.tar.gz
etherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.tar.xz
etherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.zip
git-buildpackage-converted debian packaging
Diffstat (limited to '')
-rwxr-xr-xbin/build.sh39
-rwxr-xr-xbin/etherpad.init.d (renamed from build/apt/etc/init.d/etherpad)64
-rwxr-xr-xbin/run.sh15
3 files changed, 59 insertions, 59 deletions
diff --git a/bin/build.sh b/bin/build.sh
new file mode 100755
index 0000000..3e42c96
--- /dev/null
+++ b/bin/build.sh
@@ -0,0 +1,39 @@
+#! /bin/bash
+
+################################################################################
+#
+# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
+# http://www.pensec.it
+# mail@pensec.it
+# Copyright (c) 2010 Egil Möller <egil.moller@piratpartiet.se>
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+################################################################################
+
+#####
+# You have to change following lines to your requirements:
+#
+export JAVA_HOME="/usr/lib/jvm/java-6-sun/"
+export SCALA_HOME=/usr/share/java
+export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
+export JAVA="/usr/lib/jvm/java-6-sun/bin/java"
+export SCALA="/usr/bin/scala"
+export PATH="/usr/lib/jvm/java-6-sun/bin:$PATH"
+#####
+
+# Rebuild jar
+( cd infrastructure; ./bin/makejar.sh; )
+( cd infrastructure/ace; bin/make normal etherpad; )
+cp infrastructure/build/appjet.jar etherpad/appjet-eth-dev.jar
+rm -rf infrastructure/{appjet,build,buildjs,buildcache}
diff --git a/build/apt/etc/init.d/etherpad b/bin/etherpad.init.d
index 95847b8..5881b70 100755
--- a/build/apt/etc/init.d/etherpad
+++ b/bin/etherpad.init.d
@@ -1,7 +1,7 @@
#! /bin/bash
### BEGIN INIT INFO
-# Provides: etherpad-%BRANCH%
+# Provides: etherpad
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
@@ -41,40 +41,11 @@
# Do NOT "set -e"
-
-
-#####
-#
-# Patches the configuration file by replacing ,,%$2%'' with the contents of file
-# $1 in file $3
-#
-# @param $1 Configuration File which contains the value to set to
-# @param $2 Configuration key to apply (can be done only once)
-# @param $3 Configuration file
-#
-function apply_config() {
- CONFIG_FILE="${3}"
- TMP_FILE="/tmp/etherpad.properties"
-
- CONFIG_KEY="$2"
- CONFIG_VALUE=`cat $1`
-
- sed "s/%$CONFIG_KEY%/$CONFIG_VALUE/" $CONFIG_FILE > $TMP_FILE
- cp $TMP_FILE $CONFIG_FILE
- rm $TMP_FILE
-}
-#
-#####
-
-
-
-
-
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="etherpad daemon"
NAME="etherpad"
-DAEMON_BASE="/usr/share/etherpad/etherpad"
+DAEMON_BASE="/usr/share/etherpad"
DAEMON=$DAEMON_BASE/bin/run.sh
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
@@ -98,31 +69,6 @@ SCRIPTNAME=/etc/init.d/$NAME
#
do_start()
{
- CONFIGURATION_BASE="/etc/etherpad"
- CONFIGURATION_SRC="${CONFIGURATION_BASE}/etherpad.properties"
- CONFIGURATION_DEST="${DAEMON_BASE}/etc/etherpad.localdev-default.properties"
-
-
- # Reset configuration
- cp "${CONFIGURATION_BASE}/etherpad.properties" "${CONFIGURATION_DEST}"
-
-
- # Apply configuration properties
- apply_config "${CONFIGURATION_BASE}/properties/is-production" "IS_PRODUCTION" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/admin-password" "ADMIN_PASSWORD" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/port" "PORT" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/database-host" "DATABASE_HOST" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/database-port" "DATABASE_PORT" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/database-name" "DATABASE_NAME" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/database-username" "DATABASE_USERNAME" "${CONFIGURATION_DEST}"
- apply_config "${CONFIGURATION_BASE}/properties/database-password" "DATABASE_PASSWORD" "${CONFIGURATION_DEST}"
-
-
- # Give the etherpad user the configuration file
- chown etherpad:etherpad "${CONFIGURATION_DEST}"
-
-
-
# Return
# 0 if daemon has been started
# 1 if daemon was already running
@@ -147,7 +93,7 @@ do_stop()
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name java
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
@@ -156,7 +102,7 @@ do_stop()
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec java
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
@@ -172,7 +118,7 @@ do_reload() {
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name java
return 0
}
diff --git a/bin/run.sh b/bin/run.sh
new file mode 100755
index 0000000..bd46b79
--- /dev/null
+++ b/bin/run.sh
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+#####
+# You have to change following lines to your requirements:
+#
+export JAVA_HOME="/usr/lib/jvm/java-6-sun/"
+export SCALA_HOME=/usr/share/java
+export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
+export JAVA="/usr/lib/jvm/java-6-sun/bin/java"
+export SCALA="/usr/bin/scala"
+export PATH="/usr/lib/jvm/java-6-sun/bin:$PATH"
+#####
+
+cd etherpad
+exec bin/run-local.sh