[Pkg-voip-commits] r7563 - in /mumble-django/trunk/debian: changelog man/ man/mumble-django-configure.1 mumble-django-configure mumble-django.install mumble-django.manpages rules

svedrin-guest at alioth.debian.org svedrin-guest at alioth.debian.org
Sun Sep 6 14:26:44 UTC 2009


Author: svedrin-guest
Date: Sun Sep  6 14:26:44 2009
New Revision: 7563

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=7563
Log:
add mumble-django-configure script that takes care of a few configuration tasks after the installation.

Added:
    mumble-django/trunk/debian/man/
    mumble-django/trunk/debian/man/mumble-django-configure.1
    mumble-django/trunk/debian/mumble-django-configure   (with props)
    mumble-django/trunk/debian/mumble-django.manpages
Modified:
    mumble-django/trunk/debian/changelog
    mumble-django/trunk/debian/mumble-django.install
    mumble-django/trunk/debian/rules

Modified: mumble-django/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/changelog?rev=7563&op=diff
==============================================================================
--- mumble-django/trunk/debian/changelog (original)
+++ mumble-django/trunk/debian/changelog Sun Sep  6 14:26:44 2009
@@ -1,3 +1,11 @@
+mumble-django (0.10-2) unstable; urgency=low
+
+  * Remove call to "manage.py syncdb" from postinst because it fails when
+    Django is being installed together with Mumble-Django.
+  * Add mumble-django-configure script that runs syncdb (and a few other tasks).
+
+ -- Michael Ziegler <diese-addy at funzt-halt.net>  Sun, 06 Sep 2009 16:22:50 +0200
+
 mumble-django (0.10-1) unstable; urgency=low
 
   [ Michael Ziegler ]

Added: mumble-django/trunk/debian/man/mumble-django-configure.1
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/man/mumble-django-configure.1?rev=7563&op=file
==============================================================================
--- mumble-django/trunk/debian/man/mumble-django-configure.1 (added)
+++ mumble-django/trunk/debian/man/mumble-django-configure.1 Sun Sep  6 14:26:44 2009
@@ -1,0 +1,19 @@
+.TH MUMBLE-DJANGO-CONFIGURE 1 "2009 September 06"
+.SH NAME
+mumble\-django\-configure \- helper script to configure various aspects of Mumble\-Django.
+.SH SYNOPSIS
+.B mumble\-django\-configure
+.SH DESCRIPTION
+This script allows you to configure various aspects of Mumble\-Django.
+It lets you detect new Mumble\-Server instances, create new superuser
+accounts and install or remove the Munin plugin.
+This script should at least be run once after installing the Mumble\-
+Django package, because it will create the initial database needed
+in order to run.
+.SH OPTIONS
+None \- this script is meant to be run interactively. you will
+be asked a series of questions after starting the script, and it will
+act accordingly.
+.SH AUTHOR
+Mumble\-Django and mumble\-django\-configure has been written by Michael Ziegler
+<diese-addy at funzt-halt.net>.

Added: mumble-django/trunk/debian/mumble-django-configure
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/mumble-django-configure?rev=7563&op=file
==============================================================================
--- mumble-django/trunk/debian/mumble-django-configure (added)
+++ mumble-django/trunk/debian/mumble-django-configure Sun Sep  6 14:26:44 2009
@@ -1,0 +1,147 @@
+#!/bin/sh
+#
+# Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy at funzt-halt.net>
+#
+# Mumble-Django is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+
+set -e
+set -u
+
+MUMBLE_DJANGO_INSTDIR="/usr/share/mumble-django"
+MUMBLE_DJANGO_USER="www-data"
+MUMBLE_DJANGO_MUNIN="/etc/munin/plugins/mumble-django"
+MURMUR_CONNSTR="net.sourceforge.mumble.murmur"
+
+echo "Welcome to mumble-django-configure!"
+echo "-------------------------------------------"
+
+if [ ! -z "$@" ]; then
+	echo " This script allows you to configure various aspects of Mumble-Django."
+	echo " It lets you detect new Mumble-Server instances, create new superuser"
+	echo " accounts and install or remove the Munin plugin."
+	echo " This script should at least be run once after installing the Mumble-"
+	echo " Django package, because it will create the initial database needed"
+	echo " in order to run."
+	echo
+	echo " Options: none - this script is meant to be run interactively. you will"
+	echo " be asked a series of questions after starting the script, and it will"
+	echo " act accordingly."
+	exit 1
+fi
+
+if [ ! -z "${MUMBLE_DJANGO_USER}" -a "${USER}" != "root" -a "${USER}" != "${MUMBLE_DJANGO_USER}" ]; then
+	echo " ERROR: If manage.py should be run as a different user, then"
+	echo " $0 must be run as that user or as root."
+	echo " Configuring Apache2 and Munin is only possible when running as root."
+	exit 1
+fi
+
+invoke_manage() {
+	if [ -z "${MUMBLE_DJANGO_USER}" -o "${USER}" = "${MUMBLE_DJANGO_USER}" ]; then
+		echo "Running as $USER: manage.py $@"
+		./pyweb/manage.py $@
+	else
+		echo "Running as ${MUMBLE_DJANGO_USER}: manage.py $@"
+		su "${MUMBLE_DJANGO_USER}" -c "./pyweb/manage.py $@"
+	fi
+}
+
+cd ${MUMBLE_DJANGO_INSTDIR}
+
+echo " What do you want to do?"
+echo " > 1) Detect a new Mumble-Server instance and make it known to Mumble-Django"
+echo "   2) Create a new SuperUser for Mumble-Django's web admin interface"
+echo "      Note: This will be done automatically when you run 1) for the first time."
+
+read ACTION
+
+if [ -z "$ACTION" -o "$ACTION" = "1" ]; then
+	echo " Mumble-Server detection"
+	echo " -----------------------"
+	echo " If this is the first time you run this script, you might want to probe for the"
+	echo " Debian default configuration instead of entering the service string yourself."
+	echo " Please choose what service string to use."
+	echo " > 1) Debian default"
+	echo "   2) user defined"
+	
+	read CHOICE
+	if [ -z "$CHOICE" -o "$CHOICE" = "1" ]; then
+		if [ "$USER" = "root" ]; then
+			/usr/sbin/invoke-rc.d --quiet mumble-server start
+		fi
+		export MURMUR_CONNSTR
+	fi
+	
+	invoke_manage syncdb
+
+elif [ "$ACTION" = "2" ]; then
+	invoke_manage createsuperuser
+fi
+echo
+
+
+if [ "$USER" = "root" ]; then
+	echo " Apache2"
+	echo " -----------------------"
+	echo " If you have changed any settings in settings.py, you should reload the Web server"
+	echo " in order for the changes to take effect. Do you want to reload Apache2 now?"
+	echo "   1) Yes, reload Apache2."
+	echo " > 2) No, don't do anything."
+	
+	read ACTION
+	
+	if [ "$ACTION" = "1" ]; then
+		/usr/sbin/invoke-rc.d apache2 reload
+	fi
+	echo
+	
+	echo " Munin"
+	echo " -----------------------"
+	if [ -x "/etc/init.d/munin-node" ]; then
+		if [ -x "${MUMBLE_DJANGO_MUNIN}" ]; then
+			echo " The Munin plugin is currently installed. Do you wish to uninstall it?"
+			echo "   1) Yes, uninstall it."
+			echo " > 2) No, don't do anything."
+			
+			read ACTION
+			if [ "$ACTION" = "1" ]; then
+				rm "${MUMBLE_DJANGO_MUNIN}"
+				invoke-rc.d munin-node restart
+			fi
+		else
+			echo " Mumble-Django ships with a Munin plugin, and you appear to have Munin-Node installed."
+			echo " Probing now if installing the plugin is advised..."
+			echo -n "      "
+			./munin.py autoconf
+			echo
+			echo " Do you want to install the Munin plugin?"
+			echo "   1) Yes, install it."
+			echo " > 2) No, don't do anything."
+			
+			read ACTION
+			if [ "$ACTION" = "1" ]; then
+				ln -s "${MUMBLE_DJANGO_INSTDIR}/munin.py" "${MUMBLE_DJANGO_MUNIN}"
+				invoke-rc.d munin-node restart
+			fi
+		fi
+	else
+		echo " You do not appear to have Munin-Node installed, skipping."
+	fi
+else
+	echo " Configuring Apache2 and Munin is only possible when running as root."
+fi
+echo
+
+
+echo "Goodbye."
+
+

Propchange: mumble-django/trunk/debian/mumble-django-configure
------------------------------------------------------------------------------
    svn:executable = *

Modified: mumble-django/trunk/debian/mumble-django.install
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/mumble-django.install?rev=7563&op=diff
==============================================================================
--- mumble-django/trunk/debian/mumble-django.install (original)
+++ mumble-django/trunk/debian/mumble-django.install Sun Sep  6 14:26:44 2009
@@ -1,21 +1,24 @@
 # Python code
-pyweb/*.py		/usr/share/mumble-django/pyweb
-pyweb/gen_secret_key.sh	/usr/share/mumble-django/pyweb
+pyweb/*.py			/usr/share/mumble-django/pyweb
+pyweb/gen_secret_key.sh 	/usr/share/mumble-django/pyweb
 
 # static content
-htdocs/*.css		/usr/share/mumble-django/htdocs/
-htdocs/*.js		/usr/share/mumble-django/htdocs/
-htdocs/ext-2.2/*	/usr/share/mumble-django/htdocs/ext-2.2
+htdocs/*.css			/usr/share/mumble-django/htdocs/
+htdocs/*.js			/usr/share/mumble-django/htdocs/
+htdocs/ext-2.2/*		/usr/share/mumble-django/htdocs/ext-2.2
 
 # templates
-template/registration/*	/usr/share/mumble-django/template/registration
-template/index.htm	/usr/share/mumble-django/template
+template/registration/* 	/usr/share/mumble-django/template/registration
+template/index.htm		/usr/share/mumble-django/template
 
 # Apache2 VHost config
-debian/apache2.conf	/etc/mumble-django
+debian/apache2.conf		/etc/mumble-django
 
 # WSGI conf
-mumble-django.wsgi	/usr/share/mumble-django
+mumble-django.wsgi		/usr/share/mumble-django
 
 # Munin plugin
-munin.py		/usr/share/mumble-django
+munin.py			/usr/share/mumble-django
+
+# Configuration script
+debian/mumble-django-configure	/usr/bin

Added: mumble-django/trunk/debian/mumble-django.manpages
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/mumble-django.manpages?rev=7563&op=file
==============================================================================
--- mumble-django/trunk/debian/mumble-django.manpages (added)
+++ mumble-django/trunk/debian/mumble-django.manpages Sun Sep  6 14:26:44 2009
@@ -1,0 +1,1 @@
+debian/man/mumble-django-configure.1

Modified: mumble-django/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-voip/mumble-django/trunk/debian/rules?rev=7563&op=diff
==============================================================================
--- mumble-django/trunk/debian/rules (original)
+++ mumble-django/trunk/debian/rules Sun Sep  6 14:26:44 2009
@@ -35,6 +35,7 @@
 	dh_testroot
 	dh_installchangelogs CHANGELOG
 	dh_installdocs
+	dh_installman
 	dh_install
 	dh_pysupport
 	dh_link




More information about the Pkg-voip-commits mailing list