[Pkg-mono-svn-commits] rev 424 - monodoc/trunk/debian

Pablo Fischer pabl0-guest@haydn.debian.org
Mon, 15 Mar 2004 12:13:35 -0700


Author: pabl0-guest
Date: 2004-03-15 12:13:30 -0700 (Mon, 15 Mar 2004)
New Revision: 424

Modified:
   monodoc/trunk/debian/control
   monodoc/trunk/debian/monodoc-http.postinst
   monodoc/trunk/debian/monodoc-http.prerm
Log:
Ok, the changes:
* Control:
    + Changed the libapache.mod-mono dep to mono-server
* monodoc-http{postinst|prerm}
    + Changed the  old system of virtualhost managment 
    to the new one, using the conf.d system, as exim does.


Modified: monodoc/trunk/debian/control
===================================================================
--- monodoc/trunk/debian/control	2004-03-15 18:47:47 UTC (rev 423)
+++ monodoc/trunk/debian/control	2004-03-15 19:13:30 UTC (rev 424)
@@ -53,7 +53,7 @@
 Package: monodoc-http
 Provides: monodoc-viewer
 Architecture: all
-Depends: monodoc-base, mono-xsp | libapache-mod-mono
+Depends: monodoc-base, mono-xsp | mono-server
 Description: MonoDoc http based viewer
  The MonoDoc Project is the documentation framework of the MONO project which
  provides detailed API documentation for all MONO components and the MONO .NET

Modified: monodoc/trunk/debian/monodoc-http.postinst
===================================================================
--- monodoc/trunk/debian/monodoc-http.postinst	2004-03-15 18:47:47 UTC (rev 423)
+++ monodoc/trunk/debian/monodoc-http.postinst	2004-03-15 19:13:30 UTC (rev 424)
@@ -1,11 +1,108 @@
 #!/bin/sh -e
 
-if [ -x /usr/bin/xsp.exe -a -d /etc/xsp-snapshot ]; then
-    echo "Updating XSP root dirs..."
-    echo "/monodoc:/usr/share/dotnet/monodoc/web" >> /etc/xsp-snapshot/virtual.conf
-fi
+monodochttp_xspconfd="/etc/xsp/conf.d/monodoc"
+monodochttp_xspconffile="$monodochttp_xspconfd/10_monodochttp"
 
-if [ -x /usr/bin/mod-mono-server.exe -a -d /etc/mono-server-snapshot ]; then
-    echo "Updating Mono Server root dirs..."
-    echo "/monodoc:/usr/share/dotnet/monodoc/web" >> /etc/mono-server-snapshot/virtual.conf
-fi
+monodochttp_monoserverconfd="/etc/mono-server/conf.d/monodoc"
+monodochttp_monoserverconffile="$monodochttp_monoserverconfd/10_monodochttp"
+
+
+restart_xsp() {
+    #XSP is running?
+    if [ -f /var/run/mono-xsp ]; then
+        # Are we really running xsp?
+	xsp_pid=`cat /var/run/mono-xsp`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ "$xsp_ps" != "1" ]; then
+	    /etc/init.d/mono-xsp restart
+	fi
+    fi
+}
+
+restart_monoserver() {
+    #MonoServer is running?
+    if [ -f /var/run/mono-server ]; then
+        # Are we really running xsp?
+	monoserver_pid=`cat /var/run/mono-server`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ "$xsp_ps" != "1" ]; then
+	    /etc/init.d/mono-server restart
+	fi
+    fi
+}
+
+make_conffile() {
+    echo "# This is the configuration file"
+    echo "# for the monodoc-http"
+    echo "path = /usr/share/dotnet/monodoc/web"
+    echo "alias = /monodoc"
+}
+
+
+case "$1" in
+    configure)
+	if [ -x /usr/share/dotnet/bin/xsp.exe -a -d /etc/xsp ]; then
+            #Ok, we have the monodoc conf directory?
+	    if [ -d $monodochttp_xspconfd ]; then
+		# Ok, we have these files?
+		if [ -f $monodochttp_xspconffile ]; then
+		    # Ok, different checksum?
+		    checksum=`md5sum $monodochttp_xspconffile | awk '{print $1}'`
+		    if [ $checksum != "8cbfb5601113849fa64f0691344ca2c3" ]; then
+			echo "Updating Root Servers..."
+			make_conffile > "$monodochttp_xspconffile"		
+		    fi
+		else
+		    echo "Updating Root Servers..."
+		    make_conffile > "$monodochttp_xspconffile"		
+		fi
+	    else
+		mkdir -p $monodochttp_xspconfd
+		echo "Updating Root Servers..."
+		make_conffile > "$monodochttp_xspconffile"		
+	    fi
+	    #Update the BIG file.. mm.. Big Fish :)
+	    mono-xsp-update.conf
+	    #Restart XSP
+	    restart_xsp
+	fi
+
+	if [ -x /usr/share/dotnet/bin/mod-mono-server.exe -a -d /etc/mono-server ]; then
+            #Ok, we have the monodoc conf directory?
+	    if [ -d $monodochttp_monoserverconfd ]; then
+		# Ok, we have these files?
+		if [ -f $monodochttp_monoserverconffile ]; then
+		    # Ok, different checksum?
+		    checksum=`md5sum $monodochttp_monoserverconffile | awk '{print $1}'`
+		    if [ $checksum != "b1aad45b5d1ba55edb114d33ccbfb751" ]; then
+			echo "Updating Root Servers..."
+			make_conffile > "$monodochttp_monoserverconffile"		
+		    fi
+		else
+		    echo "Updating Root Servers..."
+		    make_conffile > "$monodochttp_monoserverconffile"		
+		fi
+	    else
+		mkdir -p $monodochttp_monoserverconfd
+		echo "Updating Root Servers..."
+		make_conffile > "$monodochttp_monoserverconffile"		
+	    fi
+	    #Update the BIG File.. 
+	    mono-server-update.conf
+	    #Restart MonoServer
+	    restart_monoserver
+	fi
+
+	;;
+    
+    abort-upgrade|abort-remove|abort-deconfigure)
+        #Do nothing..
+    ;;
+
+    *)
+	;;
+esac
+
+exit 0

Modified: monodoc/trunk/debian/monodoc-http.prerm
===================================================================
--- monodoc/trunk/debian/monodoc-http.prerm	2004-03-15 18:47:47 UTC (rev 423)
+++ monodoc/trunk/debian/monodoc-http.prerm	2004-03-15 19:13:30 UTC (rev 424)
@@ -1,15 +1,59 @@
 #!/bin/sh -e
 
-if [ -f /etc/xsp-snapshot/virtual.conf ]; then
-    tempfile=`/bin/tempfile`
-    sed s/\\/monodoc:\\/usr\\/share\\/dotnet\\/monodoc\\/web/ /etc/xsp-snapshot/virtual.conf > $tempfile
-    cp $tempfile /etc/xsp-snapshot/virtual.conf	
-    rm -f /etc/xsp-snapshot/virtual.conf
-fi
+monodochttp_xspconfd="/etc/xsp/conf.d/monodoc"
+monodochttp_monoserverconfd="/etc/mono-server/conf.d/monodoc"
 
-if [ -f /etc/mono-server-snapshot/virtual.conf ]; then
-    tempfile=`/bin/tempfile`
-    sed s/\\/samples:\\/usr\\/share\\/dotnet\\/monodoc\\/web/ /etc/mono-server-snapshot/virtual.conf > $tempfile
-    cp $tempfile /etc/mono-server-snapshot/virtual.conf
-    rm -f /etc/mono-server-snapshot/virtual.conf
-fi
+restart_xsp() {
+    #XSP is running?
+    if [ -f /var/run/mono-xsp ]; then
+        # Are we really running xsp?
+	xsp_pid=`cat /var/run/mono-xsp`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ "$xsp_ps" != "1" ]; then
+	    /etc/init.d/mono-xsp restart
+	fi
+    fi
+}
+
+restart_monoserver() {
+    #MonoServer is running?
+    if [ -f /var/run/mono-server ]; then
+        # Are we really running xsp?
+	monoserver_pid=`cat /var/run/mono-server`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ "$xsp_ps" != "1" ]; then
+	    /etc/init.d/mono-server restart
+	fi
+    fi
+}
+
+case "$1" in
+    remove)
+	if [ -x /usr/share/dotnet/bin/xsp.exe -a -d /etc/xsp ]; then
+            #We should remove everything... 
+	    rm -Rf $monodochttp_xspconfd
+	    mono-xsp-update.conf
+	    #Restart XSP
+	    restart_xsp
+	fi
+
+	if [ -x /usr/share/dotnet/bin/mod-mono-server.exe -a -d /etc/mono-server ]; then
+	    rm -Rf $monodochttp_monoserverconfd
+	    mono-server-update.conf
+	    #Restart mono-server
+	    restart_monoserver
+	fi
+	;;
+    
+    abort-upgrade|abort-remove|abort-deconfigure)
+        #Do nothing..
+    ;;
+
+    *)
+	;;
+esac
+
+exit 0
+