summaryrefslogtreecommitdiffstats
path: root/build/apt/DEBIAN
diff options
context:
space:
mode:
authorpenSec.IT UG (haftungsbeschränkt) <etherpad@pensec.it>2010-04-04 04:19:46 +0200
committerpenSec.IT UG (haftungsbeschränkt) <etherpad@pensec.it>2010-04-04 04:19:46 +0200
commit8465b116407c1d477d852785d5bd499665296b24 (patch)
treeeae46fa61b7c7e11a84ffc4aa890fb35c386e96c /build/apt/DEBIAN
parentc3b6fb9386a4e1cfca02e61c2ea4fb14c6afc7fc (diff)
downloadetherpad-8465b116407c1d477d852785d5bd499665296b24.tar.gz
etherpad-8465b116407c1d477d852785d5bd499665296b24.tar.bz2
etherpad-8465b116407c1d477d852785d5bd499665296b24.zip
apt Buildsystem
Diffstat (limited to 'build/apt/DEBIAN')
-rw-r--r--build/apt/DEBIAN/control16
-rwxr-xr-xbuild/apt/DEBIAN/postinst291
-rwxr-xr-xbuild/apt/DEBIAN/prerm36
-rw-r--r--build/apt/DEBIAN/templates63
4 files changed, 406 insertions, 0 deletions
diff --git a/build/apt/DEBIAN/control b/build/apt/DEBIAN/control
new file mode 100644
index 0000000..0129652
--- /dev/null
+++ b/build/apt/DEBIAN/control
@@ -0,0 +1,16 @@
+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
new file mode 100755
index 0000000..d92c6a7
--- /dev/null
+++ b/build/apt/DEBIAN/postinst
@@ -0,0 +1,291 @@
+#!/bin/bash
+
+################################################################################
+#
+# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
+# http://www.pensec.it
+# mail@pensec.it
+#
+# Diese Software wird ohne ausdrückliche oder implizierte Garantie
+# bereitgestellt. Auf keinen Fall können die Autoren für irgendwelche Schäden,
+# die durch die Benutzung dieser Software entstehen, haftbar gemacht werden.
+#
+# Es ist dem Auftraggeber gestattet diese Software für jeden Zweck, inklusive
+# kommerzieller Anwendungen, zu benutzten und zu verändern aber nicht
+# weiterzuverbreiten, solange folgende Bedingungen erfüllt sind:
+#
+# 1. Die Herkunft dieser Software darf nicht falsch dargestellt werden; Sie
+# dürfen nicht angeben, dass Sie die ursprüngliche Software geschrieben
+# haben. Wenn Sie diese Software in einem Produkt benutzten, würde eine
+# Erwähnung geschätzt werden, sie ist aber nicht erforderlich.
+# 2. Veränderte Quelltextversionen müssen deutlich als solche
+# gekennzeichnet werden und dürfen nicht als die Originalsoftware
+# dargestellt werden.
+# 3. Diese Notiz darf in den Quelltexten nicht verändert oder gelöscht
+# werden.
+#
+################################################################################
+
+
+
+set -e
+. /usr/share/debconf/confmodule
+
+if [ -n "$ETHERPAD_DEBUG" ]; then
+ echo "now debugging $0 $@"
+ set -x
+fi
+
+db_version 2.0
+
+
+
+
+
+#####
+#
+# Fragt einen Konfigurationswert ab und schreibt ihn in die Eigenschaftsdatei
+#
+# @param $1 Name des debconfig Templates
+# @param $2 Name der Datei in welche der Konfigurationswert geschrieben werden
+# soll
+# @param $3 Wird aktuell nicht verwendet, Platzhalter in etherpad.properties
+# welcher mit dem Wert dieser Varialbe ersetzt werden soll
+#
+function configuration_property() {
+ TEMPLATE="${1}"
+ PROPERTY_FILE="/etc/etherpad/properties/${2}"
+ PLACEHOLDER="${3}"
+
+ PROPERTY=`cat "${PROPERTY_FILE}"`
+ 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"
+#
+#####
+
+
+
+
+
+# #####
+# #
+# # Install in production mode
+# #
+# IS_PRODUCTION="false"
+# db_input high "etherpad-%BRANCH%/is_production" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/is_production"
+# if [ "" != "$RET" ]; then
+# IS_PRODUCTION="$RET"
+# fi
+#
+# apply_config "IS_PRODUCTION" "${IS_PRODUCTION}"
+# #
+# #####
+
+# #####
+# #
+# # Admin password
+# #
+# ADMIN_PASSWORD="password"
+# db_input high "etherpad-%BRANCH%/admin_password" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/admin_password"
+# if [ "" != "$RET" ]; then
+# ADMIN_PASSWORD="$RET"
+# fi
+#
+# apply_config "ADMIN_PASSWORD" "${ADMIN_PASSWORD}"
+# #
+# #####
+
+# #####
+# #
+# # Application listen port
+# #
+# PORT="9000"
+# db_input high "etherpad-%BRANCH%/port" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/port"
+# if [ "" != "$RET" ]; then
+# PORT="$RET"
+# fi
+#
+# apply_config "PORT" "${PORT}"
+# #
+# #####
+
+# #####
+# #
+# # MySQL Host
+# #
+# DATABASE_HOST="localhost"
+# db_input high "etherpad-%BRANCH%/database_host" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/database_host"
+# if [ "" != "$RET" ]; then
+# DATABASE_HOST="$RET"
+# fi
+#
+# apply_config "DATABASE_HOST" "${DATABASE_HOST}"
+# #
+# #####
+
+# #####
+# #
+# # MySQL Port
+# #
+# DATABASE_PORT="3306"
+# db_input high "etherpad-%BRANCH%/database_port" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/database_port"
+# if [ "" != "$RET" ]; then
+# DATABASE_PORT="$RET"
+# fi
+#
+# apply_config "DATABASE_PORT" "${DATABASE_PORT}"
+# #
+# #####
+
+# #####
+# #
+# # MySQL database name
+# #
+# DATABASE_NAME="etherpad"
+# db_input high "etherpad-%BRANCH%/database_name" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/database_name"
+# if [ "" != "$RET" ]; then
+# DATABASE_NAME="$RET"
+# fi
+#
+# apply_config "DATABASE_NAME" "${DATABASE_NAME}"
+# #
+# #####
+
+# #####
+# #
+# # MySQL database username
+# #
+# DATABASE_USERNAME="etherpad"
+# db_input high "etherpad-%BRANCH%/database_username" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/database_username"
+# if [ "" != "$RET" ]; then
+# DATABASE_USERNAME="$RET"
+# fi
+#
+# apply_config "DATABASE_USERNAME" "${DATABASE_USERNAME}"
+# #
+# #####
+
+# #####
+# #
+# # MySQL database password
+# #
+# DATABASE_PASSWORD="password"
+# db_input high "etherpad-%BRANCH%/database_password" || true
+# db_go
+#
+# db_get "etherpad-%BRANCH%/database_password"
+# if [ "" != "$RET" ]; then
+# DATABASE_PASSWORD="$RET"
+# fi
+#
+# apply_config "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/prerm b/build/apt/DEBIAN/prerm
new file mode 100755
index 0000000..2f54468
--- /dev/null
+++ b/build/apt/DEBIAN/prerm
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+################################################################################
+#
+# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
+# http://www.pensec.it
+# mail@pensec.it
+#
+# Diese Software wird ohne ausdrückliche oder implizierte Garantie
+# bereitgestellt. Auf keinen Fall können die Autoren für irgendwelche Schäden,
+# die durch die Benutzung dieser Software entstehen, haftbar gemacht werden.
+#
+# Es ist dem Auftraggeber gestattet diese Software für jeden Zweck, inklusive
+# kommerzieller Anwendungen, zu benutzten und zu verändern aber nicht
+# weiterzuverbreiten, solange folgende Bedingungen erfüllt sind:
+#
+# 1. Die Herkunft dieser Software darf nicht falsch dargestellt werden; Sie
+# dürfen nicht angeben, dass Sie die ursprüngliche Software geschrieben
+# haben. Wenn Sie diese Software in einem Produkt benutzten, würde eine
+# Erwähnung geschätzt werden, sie ist aber nicht erforderlich.
+# 2. Veränderte Quelltextversionen müssen deutlich als solche
+# gekennzeichnet werden und dürfen nicht als die Originalsoftware
+# dargestellt werden.
+# 3. Diese Notiz darf in den Quelltexten nicht verändert oder gelöscht
+# werden.
+#
+################################################################################
+
+
+
+set -e
+
+# Remove log+data directories, otherwise uninstall will fail
+rm -rf /var/log/etherpad
+rm -rf /usr/share/etherpad/etherpad/data
+
diff --git a/build/apt/DEBIAN/templates b/build/apt/DEBIAN/templates
new file mode 100644
index 0000000..8cf6124
--- /dev/null
+++ b/build/apt/DEBIAN/templates
@@ -0,0 +1,63 @@
+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.
+
+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.
+