diff options
-rwxr-xr-x | build/apt/DEBIAN/postinst | 15 | ||||
-rwxr-xr-x | build/apt/build/build.sh | 57 | ||||
-rwxr-xr-x | build/apt/build/test.sh | 6 | ||||
-rwxr-xr-x | build/apt/etc/init.d/etherpad | 8 |
4 files changed, 44 insertions, 42 deletions
diff --git a/build/apt/DEBIAN/postinst b/build/apt/DEBIAN/postinst index 589f73d..6f595e0 100755 --- a/build/apt/DEBIAN/postinst +++ b/build/apt/DEBIAN/postinst @@ -38,20 +38,21 @@ db_version 2.0 ##### # -# Fragt einen Konfigurationswert ab und schreibt ihn in die Eigenschaftsdatei +# Propts the user for a configuration value and writes it into a property file # -# @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 +# @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=`cat "${PROPERTY_FILE}"` + PROPERTY="" + if [ -f "${PROPERTY_FILE}" ]; then + PROPERTY=`cat "${PROPERTY_FILE}"` + fi db_input high "etherpad-%BRANCH%/${TEMPLATE}" || true db_go diff --git a/build/apt/build/build.sh b/build/apt/build/build.sh index cc38260..ce308bb 100755 --- a/build/apt/build/build.sh +++ b/build/apt/build/build.sh @@ -23,13 +23,15 @@ ##### -# Baut etherpad aus den Quellen und erstellt ein Debian/Ubuntu Paket +# Build a Debian/Ubuntu Etherpad package of the source # -# @param $1 (optional) Wenn rebuild, dann wird das Repository neu ausgecheckt -# anstatt nur geupdated zu werden -# @param $REPOSITORY_URL URL von welcher das Repository geladen werden soll -# @param $REPOSITORY_NAME Name des Paketes welches gebaut werden soll -# @param $REPOSITORY_TYPE Element der Menge {hg, git} +# @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" @@ -47,7 +49,7 @@ fi ##### -# Folgende Parameter sind an das System auf welchem gebaupt wird anzupassen: +# You have to change following lines to your requirements: # export JAVA_HOME=/usr/lib/jvm/java-6-sun/ export SCALA_HOME=/usr/share/java @@ -60,7 +62,7 @@ export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH" ##### -# Interne Konfiguration, muss nicht angepasst werden +# Don't change this! # REPOSITORY="${REPOSITORY_URL}" BRANCH="${REPOSITORY_NAME}" @@ -79,30 +81,31 @@ fi -# Einfaches Update ist nur ausreichend, wenn Repository bereits ausgecheckt +# 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" -# bash -c "cd ${TMP_DIR}; ${REPOSITORY_TYPE} checkout HEAD^1" else echo "Repository does not exist, will fetch" REBUILD="yes" fi fi -# Repository komplett neu auschecken statt nur upzudaten +# Refresh the complett repository (purge & clone instead of pull) if [ "yes" == "${REBUILD}" ]; then if [ -d "${TMP_DIR}" ]; then rm -rf "${TMP_DIR}" fi - # Source aus ,,Offizieller'' Quelle holen + # Fetch the source from remote endpoint $REPOSITORY_TYPE clone "${REPOSITORY}" "${TMP_DIR}" fi -# Checkout halbwegs ueberpruefen +# 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 @@ -110,8 +113,8 @@ else exit 1 fi -# Haesslicher Fix um mit dem Google Repository arbeiten zu koennen (trunk -# und branches in mercurial, wtf?) +# 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" @@ -120,7 +123,7 @@ fi -# Jar neu bauen +# Rebuild jar echo "" echo "Trying to apply patch. If it detects the patch doesn't match just skip" echo "" @@ -132,12 +135,12 @@ cp "${TMP_DIR}/infrastructure/build/appjet.jar" "${TMP_DIR}/etherpad/appjet-eth- -# Testet die gebaute Version +# Testing the build #bash -c "./build/test-build.sh" -# Buildrevision erhoehen und Kontrolldatei bauen +# Increments the version & create the control file REVISION="0" if [ -f "${REVISION_FILE}" ]; then REVISION=`cat "${REVISION_FILE}"` @@ -145,34 +148,34 @@ if [ -f "${REVISION_FILE}" ]; then fi echo $REVISION > "${REVISION_FILE}" -# Debian-Control-File patchen +# 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" -# Installations- und Deinstallationsskript patchen +# 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" -# debconf Templates patchen +# 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" -# Init-Skript patchen +# 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" -# Konfigurationsverzeichnis kopieren +# Copy the config folder cp -r "etc" "${TMP_DIR}/etc" -# Paketumgebung bauen +# Build the package enviroment (needed to build with dpgk-deb build) if [ -d "${BUILD_DIR}" ]; then sudo rm -r "${BUILD_DIR}" fi @@ -184,7 +187,7 @@ mkdir -p "${BUILD_DIR}/var/log/etherpad" -# Benoetigte Dateien zusammenfuehren +# 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" @@ -201,7 +204,7 @@ cp "${TMP_DIR}/README.md" "${BUILD_DIR}/usr/share/doc/etherpad" -# Eigentliches Paket bauen +# 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" @@ -217,7 +220,7 @@ dpkg-deb --build "${BUILD_DIR}" "${PACKAGE_DIR}" -# Paket in lokales Repository aufnehmen +# 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 diff --git a/build/apt/build/test.sh b/build/apt/build/test.sh index 9753f8c..0abf7bf 100755 --- a/build/apt/build/test.sh +++ b/build/apt/build/test.sh @@ -25,12 +25,12 @@ ##### -# Muss von rebuild.sh aufgerufen werden +# Must be called by build.sh ##### -# Datenbank leeren damit etherpad testweiste gestartet werden kann +# 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 @@ -44,7 +44,7 @@ echo "${DROP_DATABASE}; ${CREATE_DATABASE}; ${DROP_USER}; ${CREATE_USER}" | mysq -# Etherpad starten und warten bis HTTP-Server laeuft +# 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 diff --git a/build/apt/etc/init.d/etherpad b/build/apt/etc/init.d/etherpad index 42bd7a9..95847b8 100755 --- a/build/apt/etc/init.d/etherpad +++ b/build/apt/etc/init.d/etherpad @@ -45,14 +45,12 @@ ##### # -# Patches the configuration file by replacing ,,%$1%'' with the contents of -# $2 +# 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 Konfigurationsdatei -# -# @deprecated Wird nicht mehr verwendet +# @param $3 Configuration file # function apply_config() { CONFIG_FILE="${3}" |