aboutsummaryrefslogtreecommitdiffstats
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
parent7b93e5093e4a181e94eb61b9321e45c01df1feb9 (diff)
downloadetherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.tar.gz
etherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.tar.xz
etherpad-c6c9281b939ca20b351a9c178254f05e69ced28b.zip
git-buildpackage-converted debian packaging
-rw-r--r--.gitignore3
-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
-rw-r--r--build/apt/.gitignore5
-rw-r--r--build/apt/DEBIAN/control16
-rwxr-xr-xbuild/apt/DEBIAN/postinst143
-rw-r--r--build/apt/DEBIAN/templates68
-rw-r--r--build/apt/README25
-rw-r--r--build/apt/TODO7
-rwxr-xr-xbuild/apt/build/build.sh236
-rw-r--r--build/apt/build/makejar.diff17
-rwxr-xr-xbuild/apt/build/test.sh52
-rwxr-xr-xbuild/apt/do.sh127
-rw-r--r--build/apt/etc/etherpad/etherpad.properties16
-rw-r--r--build/apt/etc/etherpad/properties/admin-password0
-rw-r--r--build/apt/etc/etherpad/properties/database-host0
-rw-r--r--build/apt/etc/etherpad/properties/database-name0
-rw-r--r--build/apt/etc/etherpad/properties/database-password0
-rw-r--r--build/apt/etc/etherpad/properties/database-port0
-rw-r--r--build/apt/etc/etherpad/properties/database-username0
-rw-r--r--build/apt/etc/etherpad/properties/is-production0
-rw-r--r--build/apt/etc/etherpad/properties/port0
-rw-r--r--debian/README6
-rw-r--r--debian/README.Debian6
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/config49
-rw-r--r--debian/control20
-rw-r--r--debian/copyright42
-rwxr-xr-xdebian/postinst81
-rw-r--r--debian/postrm38
-rw-r--r--[-rwxr-xr-x]debian/preinst (renamed from build/apt/build/run.sh)10
-rwxr-xr-xdebian/prerm (renamed from build/apt/DEBIAN/prerm)15
-rwxr-xr-xdebian/rules139
-rw-r--r--debian/templates11
-rwxr-xr-xetherpad/bin/run-local.sh3
-rw-r--r--etherpad/etc/etherpad.local.properties.tmpl23
38 files changed, 506 insertions, 776 deletions
diff --git a/.gitignore b/.gitignore
index c99c9f1..e7289c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,6 @@ etherpad/src/static/js/easysync2_client.js
etherpad/src/static/js/linestylefilter_client.js
etherpad/*.log
infrastructure/lib/cos.jar
+build-arch-stamp
+build-indep-stamp
+configure-stamp
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
diff --git a/build/apt/.gitignore b/build/apt/.gitignore
deleted file mode 100644
index 50139f0..0000000
--- a/build/apt/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*~
-.tmp*
-.build*
-.package*
-.revision*
diff --git a/build/apt/DEBIAN/control b/build/apt/DEBIAN/control
deleted file mode 100644
index 0129652..0000000
--- a/build/apt/DEBIAN/control
+++ /dev/null
@@ -1,16 +0,0 @@
-Package: etherpad-%BRANCH%
-Priority: optional
-Section: web
-Maintainer: penSec.IT UG (haftungsbeschränkt) <etherpad@pensec.it>
-Architecture: all
-Version: 1.0-%REVISION%
-Depends: debconf (>= 0.2.17), sun-java6-jre, scala, mysql-server, mysql-client, libmysql-java, bash
-Description: Etherpad is...
- EtherPad is the only web-based word processor that allows people to work
- together in really real-time.
- .
- When multiple people edit the same document simultaneously, any changes are
- instantly reflected on everyone's screen. The result is a new and productive
- way to collaborate on text documents, useful for meeting notes, drafting
- sessions, education, team programming, and more.
-
diff --git a/build/apt/DEBIAN/postinst b/build/apt/DEBIAN/postinst
deleted file mode 100755
index f872508..0000000
--- a/build/apt/DEBIAN/postinst
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/bin/bash
-
-################################################################################
-#
-# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
-# http://www.pensec.it
-# mail@pensec.it
-#
-# 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.
-#
-################################################################################
-
-
-
-set -e
-. /usr/share/debconf/confmodule
-
-if [ -n "$ETHERPAD_DEBUG" ]; then
- echo "now debugging $0 $@"
- set -x
-fi
-
-db_version 2.0
-
-
-
-
-
-#####
-#
-# Propts the user for a configuration value and writes it into a property file
-#
-# @param $1 Name of the debconfig template to prompt
-# @param $2 File to write the answer to
-# @param $3 deprecated
-#
-function configuration_property() {
- TEMPLATE="${1}"
- PROPERTY_FILE="/etc/etherpad/properties/${2}"
- PLACEHOLDER="${3}"
-
- PROPERTY=""
- if [ -f "${PROPERTY_FILE}" ]; then
- PROPERTY=`cat "${PROPERTY_FILE}"`
- fi
- db_input high "etherpad-%BRANCH%/${TEMPLATE}" || true
- db_go
-
- db_get "etherpad-%BRANCH%/${TEMPLATE}"
- if [ "" != "$RET" ]; then
- PROPERTY="$RET"
- fi
-
- echo "${PROPERTY}" > "${PROPERTY_FILE}"
-}
-#
-#####
-
-
-
-case "$1" in
-
- configure)
-
- # Create system user
- if ! getent passwd etherpad > /dev/null ; then
- echo 'Adding system-user for etherpad' 1>&2
- adduser --system --group --quiet \
- --home /usr/share/etherpad --no-create-home \
- --disabled-login --force-badname etherpad
- fi
-
-
- # Give user the rights to write into the log & data directory
- if [ -d "/var/log/etherpad" ]; then
- EMPTY_STATEMENT="true"
- else
- mkdir -p "/var/log/etherpad"
- fi
- chown -R etherpad:etherpad "/var/log/etherpad"
-
- if [ -d "/usr/share/etherpad/etherpad/data" ]; then
- EMPTY_STATEMENT="true"
- else
- mkdir -p "/usr/share/etherpad/etherpad/data"
- fi
- chown -R etherpad:etherpad "/usr/share/etherpad/etherpad/data"
-
-
- # Give user the rights do write everywhere, did not yet figure
- # out which rights are necessary, exactly
- chown -R etherpad:etherpad "/usr/share/etherpad"
- ;;
-
-esac
-
-
-
-#####
-#
-# Get configuration properties
-#
-configuration_property "is_production" "is-production" "IS_PRODUCTION"
-configuration_property "admin_password" "admin-password" "ADMIN_PASSWORD"
-configuration_property "port" "port" "PORT"
-configuration_property "database_host" "database-host" "DATABASE_HOST"
-configuration_property "database_port" "database-port" "DATABASE_PORT"
-configuration_property "database_name" "database-name" "DATABASE_NAME"
-configuration_property "database_username" "database-username" "DATABASE_USERNAME"
-configuration_property "database_password" "database-password" "DATABASE_PASSWORD"
-#
-#####
-
-
-
-
-
-#####
-#
-# MySQL-Autosetup should be discussed. Simply calling setup-myql-db.sh is
-# insufficient
-#
-# # Auto-setup database
-# db_input medium "etherpad-%BRANCH%/setup_database" || true
-# db_go
-#
-# db_get "etherpad-%BRANCH%/setup_database"
-# if [ "$RET" = "true" ]; then
-# # TODO
-# fi
-#
-#####
-
diff --git a/build/apt/DEBIAN/templates b/build/apt/DEBIAN/templates
deleted file mode 100644
index d7c6f36..0000000
--- a/build/apt/DEBIAN/templates
+++ /dev/null
@@ -1,68 +0,0 @@
-Template: etherpad-%BRANCH%/is_production
-Type: boolean
-Default: false
-Description: Install as production mode?
- Do you wish to install etherpad in production mode?
- .
- Note: be aware that etherpad is under active development and not yet ready
- for general deployment!
-
-Template: etherpad-%BRANCH%/admin_password
-Type: password
-Default: password
-Description: etherpad administration password
- Please insert the administration password, default is password.
-
-Template: etherpad-%BRANCH%/port
-Type: string
-Default: 9000
-Description: etherpad tcp port
- Please insert the port on which etherpad should listen, default is 9000. You
- cannot use privileged ports (<= 1024).
- .
- If you want to make etherpad available on port 80/443 use etherpad-proxy which
- will install a webserver (like nginx or apache) to proxy dynamic etherpad
- contents and serve static contents directly.
-
-Template: etherpad-%BRANCH%/setup_database
-Type: boolean
-Default: false
-Description: Do yo want etherpad to create a database for you?
- Do you want to use the database wizard to setup a database for etherpad to
- use?
- .
- Note: This wizard only works with local mysql installations. If you want to use
- a remote mysql database, then answer no and edit
- /etc/etherpad/etherpad.properties appropriatly.
-
-Template: etherpad-%BRANCH%/database_host
-Type: string
-Default: localhost
-Description: MySQL database hostname
- Please insert the database hostname, default is localhost.
-
-Template: etherpad-%BRANCH%/database_port
-Type: string
-Default: 3306
-Description: MySQL database port
- Please insert the database port, default is 3306.
-
-Template: etherpad-%BRANCH%/database_name
-Type: string
-Default: etherpad
-Description: MySQL database name
- Please insert the database name, default is etherpad.
-
-Template: etherpad-%BRANCH%/database_username
-Type: string
-Default: etherpad
-Description: MySQL database username
- Please insert the database username, default is etherpad.
-
-Template: etherpad-%BRANCH%/database_password
-Type: password
-Default: password
-Description: MySQL database password
- Please insert the password for the specified database user, default is
- password.
-
diff --git a/build/apt/README b/build/apt/README
deleted file mode 100644
index 7dba49b..0000000
--- a/build/apt/README
+++ /dev/null
@@ -1,25 +0,0 @@
-README
-======
-
-This is a simple script to build debian packages from different etherpad
-repositories. All you have to do is call ./do.sh and select the repository to
-build from.
-
-Depending on the repository you use you have to have installed mercurial or
-git-core in addition to the following packages:
-
- * debconf (>= 0.2.17)
- * dpkg
- * sun-java6-jdk
- * scala
- * mysql-client
- * libmysql-java
- * bash
-
-
-
----
-
-If you need commercial support on etherpad don't hesitate to contact
-mail@pensec.it
-
diff --git a/build/apt/TODO b/build/apt/TODO
deleted file mode 100644
index 9389c82..0000000
--- a/build/apt/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
-TODO
-====
-
- * Auto-Database setup
- * etherpad-official replaces etherpad-deprecated and etherpad-devel (and vice-
- versa)
-
diff --git a/build/apt/build/build.sh b/build/apt/build/build.sh
deleted file mode 100755
index ce308bb..0000000
--- a/build/apt/build/build.sh
+++ /dev/null
@@ -1,236 +0,0 @@
-#!/bin/bash
-
-################################################################################
-#
-# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
-# http://www.pensec.it
-# mail@pensec.it
-#
-# 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.
-#
-################################################################################
-
-
-
-#####
-# Build a Debian/Ubuntu Etherpad package of the source
-#
-# @param $1 (optional) If "${1}" == "rebuild" then the cached repository will be
-# purged and cloned instead of simply updated
-# @param $REPOSITORY_URL the source of the package
-# @param $REPOSITORY_NAME name of the new package, package will be named
-# etherpad-${REPOSITORY_NAME}
-# @param $REPOSITORY_TYPE Element of set {hg, git}, describes which command line
-# toolchain (mercurial or git) will be used
-#
-if [ "" == "${REPOSITORY_URL}" ]; then
- echo "Missing environment variable REPOSITORY_URL"
- exit 1
-fi
-if [ "" == "${REPOSITORY_NAME}" ]; then
- echo "Missing environment variable REPOSITORY_NAME"
- exit 1
-fi
-if [ "" == "${REPOSITORY_TYPE}" ]; then
- echo "Missing environment variable REPOSITORY_TYPE"
- exit 1
-fi
-
-
-
-#####
-# 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="$JAVA_HOME/bin/java"
-export SCALA="$SCALA_HOME/bin/scala"
-export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH"
-#
-#####
-
-
-#####
-# Don't change this!
-#
-REPOSITORY="${REPOSITORY_URL}"
-BRANCH="${REPOSITORY_NAME}"
-
-TMP_DIR=".tmp.${REPOSITORY_NAME}"
-BUILD_DIR=".build.${REPOSITORY_NAME}"
-PACKAGE_DIR=".package.${REPOSITORY_NAME}"
-REVISION_FILE=".revision.${REPOSITORY_NAME}"
-
-REBUILD="no"
-if [ "rebuild" == "${1}" ]; then
- REBUILD="yes"
-fi
-#
-#####
-
-
-
-# If the repository isn't checked out by now we can't do a simple {git|hg} pull,
-# we need to do a complete {git|hg} clone instead
-if [ "yes" != "${REBUILD}" ]; then
- if [ -d "${TMP_DIR}" ]; then
- bash -c "cd ${TMP_DIR}; ${REPOSITORY_TYPE} pull"
- else
- echo "Repository does not exist, will fetch"
- REBUILD="yes"
- fi
-fi
-
-# Refresh the complett repository (purge & clone instead of pull)
-if [ "yes" == "${REBUILD}" ]; then
- if [ -d "${TMP_DIR}" ]; then
- rm -rf "${TMP_DIR}"
- fi
-
- # Fetch the source from remote endpoint
- $REPOSITORY_TYPE clone "${REPOSITORY}" "${TMP_DIR}"
-fi
-
-
-
-# If there where errors during {git,hg} clone, then ${TMP_DIR} does not exist
-# and we can't continue
-if [ -d "${TMP_DIR}" ]; then
- echo "Checkout seesm successful, continuing..."
-else
- echo "Error while checkout, missing directory ${TMP_DIR}"
- exit 1
-fi
-
-# Ugly fix to work with the google repository which includes a trunk and
-# branches directory instead of using mercurial branches
-if [ -d "${TMP_DIR}/trunk" ]; then
- touch "${TMP_DIR}/LICENSE"
- touch "${TMP_DIR}/README.md"
- bash -c "cd ${TMP_DIR}; cp -r trunk/* ./"
-fi
-
-
-
-# Rebuild jar
-echo ""
-echo "Trying to apply patch. If it detects the patch doesn't match just skip"
-echo ""
-cp "build/makejar.diff" "${TMP_DIR}/makejar.diff"
-bash -c "cd ${TMP_DIR}; patch -p1 < makejar.diff"
-bash -c "cd ${TMP_DIR}/infrastructure; ./bin/makejar.sh"
-bash -c "cd ${TMP_DIR}/infrastructure/ace; bin/make normal etherpad"
-cp "${TMP_DIR}/infrastructure/build/appjet.jar" "${TMP_DIR}/etherpad/appjet-eth-dev.jar"
-
-
-
-# Testing the build
-#bash -c "./build/test-build.sh"
-
-
-
-# Increments the version & create the control file
-REVISION="0"
-if [ -f "${REVISION_FILE}" ]; then
- REVISION=`cat "${REVISION_FILE}"`
- REVISION=`expr $REVISION + 1`
-fi
-echo $REVISION > "${REVISION_FILE}"
-
-# Patch the debain control file
-cp "DEBIAN/control" "${TMP_DIR}/control.0"
-sed "s/%BRANCH%/${BRANCH}/" "${TMP_DIR}/control.0" > "${TMP_DIR}/control.1"
-sed "s/%REVISION%/${REVISION}/" "${TMP_DIR}/control.1" > "${TMP_DIR}/control.2"
-cp "${TMP_DIR}/control.2" "${TMP_DIR}/control"
-
-# Patch the install & deinstall script
-cp "DEBIAN/prerm" "${TMP_DIR}/prerm"
-cp "DEBIAN/postinst" "${TMP_DIR}/postinst.0"
-sed "s/%BRANCH%/${BRANCH}/" "${TMP_DIR}/postinst.0" > "${TMP_DIR}/postinst.1"
-cp "${TMP_DIR}/postinst.1" "${TMP_DIR}/postinst"
-
-# Patch debconf templates
-cp "DEBIAN/templates" "${TMP_DIR}/templates.0"
-sed "s/%BRANCH%/${BRANCH}/" "${TMP_DIR}/templates.0" > "${TMP_DIR}/templates.1"
-cp "${TMP_DIR}/templates.1" "${TMP_DIR}/templates"
-
-# Patch init script
-cp "etc/init.d/etherpad" "${TMP_DIR}/init.0"
-sed "s/%BRANCH%/${BRANCH}/" "${TMP_DIR}/init.0" > "${TMP_DIR}/init.1"
-cp "${TMP_DIR}/init.1" "${TMP_DIR}/init"
-
-# Copy the config folder
-cp -r "etc" "${TMP_DIR}/etc"
-
-
-
-# Build the package enviroment (needed to build with dpgk-deb build)
-if [ -d "${BUILD_DIR}" ]; then
- sudo rm -r "${BUILD_DIR}"
-fi
-mkdir "${BUILD_DIR}"
-mkdir -p "${BUILD_DIR}/DEBIAN"
-mkdir -p "${BUILD_DIR}/usr/share/etherpad"
-mkdir -p "${BUILD_DIR}/usr/share/doc/etherpad"
-mkdir -p "${BUILD_DIR}/var/log/etherpad"
-
-
-
-# Gather the required files
-cp "${TMP_DIR}/control" "${BUILD_DIR}/DEBIAN/control"
-cp "${TMP_DIR}/postinst" "${BUILD_DIR}/DEBIAN/postinst"
-cp "${TMP_DIR}/prerm" "${BUILD_DIR}/DEBIAN/prerm"
-cp "${TMP_DIR}/templates" "${BUILD_DIR}/DEBIAN/templates"
-cp -r "${TMP_DIR}/etc" "${BUILD_DIR}/"
-cp "${TMP_DIR}/init" "${BUILD_DIR}/etc/init.d/etherpad"
-cp -r "${TMP_DIR}/etherpad" "${BUILD_DIR}/usr/share/etherpad"
-cp "build/run.sh" "${BUILD_DIR}/usr/share/etherpad/etherpad/bin"
-mkdir -p "${BUILD_DIR}/usr/share/etherpad/etherpad/data"
-cp -r "${TMP_DIR}/infrastructure" "${BUILD_DIR}/usr/share/etherpad"
-cp "${TMP_DIR}/COPYING" "${BUILD_DIR}/usr/share/doc/etherpad"
-cp "${TMP_DIR}/LICENSE" "${BUILD_DIR}/usr/share/doc/etherpad"
-cp "${TMP_DIR}/README.md" "${BUILD_DIR}/usr/share/doc/etherpad"
-
-
-
-# Fix priviliges and build the package
-sudo chown -R root:root "${BUILD_DIR}"
-sudo chmod +x "${BUILD_DIR}/DEBIAN/postinst"
-sudo chmod +x "${BUILD_DIR}/DEBIAN/prerm"
-sudo chmod +x "${BUILD_DIR}/etc/init.d/etherpad"
-sudo chmod -R 777 "${BUILD_DIR}/usr/share/etherpad/etherpad/data"
-
-if [ -d "${PACKAGE_DIR}" ]; then
- rm -rf "${PACKAGE_DIR}"
-fi
-mkdir "${PACKAGE_DIR}"
-
-dpkg-deb --build "${BUILD_DIR}" "${PACKAGE_DIR}"
-
-
-
-# Transfer the package to local repository if environment variable
-PACKAGE=`bash -c "cd ${PACKAGE_DIR}; find . -name *.deb"`
-
-if [ "yes" == "${DEPLOY_TO_LOCAL_REPOSITORY}" ]; then
- if [ -f "${PACKAGE_DIR}/${PACKAGE}" ]; then
- cp "${PACKAGE_DIR}/${PACKAGE}" "/var/www/packages"
- bash -c "cd /var/www/packages; reprepro -b . includedeb lenny ${PACKAGE}; rm ${PACKAGE}"
- else
- echo "No package in ${PACKAGE_DIR}"
- fi
-fi
-
-echo "Finished building package ${PACKAGE}"
-
diff --git a/build/apt/build/makejar.diff b/build/apt/build/makejar.diff
deleted file mode 100644
index 6e0d44e..0000000
--- a/build/apt/build/makejar.diff
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -r 81287c8af1ac infrastructure/bin/makejar.sh
---- a/infrastructure/bin/makejar.sh Fri Dec 18 18:44:23 2009 +1100
-+++ b/infrastructure/bin/makejar.sh Sat Dec 19 09:50:05 2009 -0500
-@@ -32,11 +32,11 @@
-
- TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s`
-
--JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/manifest`
-+JARFILES=`echo $SCALA_HOME/scala-library.jar lib/*.jar lib/manifest`
- function genjar {
- echo "unzipping JARs..."
- pushd $1 >> /dev/null
-- $JAR xf $SCALA_HOME/lib/scala-library.jar
-+ $JAR xf $SCALA_HOME/scala-library.jar
- rm -rf META-INF
- for a in ../../lib/*.jar; do
- $JAR xf $a
diff --git a/build/apt/build/test.sh b/build/apt/build/test.sh
deleted file mode 100755
index 0abf7bf..0000000
--- a/build/apt/build/test.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-################################################################################
-#
-# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
-# http://www.pensec.it
-# mail@pensec.it
-#
-# 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.
-#
-################################################################################
-
-
-
-
-
-#####
-# Must be called by build.sh
-#####
-
-
-
-# Truncate database to test start etherpad
-echo "I'm going to lunch MySQL now, you maybe have to enter your root@localhost password"
-sudo /etc/init.d/mysql start
-
-DATABASE_NAME="etherpad"
-DATABASE_USER="etherpad"
-DROP_DATABASE="DROP DATABASE ${DATABASE_NAME}"
-CREATE_DATABASE="CREATE DATABASE ${DATABASE_NAME}"
-DROP_USER="DROP USER '${DATABASE_USER}'@'localhost'"
-CREATE_USER="GRANT ALL PRIVILEGES ON ${DATABASE_NAME}.* TO '${DATABASE_USER}'@'localhost' identified by 'password';"
-echo "${DROP_DATABASE}; ${CREATE_DATABASE}; ${DROP_USER}; ${CREATE_USER}" | mysql -u root -p | grep etherpad
-
-
-
-# Start etherpad and wait for the HTTP-Server to be available
-echo "I'm going to lunch etherpad in a clean environment, try if it works on http://localhost:9000/"
-echo "Kill with ^C to build debian package (waiting 10 seconds)"
-sleep 10
-bash -c "cd ${TMP_DIR}/etherpad; ./bin/run-local.sh"
-
diff --git a/build/apt/do.sh b/build/apt/do.sh
deleted file mode 100755
index c268ce9..0000000
--- a/build/apt/do.sh
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-
-################################################################################
-#
-# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
-# http://www.pensec.it
-# mail@pensec.it
-#
-# 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.
-#
-################################################################################
-
-
-
-#####
-#
-# To build a Debian/Ubuntu package simply run this script. It will prompt you
-# for the repository to build from.
-#
-# Dependencies: debconf (>= 0.2.17), dpkg, sun-java6-jdk, scala, mysql-client,
-# libmysql-java, bash, mercurial | git-core
-#
-#####
-
-
-
-#####
-#
-# There has to be a better way of doing this ;-)
-#
-REPOSITORY_0_URL="https://etherpad.googlecode.com/hg/trunk"
-REPOSITORY_0_NAME="deprecated"
-REPOSITORY_0_TYPE="hg"
-REPOSITORY_1_URL="git://github.com/ether/pad.git"
-REPOSITORY_1_NAME="official"
-REPOSITORY_1_TYPE="git"
-REPOSITORY_2_URL="git://github.com/redhog/pad.git"
-REPOSITORY_2_NAME="devel"
-REPOSITORY_2_TYPE="git"
-REPOSITORY_3_URL="git://github.com/johnyma22/pad.git"
-REPOSITORY_3_NAME="johny"
-REPOSITORY_3_TYPE="git"
-REPOSITORY_4_URL="git://github.com/Pita/pad.git"
-REPOSITORY_4_NAME="pita"
-REPOSITORY_4_TYPE="git"
-REPOSITORY_5_URL="./../../"
-REPOSITORY_5_NAME="local"
-REPOSITORY_5_TYPE="git"
-
-
-# Tell the user his choises
-echo "Please choose the repository to build a debian package from:"
-echo ""
-
-for i in {0..5}
-do
- URL="REPOSITORY_${i}_URL"
- NAME="REPOSITORY_${i}_NAME"
- TYPE="REPOSITORY_${i}_TYPE"
-
- echo " ${i}) ${!NAME} ${!URL}"
-done
-echo ""
-read -p "Repository id: " REPOSITORY
-
-
-
-# Test if user's too stupid to input correct number
-URL="REPOSITORY_${REPOSITORY}_URL"
-NAME="REPOSITORY_${REPOSITORY}_NAME"
-TYPE="REPOSITORY_${REPOSITORY}_TYPE"
-
-if [ "" == "${!URL}" ]; then
- echo "Invalid repository id \"${REPOSITORY}\""
- exit 1
-fi
-
-
-# Communicate repository details to build script
-export REPOSITORY_URL="${!URL}"
-export REPOSITORY_NAME="${!NAME}"
-export REPOSITORY_TYPE="${!TYPE}"
-#
-#####
-
-
-
-#####
-#
-# Is a complete rebuild necessary or is a simple update sufficient
-#
-echo ""
-read -p "Purge before rebuild (yes/no) [n]: " REBUILD
-
-if [ "y" == "${REBUILD}" ]; then
- echo "You answered \"${REBUILD}\", will purge before rebuilding"
- REBUILD="rebuild"
-else
- echo "You answered \"${REBUILD}\", will try ${!TYPE} pull before rebuilding"
-fi
-#
-#####
-
-
-
-#####
-#
-# Tell user what we're going to to and then do it
-#
-echo ""
-echo "Will build package etherpad-${!NAME} form ${!TYPE}:${!URL}, please be patient..."
-echo ""
-
-bash -c "./build/build.sh ${REBUILD}"
-#
-#####
-
diff --git a/build/apt/etc/etherpad/etherpad.properties b/build/apt/etc/etherpad/etherpad.properties
deleted file mode 100644
index 69114c7..0000000
--- a/build/apt/etc/etherpad/etherpad.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-ajstdlibHome = ../infrastructure/framework-src/modules
-appjetHome = ./data/appjet
-devMode = true
-etherpad.adminPass = %ADMIN_PASSWORD%
-etherpad.fakeProduction = false
-etherpad.isProduction = %IS_PRODUCTION%
-etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver
-etherpad.SQL_JDBC_URL = jdbc:mysql://%DATABASE_HOST%:%DATABASE_PORT%/%DATABASE_NAME%
-etherpad.SQL_PASSWORD = %DATABASE_PASSWORD%
-etherpad.SQL_USERNAME = %DATABASE_USERNAME%
-listen = %PORT%
-logDir = /var/log/etherpad
-modulePath = ./src
-transportPrefix = /comet
-transportUseWildcardSubdomains = true
-useVirtualFileRoot = ./src
diff --git a/build/apt/etc/etherpad/properties/admin-password b/build/apt/etc/etherpad/properties/admin-password
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/admin-password
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/database-host b/build/apt/etc/etherpad/properties/database-host
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/database-host
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/database-name b/build/apt/etc/etherpad/properties/database-name
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/database-name
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/database-password b/build/apt/etc/etherpad/properties/database-password
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/database-password
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/database-port b/build/apt/etc/etherpad/properties/database-port
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/database-port
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/database-username b/build/apt/etc/etherpad/properties/database-username
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/database-username
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/is-production b/build/apt/etc/etherpad/properties/is-production
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/is-production
+++ /dev/null
diff --git a/build/apt/etc/etherpad/properties/port b/build/apt/etc/etherpad/properties/port
deleted file mode 100644
index e69de29..0000000
--- a/build/apt/etc/etherpad/properties/port
+++ /dev/null
diff --git a/debian/README b/debian/README
new file mode 100644
index 0000000..21f1d88
--- /dev/null
+++ b/debian/README
@@ -0,0 +1,6 @@
+The Debian Package etherpad
+----------------------------
+
+Comments regarding the Package
+
+ -- Egil Möller <egil.moller@piratpartiet.se> Mon, 26 Apr 2010 19:51:51 +0200
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..b246eb5
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,6 @@
+etherpad for Debian
+-------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- Egil Möller <egil.moller@piratpartiet.se> Mon, 26 Apr 2010 19:51:51 +0200
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..9f15642
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+etherpad (1.0) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Egil Möller <egil.moller@piratpartiet.se> Mon, 26 Apr 2010 19:51:51 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/config b/debian/config
new file mode 100644
index 0000000..f97ab33
--- /dev/null
+++ b/debian/config
@@ -0,0 +1,49 @@
+#!/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.
+#
+################################################################################
+
+
+
+set -e
+. /usr/share/debconf/confmodule
+
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
+
+db_version 2.0
+
+# Set up database
+. /usr/share/dbconfig-common/dpkg/config.mysql
+dbc_go etherpad $@
+
+db_input high "etherpad/admin_password" || true
+db_go
+
+db_get "etherpad/topdomains"
+if ! [ "$RET" ]; then
+ db_set "etherpad/topdomains" "$(hostname -f)"
+fi
+
+db_input high "etherpad/topdomains" || true
+db_go
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..14ffd66
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: etherpad
+Section: unknown
+Priority: extra
+Maintainer: Egil Möller <egil.moller@piratpartiet.se>
+Build-Depends: debhelper (>= 7), dbconfig-common, sun-java6-jdk, mysql-client, libmysql-java, scala (>= 2.7)
+Build-Conflicts: libgcj-common, java-gcj-compat-headless, java-gcj-compat, gcj-4.3-base
+Standards-Version: 3.8.0
+Homepage: <insert the upstream URL, if relevant>
+
+Package: etherpad
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dbconfig-common, sun-java6-jdk, mysql-client, libmysql-java, scala (>= 2.7)
+Description: Etherpad multiuser web-based word processor
+ EtherPad is the only web-based word processor that allows people to work
+ together in really real-time.
+ .
+ When multiple people edit the same document simultaneously, any changes are
+ instantly reflected on everyone's screen. The result is a new and productive
+ way to collaborate on text documents, useful for meeting notes, drafting
+ sessions, education, team programming, and more.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..21f3788
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,42 @@
+This package was debianized by Egil Möller <egil.moller@piratpartiet.se> on
+Mon, 26 Apr 2010 19:51:51 +0200.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted under the terms of the BSD License.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+On Debian systems, the complete text of the BSD License can be
+found in `/usr/share/common-licenses/BSD'.
+
+
+The Debian packaging is copyright 2010, Egil Möller <egil.moller@piratpartiet.se> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..3b85741
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+################################################################################
+#
+# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
+# http://www.pensec.it
+# mail@pensec.it
+#
+# 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.
+#
+################################################################################
+
+
+
+set -e
+. /usr/share/debconf/confmodule
+
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
+
+db_version 2.0
+
+. /usr/share/dbconfig-common/dpkg/postinst.mysql
+dbc_go etherpad $@
+
+db_get "etherpad/admin_password"
+db_admin_password="$RET"
+db_get "etherpad/topdomains"
+db_topdomains="$RET"
+
+. /etc/dbconfig-common/etherpad.conf
+
+
+
+# Create system user
+if ! getent passwd etherpad > /dev/null ; then
+ echo 'Adding system-user for etherpad' 1>&2
+ adduser --system --group --quiet \
+ --home /usr/share/etherpad --no-create-home \
+ --disabled-login --force-badname etherpad
+fi
+
+# Give user the rights to write into the log & data directory
+chown -R etherpad:etherpad "/var/log/etherpad"
+chown -R etherpad:etherpad "/usr/share/etherpad/etherpad/data"
+# Give user the rights do write everywhere, did not yet figure
+# out which rights are necessary, exactly
+chown -R etherpad:etherpad "/usr/share/etherpad"
+
+if ! [ "$dbc_dbserver" ]; then
+ dbc_dbserver=localhost
+fi
+if ! [ "$dbc_dbport" ]; then
+ dbc_dbport=3306
+fi
+
+
+m4 \
+ -D __db_admin_password__="$db_admin_password" \
+ -D __dbc_dbserver__="$dbc_dbserver" \
+ -D __dbc_dbport__="$dbc_dbport" \
+ -D __dbc_dbname__="$dbc_dbname" \
+ -D __dbc_dbpass__="$dbc_dbpass" \
+ -D __dbc_dbuser__="$dbc_dbuser" \
+ -D __db_topdomains__="$db_topdomains" \
+ < /etc/etherpad/etherpad.local.properties.tmpl \
+ > /etc/etherpad/etherpad.local.properties
+
+chown etherpad:etherpad /etc/etherpad/etherpad.local.properties
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..ef4425a
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,38 @@
+#!/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.
+#
+################################################################################
+
+
+
+set -e
+. /usr/share/debconf/confmodule
+
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
+
+db_version 2.0
+
+# Set up database
+. /usr/share/dbconfig-common/dpkg/postrm.mysql
+dbc_go etherpad $@
diff --git a/build/apt/build/run.sh b/debian/preinst
index 1aa3954..ffced88 100755..100644
--- a/build/apt/build/run.sh
+++ b/debian/preinst
@@ -5,6 +5,7 @@
# 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
@@ -22,7 +23,12 @@
+set -e
+. /usr/share/debconf/confmodule
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
-bash -c "`dirname $0`/run-local.sh" > "/var/log/etherpad/log" 2> "/var/log/etherpad/error"
-
+db_version 2.0
diff --git a/build/apt/DEBIAN/prerm b/debian/prerm
index 9a9f516..7b7d352 100755
--- a/build/apt/DEBIAN/prerm
+++ b/debian/prerm
@@ -1,10 +1,11 @@
-#!/bin/sh
+#!/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
@@ -23,6 +24,18 @@
set -e
+. /usr/share/debconf/confmodule
+
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
+
+db_version 2.0
+
+# Set up database
+. /usr/share/dbconfig-common/dpkg/prerm.mysql
+dbc_go etherpad $@
# Remove log+data directories, otherwise uninstall will fail
rm -rf /var/log/etherpad
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3a06dbe
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,139 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+#Architecture
+build: build-arch build-indep
+
+build-arch: build-arch-stamp
+build-arch-stamp: configure-stamp
+
+ # Add here commands to compile the arch part of the package.
+ #$(MAKE)
+ bin/build.sh
+ touch $@
+
+build-indep: build-indep-stamp
+build-indep-stamp: configure-stamp
+
+ # Add here commands to compile the indep part of the package.
+ #$(MAKE) doc
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-arch-stamp build-indep-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ #git clean -X
+
+ dh_clean --exclude ./build/apt/.tmp.local/infrastructure/bin/makejar.sh.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig
+
+install: install-indep install-arch
+install-indep:
+ dh_testdir
+ dh_testroot
+ dh_prep -i --exclude ./build/apt/.tmp.local/infrastructure/bin/makejar.sh.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig
+ dh_installdirs -i
+
+ # Add here commands to install the indep part of the package into
+ # debian/<package>-doc.
+ #INSTALLDOC#
+
+ dh_install -i
+
+install-arch:
+ dh_testdir
+ dh_testroot
+ dh_prep -s --exclude ./build/apt/.tmp.local/infrastructure/bin/makejar.sh.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./build/apt/.tmp.local/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java.orig --exclude ./infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java.orig
+ dh_installdirs -s
+
+ # Add here commands to install the arch part of the package into
+ # debian/tmp.
+ # $(MAKE) DESTDIR=$(CURDIR)/debian/etherpad install
+
+ mkdir -p debian/etherpad/usr/share/etherpad
+ cp -a $$(ls | grep -v debian) debian/etherpad/usr/share/etherpad
+
+ mkdir -p debian/etherpad/etc
+ mv debian/etherpad/usr/share/etherpad/etherpad/etc debian/etherpad/etc/etherpad
+ ln -s /etc/etherpad debian/etherpad/usr/share/etherpad/etherpad/etc
+
+ mkdir -p debian/etherpad/var/log/etherpad
+
+ mkdir -p debian/etherpad/etc/init.d
+ ln -s /usr/share/etherpad/bin/etherpad.init.d debian/etherpad/etc/init.d/etherpad
+
+
+ dh_install -s
+
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep
+# in another 'make' thread.
+binary-common:
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_installmenu
+ dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture independant packages using the common target.
+binary-indep: build-indep install-indep
+ $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build-arch install-arch
+ $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
diff --git a/debian/templates b/debian/templates
new file mode 100644
index 0000000..b73dc5e
--- /dev/null
+++ b/debian/templates
@@ -0,0 +1,11 @@
+Template: etherpad/admin_password
+Type: password
+Default: password
+Description: etherpad administration password
+ Please insert the administration password, default is password.
+
+Template: etherpad/topdomains
+Type: string
+Default:
+Description: Domain name of site
+ Please insert the domain name of your site.
diff --git a/etherpad/bin/run-local.sh b/etherpad/bin/run-local.sh
index 67a6d57..a559fce 100755
--- a/etherpad/bin/run-local.sh
+++ b/etherpad/bin/run-local.sh
@@ -46,7 +46,7 @@ fi
echo "Using config file: ${cfg_file}"
-$JAVA -classpath $CP \
+exec $JAVA -classpath $CP \
-server \
-Xmx${MXRAM} \
-Xms${MXRAM} \
@@ -63,4 +63,3 @@ $JAVA -classpath $CP \
net.appjet.oui.main \
--configFile=${cfg_file} \
"$@"
-
diff --git a/etherpad/etc/etherpad.local.properties.tmpl b/etherpad/etc/etherpad.local.properties.tmpl
new file mode 100644
index 0000000..d9bb899
--- /dev/null
+++ b/etherpad/etc/etherpad.local.properties.tmpl
@@ -0,0 +1,23 @@
+alwaysHttps = false
+ajstdlibHome = ../infrastructure/framework-src/modules
+appjetHome = ./data/appjet
+devMode = false
+etherpad.adminPass = __db_admin_password__
+etherpad.fakeProduction = false
+etherpad.isProduction = true
+etherpad.proAccounts = true
+etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver
+etherpad.SQL_JDBC_URL = jdbc:mysql://__dbc_dbserver__:__dbc_dbport__/__dbc_dbname__
+etherpad.SQL_PASSWORD = __dbc_dbpass__
+etherpad.SQL_USERNAME = __dbc_dbuser__
+hidePorts = false
+listen = 9000
+logDir = /var/log/etherpad
+modulePath = ./src
+motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0
+topdomains = __db_topdomains__,localhost,localhost.localdomain
+transportPrefix = /comet
+transportUseWildcardSubdomains = true
+useHttpsUrls = false
+useVirtualFileRoot = ./src
+theme = default