[Debian-l10n-commits] r2773 - in /pootle/trunk/debian: apache2.conf dbconfig.template pootle.conf pootle.config pootle.examples pootle.init pootle.initscript.example pootle.install pootle.postinst pootle.templates

themill-guest at users.alioth.debian.org themill-guest at users.alioth.debian.org
Wed Nov 16 16:08:29 UTC 2011


Author: themill-guest
Date: Wed Nov 16 16:08:28 2011
New Revision: 2773

URL: http://svn.debian.org/wsvn/?sc=1&rev=2773
Log:
Add debconf webserver config choice

* reinstate ability to run PootleServer to help with upgrade path

Added:
    pootle/trunk/debian/apache2.conf
      - copied, changed from r2772, pootle/trunk/debian/pootle.conf
    pootle/trunk/debian/pootle.init
      - copied, changed from r2772, pootle/trunk/debian/pootle.initscript.example
Removed:
    pootle/trunk/debian/pootle.conf
    pootle/trunk/debian/pootle.examples
    pootle/trunk/debian/pootle.initscript.example
Modified:
    pootle/trunk/debian/dbconfig.template
    pootle/trunk/debian/pootle.config
    pootle/trunk/debian/pootle.install
    pootle/trunk/debian/pootle.postinst
    pootle/trunk/debian/pootle.templates

Copied: pootle/trunk/debian/apache2.conf (from r2772, pootle/trunk/debian/pootle.conf)
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/apache2.conf?rev=2773&op=diff
==============================================================================
    (empty)

Modified: pootle/trunk/debian/dbconfig.template
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/dbconfig.template?rev=2773&op=diff
==============================================================================
--- pootle/trunk/debian/dbconfig.template (original)
+++ pootle/trunk/debian/dbconfig.template Wed Nov 16 16:08:28 2011
@@ -9,4 +9,4 @@
     DATABASE_ENGINE = 'postgresql_psycopg2'
 
 if DATABASE_ENGINE == 'sqlite3':
-    DATABASE_NAME = working_path('dbs/pootle.db')
+    DATABASE_NAME = working_path('dbs/pootle.db')

Modified: pootle/trunk/debian/pootle.config
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.config?rev=2773&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.config (original)
+++ pootle/trunk/debian/pootle.config Wed Nov 16 16:08:28 2011
@@ -20,16 +20,32 @@
     dbc_go pootle $@
 fi
 
-if [ -d "$POOTLE_HOME" ]; then
+if [ -f /etc/init.d/pootle ]; then
+    db_set pootle/webserver standalone
+elif [ -f /etc/apache2/apache2.conf ]; then
+    db_set pootle/webserver apache2
+#elif [ -f /etc/lighttpd/lighttpd.conf ]; then
+#  db_set pootle/webserver lighttpd
+fi
+
+db_input high pootle/webserver || true
+db_go || true
+
+# Pick sensible default user/group names for the installation depending
+# on what configuration route the user has selected
+db_get pootle/webserver
+if [ "$RET" = "standalone" ]; then
+      db_set pootle/server-username pootle
+      db_set pootle/server-groupname pootle
+elif [ -d "$POOTLE_HOME" ]; then
     POOTLE_USER=$(stat -c"%U" "$POOTLE_HOME")
     POOTLE_GROUP=$(stat -c"%G" "$POOTLE_HOME")
     if [ "$POOTLE_USER" != "root" -a "$POOTLE_GROUP" != "root" ]; then
-      db_set pootle/server-username $POOTLE_USER
-      db_set pootle/server-groupname $POOTLE_GROUP
+        db_set pootle/server-username $POOTLE_USER
+        db_set pootle/server-groupname $POOTLE_GROUP
     fi
 fi
 
 db_input medium pootle/server-username || true
 db_input medium pootle/server-groupname || true
-
 db_go || true

Copied: pootle/trunk/debian/pootle.init (from r2772, pootle/trunk/debian/pootle.initscript.example)
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.init?rev=2773&op=diff
==============================================================================
    (empty)

Modified: pootle/trunk/debian/pootle.install
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.install?rev=2773&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.install (original)
+++ pootle/trunk/debian/pootle.install Wed Nov 16 16:08:28 2011
@@ -1,3 +1,2 @@
 debian/dbconfig.template /usr/share/doc/pootle/
-debian/pootle.conf /etc/apache2/conf.d
-
+debian/apache2.conf /usr/share/pootle/conf

Modified: pootle/trunk/debian/pootle.postinst
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.postinst?rev=2773&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.postinst (original)
+++ pootle/trunk/debian/pootle.postinst Wed Nov 16 16:08:28 2011
@@ -90,6 +90,32 @@
     done
 }
 
+apache2_install() {
+    mkdir -p /etc/apache2/conf.d
+    cp /usr/share/pootle/conf/apache2.conf /etc/apache2/conf.d/pootle.conf
+    reload_www_server apache2
+}
+
+lighttpd_install() {
+    # not implemented
+    :
+}
+
+standalone_install() {
+    if [ -f /etc/default/pootle ]; then
+        echo "Enabling PootleServer; edit /etc/default/pootle to change this"
+        sed -i 's/^POOTLE_ENABLE=No/POOTLE_ENABLE=Yes/' /etc/default/pootle
+    fi
+}
+
+reload_www_server() {
+    if [ -x /usr/sbin/invoke-rc.d ]; then
+        invoke-rc.d $1 reload 3>/dev/null || true
+    else
+        /etc/init.d/$1 reload 3>/dev/null || true
+    fi
+}
+
 case "$1" in
     configure|reconfigure)
         set_permissions
@@ -116,8 +142,22 @@
             # squeeze -> wheezy upgrade
             :
         fi
-        # all upgrades
+        # all upgrades; doesn't hurt on new installs
         su $POOTLE_USER -p -c "django-admin updatedb --settings=pootle.settings"
+
+        # Configure webserver
+        db_get pootle/webserver || ${RET-none}
+        case "$RET" in
+            apache2)
+                apache2_install
+            ;;
+            lighttpd)
+                lighttpd_install
+            ;;
+            standalone)
+                standalone_install
+            ;;
+        esac
         ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Modified: pootle/trunk/debian/pootle.templates
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.templates?rev=2773&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.templates (original)
+++ pootle/trunk/debian/pootle.templates Wed Nov 16 16:08:28 2011
@@ -15,3 +15,11 @@
  by the web server process.
  .
  If you leave this field empty, the default group ('www-data') will be used.
+
+Template: pootle/webserver
+Type: select
+Choices: apache2, standalone, none
+Description: Web server to reconfigure automatically:
+ Please choose the web server, if any, that should be automatically configured
+ to run Pootle. Specify "standalone" to run the PootleServer on its own or
+ "none" to perform manual configuration later.




More information about the Debian-l10n-commits mailing list