[Pkg-mono-svn-commits] rev 620 - / xsp xsp/trunk xsp/trunk/debian

Pablo Fischer pabl0-guest at haydn.debian.org
Mon Apr 3 07:24:39 UTC 2006


Author: pabl0-guest
Date: 2004-04-21 08:47:15 -0600 (Wed, 21 Apr 2004)
New Revision: 620

Added:
   xsp/
   xsp/branches/
   xsp/trunk/
   xsp/trunk/debian/
   xsp/trunk/debian/README.Debian
   xsp/trunk/debian/TODO
   xsp/trunk/debian/asp.net-examples.README.Debian
   xsp/trunk/debian/asp.net-examples.dirs
   xsp/trunk/debian/asp.net-examples.hostxsp
   xsp/trunk/debian/asp.net-examples.menu
   xsp/trunk/debian/asp.net-examples.postinst
   xsp/trunk/debian/asp.net-examples.postrm
   xsp/trunk/debian/changelog
   xsp/trunk/debian/control
   xsp/trunk/debian/copyright
   xsp/trunk/debian/dh_installxsp
   xsp/trunk/debian/dh_installxsp.1
   xsp/trunk/debian/dirs
   xsp/trunk/debian/mono-server-reader.conf
   xsp/trunk/debian/mono-server-reader.old
   xsp/trunk/debian/mono-server-update.conf
   xsp/trunk/debian/mono-server-update.old
   xsp/trunk/debian/mono-server.README.Debian
   xsp/trunk/debian/mono-server.config
   xsp/trunk/debian/mono-server.default
   xsp/trunk/debian/mono-server.dirs
   xsp/trunk/debian/mono-server.files
   xsp/trunk/debian/mono-server.init
   xsp/trunk/debian/mono-server.links
   xsp/trunk/debian/mono-server.postinst
   xsp/trunk/debian/mono-server.postrm
   xsp/trunk/debian/mono-server.preinst
   xsp/trunk/debian/mono-server.prerm
   xsp/trunk/debian/mono-server.substvars
   xsp/trunk/debian/mono-server.templates
   xsp/trunk/debian/mono-xsp-reader.conf
   xsp/trunk/debian/mono-xsp-reader.old
   xsp/trunk/debian/mono-xsp-update.conf
   xsp/trunk/debian/mono-xsp-update.old
   xsp/trunk/debian/mono-xsp.README.Debian
   xsp/trunk/debian/mono-xsp.config
   xsp/trunk/debian/mono-xsp.default
   xsp/trunk/debian/mono-xsp.dirs
   xsp/trunk/debian/mono-xsp.files
   xsp/trunk/debian/mono-xsp.init
   xsp/trunk/debian/mono-xsp.links
   xsp/trunk/debian/mono-xsp.postinst
   xsp/trunk/debian/mono-xsp.postrm
   xsp/trunk/debian/mono-xsp.preinst
   xsp/trunk/debian/mono-xsp.prerm
   xsp/trunk/debian/mono-xsp.substvars
   xsp/trunk/debian/mono-xsp.templates
   xsp/trunk/debian/rules
   xsp/trunk/debian/web.config
Log:
Started the new xsp module


Added: xsp/trunk/debian/README.Debian
===================================================================
--- xsp/trunk/debian/README.Debian	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/README.Debian	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,23 @@
+xsp and mod-mono-server for Debian
+--------------
+
+The mono-xsp package contains a standalone WebServer to run ASP.NET, developed
+by the Mono hackers, it should run in port 8080 or 8081, the scripts detects which port
+to use.
+
+The mono-server package contains the mod-mono-server.exe exec, it needs to be in another
+package (mono-server, not mono-xsp) cause we don't know if the end user doesn't like 
+Apache, or just want to test some asp.net tests. In few words, the mod-mono-server was 
+designed to be used as a 'backend' of the mod_mono module for apache (libapache-mod-mono)
+
+ -- Pablo Fischer <pablo at pablo.com.mx>, Wed, 25 Feb 2004 18:33:34 -0600
+
+xsp for Debian
+--------------
+
+The package components are the xsp server itself (package mono-xsp), the
+mono_mod_server variant which works in combination with mod_mono_unix,
+and the ASP.NET demos in the package asp.net-examples.
+
+ -- Eduard Bloch <blade at debian.org>, Thu, 22 Jan 2004 23:16:13 +0100
+

Added: xsp/trunk/debian/TODO
===================================================================
--- xsp/trunk/debian/TODO	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/TODO	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,27 @@
+* Sorry, I found an empty /etc/mono-server/mono-server-hosts.conf
+* Que cuando vaya a arrancar el servidor (postinst) vea si realmente se debe de hacer..
+
+
+
+29 feb 2004 02:32:23
+
+* Ask in #debian-mono for people that want to test the packages
+* Ask teo or Edd to check it (it runs VERY good in my computer) and upload it :)
+
+
+19 feb 2004 00:11:43
+
+* Mono-Server works great with libapache
+* Mono-XSP works great!
+* Both packages has their dameons
+
+TO FIX:
+
+* Check the daemons of both packages and write a function to check if the daemon is already running (a new function, the last was fucked)
+* Review the asp.net-examples package, the postinst and prerm, when I do: dpkg-reconfigure asp.net-examples it removes ALL the lines of the virtual.conf file, and is strange cause I'm just using echo >> (to add at the end of a file)
+
+Night :)
+
+17 feb 2004 21:47:45
+
+* Ask Edd why we need a asp.net-examples-server package if we are going to use mod-mono-server or xsp instead

Added: xsp/trunk/debian/asp.net-examples.README.Debian
===================================================================
--- xsp/trunk/debian/asp.net-examples.README.Debian	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.README.Debian	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,18 @@
+asp.net-examples for Debian
+--------------
+
+This package contains the asp.net samples, the directory where 
+these files are installed are: 
+
+/usr/share/asp.net-demos/asp/
+
+To access with xsp:
+
+http://localhost:8080/samples
+
+
+To access via mono-server (Apache)
+
+http://localhost/samples
+
+ -- Pablo Fischer <pablo at pablo.com.mx>, Mon, 15 Mar 2004 18:52:30 -0600

Added: xsp/trunk/debian/asp.net-examples.dirs
===================================================================
--- xsp/trunk/debian/asp.net-examples.dirs	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.dirs	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,5 @@
+usr/bin
+usr/share/asp.net-demos/asp 
+usr/share/asp.net-demos/dll
+
+

Added: xsp/trunk/debian/asp.net-examples.hostxsp
===================================================================
--- xsp/trunk/debian/asp.net-examples.hostxsp	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.hostxsp	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,4 @@
+# This is the configuration file
+# for the aspnet-examples virtualhost
+path = /usr/share/asp.net-demos/asp
+alias = /samples

Added: xsp/trunk/debian/asp.net-examples.menu
===================================================================
--- xsp/trunk/debian/asp.net-examples.menu	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.menu	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,2 @@
+?package(asp.net-examples):needs=text section=Apps/Programming \
+  title="ASP.NET demo pages" command="/usr/bin/asp.net-examples-server"

Added: xsp/trunk/debian/asp.net-examples.postinst
===================================================================
--- xsp/trunk/debian/asp.net-examples.postinst	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.postinst	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+case "$1" in
+    configure)
+	if [ -x /usr/sbin/mono-xsp-update.conf ]; then
+	    mono-xsp-update.conf || true
+	fi
+	if [ -x /usr/sbin/mono-server-update.conf ]; then
+	    mono-server-update.conf || true
+	fi
+	;;
+
+esac
+
+#DEBHELPER#
+exit 0


Property changes on: xsp/trunk/debian/asp.net-examples.postinst
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/asp.net-examples.postrm
===================================================================
--- xsp/trunk/debian/asp.net-examples.postrm	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/asp.net-examples.postrm	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+case "$1" in
+    purge|remove)
+	if [ -x /usr/sbin/mono-xsp-update.conf ]; then
+	    mono-xsp-update.conf || true
+	fi
+	if [ -x /usr/sbin/mono-server-update.conf ]; then
+	    mono-server-update.conf || true
+	fi
+	;;
+    
+esac
+
+#DEBHELPER#
+exit 0


Property changes on: xsp/trunk/debian/asp.net-examples.postrm
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/changelog
===================================================================
--- xsp/trunk/debian/changelog	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/changelog	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,182 @@
+xsp (0.9-15) unstable; urgency=low
+
+  * I noted that the daemon was not starting when the user boots the computer, 
+    there reason is that in postinst (and postrm) there's no update-rc.d to 
+    add the daemons to the init levels.
+  * Also, the 'debian' way tells that I can these daemon can only be added in 
+    postinst and removed in postrm (purge), so if the user only do a apt-get 
+    remove package the package will be started again and again, so to fix this
+    issue is to add a test -x $DAEMON to the init, before anything :-)	
+  * Fixed a bug in the update scripts: Sometimes the user doesn't reads the 
+    README of the package, so sometimes the user will add their hosts to the 
+    main configuration file (like /etc/xsp/mono-xsp-hosts.conf) with no dirs 
+    in conf.d, so, to prevent 'two' wrong configurations we should 'clean up' 
+    the main configuration file and THEN start with a new one.	
+	
+ -- Pablo Fischer <pablo at pablo.com.mx>  Mon, 19 Abr 2004 18:22:12 -0600	
+
+xsp (0.9-14) unstable; urgency=low
+
+  * Fixed a bug when users try to declare their paths with spaces before 
+    or after the '=' char.
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Sun, 18 Abr 2004 12:49:21 -0600
+	
+xsp (0.9-13) unstable; urgency=low
+
+  * Added a dep to mono-xsp and mono-server, the mono-mcs, to compile the source
+    of the asxp's files for firsttime
+  * Also, added a brief explanation to the README files, telling the user 
+    why /etc/mono-server or /etc/xsp directories are created created also if 
+    they don't have thesepackages.
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Sun, 18 Abr 2004 10:43:11 -0600	
+	 	
+xsp (0.9-12) unstable; urgency=low
+
+  * Added a dep to mono-server, libapache-mod-mono, to get a cleaner installation :-)
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Sat, 17 Abr 2004 15:30:12 -0600	
+
+xsp (0.9-11) unstable; urgency=low
+
+  * Fixed a bug in the reader scripts, we should read the file only if it 
+    exists.
+  * Also, the same bug in the update scripts, just copy the file (tmp) if it exists..
+
+ -- Pablo Fischer <pablo at palbo.com.mx>  Sat, 17 Abr 2004 15:01:23 -0600	
+
+xsp (0.9-10) unstable; urgency=low
+
+  * The reader scripts were not printing (duh)
+  * Force the cp of the tmp host file configuration
+	
+ -- Pablo Fischer <pablo at pablo.com.mx>  Fri, 16 Abr 2004 23:19:40 -0600
+	
+xsp (0.9-9) unstable; urgency=low
+
+  * Removed the old sh scripts, now we use the power of perl (I preffer it)
+  * Also edited the asp.net-examples.postinst, we should check if the update script exists
+  * Now, the reader and update script are just used by root (usr/sbin)	
+  * Removed the asp.net-examples.install, we install the host file with dh_installxsp 
+  * In the asp.net-examples.postinst and postrm scripts we check if the 'scripts' of xsp or 
+    mono-server are really installed	
+  * Removed the two ln -s (rules), we are replacing those lines with .links files
+	
+ -- Pablo Fischer <pablo at pablo.com.mx>  Fri, 16 Abr 2004 20:29:00 -0600
+	
+xsp (0.9-8) unstable; urgency=low
+
+  * We implement dh_installxsp to install the host files
+  * In the postrm and postinst scripts (of asp.net-examples) we just update 
+    the 'big' file.	
+ 
+ -- Pablo Fischer <pablo at pablo.com.mx>  Sun, 11 Apr 2004 13:02:05 -0600
+	
+xsp (0.9-7) unstable; urgency=low
+
+  * The configuration host file (of asp.net) is installed with asp.net-examples.install
+    so in the postinst and postrm we just update	
+  * The installation and removal scripts of asp.net-examples just 
+    update the configuration host file and run their update script. 	
+  * The update scripts (mono-xsp-update, mono-server-update) can restart 
+    the daemon or not (by default yes, to prevent: --norestart) and check 
+    the md5sum of the orig global host file with the new one	
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Sat, 10 Apr 2004 15:16:10 -0600
+	
+xsp (0.9-6) unstable; urgency=low
+
+  * postinst, preinst, postrm, prerm 
+   + These files are now divided in pre and post scripts
+  * init files
+   + Changed the exit 0 statement. Now we use return values
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Fri, 9 Apr 2004 15:16:10 -0600
+
+xsp (0.9-5) unstable; urgency=low
+
+  * rules:
+    + The .config shell script should be in /usr/share/dotnet/bin, and 
+      with chmod +x 
+    + We should have a symlink of those files (.conf ones) in /usr/bin	
+  * mono-server-reader.conf   
+    + Added a new rule: Check if the config file exists, if not, print a message and exit
+  * asp.net-examples.prerm
+    + Fixed an issue of an if, I should use "$var" not $var, "$var" is for 
+      matched and unmatched cases (=, !=).
+  * mono-xsp.init: 
+    + Added a new rule: Verify if the xsp daemon is already running, if it
+      is running, print an error an exit, so we keep a good pid control system
+      in /var/run   
+    + Removed some stupid debug messages in spanish
+    + Fixed the should_restart, it was always returning true
+  * mono-server.init:   
+    + Removed some stupid debug messages in spanish    
+    + Fixed the should_restart, it was always returning true  
+    + If libapache is not installed, we should print a message AND exit..
+  * asp.net-examples.postinst:      
+    + Added a rm -Rf to remove the temp file after each sed
+  * mono-server.postinst and mono-xsp.postinst
+    + Added a rm -Rf to remove the temp file after each sed     
+    + Commented the start process of mono-server, we don't need it,
+      we should start mono-server from mod-mono.
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Tue, 16 Mar 2004 12:31:57 -0600
+
+xsp (0.9-4) unstable; urgency=low
+
+  * NOT RELEASED YET
+  * Pablo Fischer:
+       + For the asp.net-examples package, I'm using a pure debconf file, 
+	 with a case switch. 
+       + For asp.net.net-examples pre|postinst I Added two functions: restart_xsp 
+	 and restart_monoserver.
+       + For the init files I dded two new functions: should_stop, and should_restart, 
+	 the first will verify if mono-server is running, if it isn't there's no 
+	 need to stop it, so it prints a message and exit, the second just checks if 
+	 it's running, if it's running it returns a value.
+       + Also, added the prerm script for mono-xsp and mono-server.
+       + And the files to manage the VirtualHost as exim does with a conf.d file
+	
+ -- Pablo Fischer <pablo at pablo.com.mx>  Wed, 28 Feb 2004 22:16:13 -0600
+	
+xsp (0.9-3) unstable; urgency=low
+
+  * NOT RELEASED YET
+  * Pablo Fischer:
+       + Replaced every exec to the old VirtualHost app, cause the new name is 
+	 mono-vhostmanager
+       + Added two more rules to the mono-xsp and mono-server init files, we want to
+	 know if the virtualfile already exists and if there are hosts
+       + Fixed the Depends of the package, we moved the mono-vhostmanager depend from
+	 asp.net-examples to mono-xsp and mono-server.
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Wed, 28 Feb 2004 22:16:13 -0600
+	  
+xsp (0.9-2) unstable; urgency=low
+
+  * NOT RELEASED YET
+  * Pablo Fischer:
+	+ Removed the old way of VirtualHost administration
+	+ Implemented nethostmanager to manage the VirtualHosts (asp.net-examples 
+	  in this case)
+	+ Also, updated the init scripts for xsp and mono-server daemons, we NEED
+	  to use the nethostmanager to maintain a cleaner and easy to administrate
+	  VirtualHost file (until Gonzalo release the app that will do this with web.config)
+	+ Now, we use the cli-wrapper instead of ugly sh file scripts
+	
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Wed, 25 Feb 2004 18:15:23 -0600
+xsp (0.9-1) unstable; urgency=low
+
+  * NOT RELEASED YET
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Wed, 18 Feb 2004 20:38:40 -0600
+	
+xsp (0.9) unstable; urgency=low
+
+  * NOT RELEASED YET
+
+ -- Pablo Fischer <pablo at pablo.com.mx>  Wed, 28 Jan 2004 21:18:52 -0600
+

Added: xsp/trunk/debian/control
===================================================================
--- xsp/trunk/debian/control	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/control	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,33 @@
+Source: xsp
+Section: web
+Priority: optional
+Maintainer: Debian Mono group <pkg-mono-group at lists.alioth.debian.org>
+Standards-Version: 3.6.0
+Build-Depends: debhelper (>= 3), mono-mcs | c-sharp-compiler, libmono-dev
+
+Package: mono-xsp
+Architecture: all
+Depends: ${shlibs:Depends}, mono-jit, mono-mcs
+Description: simple web server to run ASP.NET applications
+ XSP is a simple web server written in C# that can be used to run your 
+ ASP.NET applications. 
+ .
+ The package also includes the mod-mono-server applications that works
+ as backend for mod_mono_unix.
+
+Package: asp.net-examples
+Architecture: all
+Depends: ${shlibs:Depends}, mono-xsp | libapache-mod-mono
+Description: demo pages for ASP.NET infrastructure
+ Sample set of .aspx pages to test the XSP server or the mod_mono Apache
+ module.
+
+Package: mono-server
+Architecture: all
+Depends: ${shlibs:Depends}, mono-jit, libapache-mod-mono, mono-mcs
+Description: The mod-mono server
+ It contains the mod-mono-server, that will start the mod-mono server 
+ and create the *socket* (the one in /tmp).
+
+
+ 

Added: xsp/trunk/debian/copyright
===================================================================
--- xsp/trunk/debian/copyright	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/copyright	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,15 @@
+This package was debianized by Pablo Fischer pablo at pablo.com.mx on
+Wed,  7 Jan 2004 12:49:46 -0600.
+
+It was downloaded from http://www.go-mono.com/.
+
+Upstream authors: 
+
+Gonzalo Paniagua Javier <gonzalo at ximian.com>
+
+Copyright:
+
+Copyright (c) 2001-2004 Novell
+
+Distributed on the terms of the GNU General Public License which can
+be found in the file /usr/share/common-licenses/GPL on Debian systems.

Added: xsp/trunk/debian/dh_installxsp
===================================================================
--- xsp/trunk/debian/dh_installxsp	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/dh_installxsp	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,72 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_installxsp - install host files into /etc/xsp/conf.d and 
+/etc/mono-server/conf.d
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_installxsp> [S<B<debhelper options>>] [B<--name=>I<name>]
+
+=head1 DESCRIPTION
+
+dh_installxsp is a debhelper program that will install host configuration
+files in /etc/xsp/conf.d and /etc/monoserver/conf.d. So, if xsp is 
+install or will be installed, when xsp starts it automatically starts 
+the daemon with the host file. The files debian/package.hostxsp are installed.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--name=>I<name>
+
+Look for files named debian/package.hostxsp and install them as
+/etc/xsp/conf.d/package/hostfile.
+
+=back
+
+=cut
+
+init();
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+	my $tmp=tmpdir($package);
+	my $hostfile=pkgfile($package,"hostxsp");
+	if ($hostfile) {
+	    if( ! -d "$tmp/etc/xsp/conf.d" ) {
+		doit("install","-d","$tmp/etc/xsp/conf.d");
+	    }
+	    if( ! -d "$tmp/etx/xsp/conf.d/".pkgfilename($package)) {
+		doit("install","-d","$tmp/etc/xsp/conf.d/".pkgfilename($package));
+	    }
+	    doit("install",$hostfile,"$tmp/etc/xsp/conf.d/".pkgfilename($package)."/10_".pkgfilename($package));
+
+	    if( ! -d "$tmp/etc/mono-server/conf.d" ) {
+		doit("install","-d","$tmp/etc/mono-server/conf.d");
+	    }
+	    if( ! -d "$tmp/etx/mono-server/conf.d/".pkgfilename($package)) {
+		doit("install","-d","$tmp/etc/mono-server/conf.d/".pkgfilename($package));
+	    }
+	    
+	    doit("install",$hostfile,"$tmp/etc/mono-server/conf.d/".pkgfilename($package)."/10_".pkgfilename($package));
+	}	
+}
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is a part of debhelper.
+
+=head1 AUTHOR
+
+Pablo Fischer <pablo at pablo.com.mx>
+
+=cut


Property changes on: xsp/trunk/debian/dh_installxsp
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/dh_installxsp.1
===================================================================
--- xsp/trunk/debian/dh_installxsp.1	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/dh_installxsp.1	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,158 @@
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  | will give a
+.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t"\\$2"
+..
+.    nr % 0
+.    rr F
+.\}
+.\"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "DH_INSTALLXSP 1"
+.TH DH_INSTALLXSP 1 "2004-04-11" "perl v5.8.3" "User Contributed Perl Documentation"
+.SH "NAME"
+dh_installxsp \- install host files into /etc/xsp/conf.d and 
+/etc/mono\-server/conf.d
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+\&\fBdh_installxsp\fR [\fBdebhelper\ options\fR] [\fB\-\-name=\fR\fIname\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+dh_installxsp is a debhelper program that will install host configuration
+files in /etc/xsp/conf.d and /etc/monoserver/conf.d. So, if xsp is 
+install or will be installed, when xsp starts it automatically starts 
+the daemon with the host file. The files debian/package.hostxsp are installed.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-\-name=\fR\fIname\fR" 4
+.IX Item "--name=name"
+Look for files named debian/package.hostxsp and install them as
+/etc/xsp/conf.d/package/hostfile.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIdebhelper\fR\|(7)
+.PP
+This program is a part of debhelper.
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Pablo Fischer <pablo at pablo.com.mx>

Added: xsp/trunk/debian/dirs
===================================================================
--- xsp/trunk/debian/dirs	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/dirs	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/man/man1

Added: xsp/trunk/debian/mono-server-reader.conf
===================================================================
--- xsp/trunk/debian/mono-server-reader.conf	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server-reader.conf	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,109 @@
+#!/usr/bin/perl -w
+# Automatic mono-server file generator
+#
+# With this script the user (or daemon) can check if the 'big' mono-server host 
+# file is ok and in the right sintax, if there is an error it will exit
+# and print the reason in the format: *SORRY*: message.
+#
+# Under GPL, please read: 
+# http://www.gnu.org/copyleft/gpl.html
+#
+# Written by: Pablo Fischer
+
+use strict;
+
+#Main vars..
+my ($monoserver_dir, $monoserver_confd, $monoserver_hostfile);
+
+
+#Setup main vars
+$monoserver_dir = "/etc/mono-server";
+$monoserver_confd = "$monoserver_dir/conf.d";
+$monoserver_hostfile = "$monoserver_dir/mono-server-hosts.conf";  
+
+
+#Check if the user have write access to $monoserver_hostfile
+if( ( -e "$monoserver_hostfile" && ! -w "$monoserver_hostfile" ) || ! -w "$monoserver_dir" ) {
+    print "mono-host-reader requires to be executed as root\n" ; 
+    exit 1 ;
+}
+
+if( ! -f "$monoserver_hostfile" ) {
+    print "Sorry\, but you don't have $monoserver_hostfile\n";
+    exit 0;
+}
+
+my $opened_section = 0;
+my $applications = "";
+
+my ($path, $alias);
+#1 -> true
+#0 -> false
+#Ok, open the file for read mode
+
+open(HOSTFILE, $monoserver_hostfile);
+#.. read it!
+#Line counter
+my $counter = 0;
+while(my $line = <HOSTFILE>) {
+    $counter++;
+    if($line =~ /begin/i) {
+	if($opened_section eq "1") {
+	    print "Sorry\, but you are opening a section before closing the last one (line $counter)\n";
+	    last;
+	}
+	else {
+	    $opened_section = "1";
+	}
+    }
+
+    if($line =~ /end/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you are closing an unopened section (line $counter)\n";
+	}
+	else {
+	    $opened_section = "0";
+	    $applications = "$applications$alias:$path,";
+	}
+    }	
+    
+    if($line =~ /path/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you have a path in a unopened section (line $counter)\n";
+	    last;
+	}
+	else {
+	    #Ok, the directory exists?
+	    my $dir = (split /\=/, $line)[1];
+	    #Remove blank spaces
+	    $dir =~ tr/\ //d;
+	    #remove that \n
+	    $dir =~ s/\n//;
+ 	    if ( ! -d "$dir" ) {
+ 		print "Sorry\, but you have a path that doesn't exists in your system! (line $counter)\n";
+		last;
+ 	    }
+	    else {
+		$path = $dir;
+	    }
+	}
+    }
+
+    if($line =~ /alias/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you have an alias in a unopened section (line $counter)\n";
+	    last;
+	}
+	else {
+	    $alias = (split /\=/, $line)[1];
+	    #Blank Spaces
+	    $alias =~ tr/\ //d;
+	    #New lines..
+	    $alias =~ s/\n//;
+	}
+    }	
+}
+	
+close(HOSTFILE);
+$applications =~ s/,$//;
+print $applications;


Property changes on: xsp/trunk/debian/mono-server-reader.conf
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server-reader.old
===================================================================
--- xsp/trunk/debian/mono-server-reader.old	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server-reader.old	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,127 @@
+#!/bin/sh
+
+MONOSERVER_confdir="/etc/mono-server"
+MONOSERVER_conffile=$MONOSERVER_confdir/mono-server-hosts.conf
+MONOSERVER_validate=no
+
+usage() {
+    cat <<EOF
+$0 - Read the XSP Host Configuration
+  Options:
+     --help              - Show this message
+     --output file       - Read other host configuration file instead of ${MONOSERVER_conffile}
+EOF
+}
+
+
+#Read the commandline
+TEMP=$(getopt -n mono-xsp-reader.conf \
+    -l output:,help -- \
+    : "$@")
+
+
+eval set -- ${TEMP}
+while test "$1" != "--"; do
+    case $1 in
+	--help)
+	    usage
+	    exit 0
+	    ;;
+	--output)
+	    shift
+	    MONOSERVER_conffile="$1"
+	    ;;
+    esac
+    shift
+done
+shift
+
+opened_file=''
+opened_flag=0
+counter=0
+first_line='yes'
+
+
+section_alias=''
+section_path=''
+
+full_cmdline=''
+
+if [ ! -f $MONOSERVER_conffile ]; then
+    echo "Sorry, but you don't have $MONOSERVER_conffile, install a package, like asp.net-examples"
+    exit 1
+else 
+    if [ ! -e $MONOSERVER_conffile ]; then
+	echo "Sorry, but you don't have a $MONOSERVER_conffile, install a package, like asp.net-examples"
+	exit 1
+    fi
+fi
+
+for line in `cat $MONOSERVER_conffile | tr ' ' '~'`; do
+    line=`echo $line | tr '~' ' '`
+    if [[ $line = *begin* ]]; then
+	if [[ $opened_flag = "1" && $first_line = 'no' ]]; then
+	    echo "Sorry, you have a bad $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 1
+	fi
+	opened_file=`echo $line | awk '{print $3}'`
+	opened_flag=1
+	first_line='no'
+    fi
+    
+    if [[ $line = *end* ]]; then
+	closed_file=`echo $line | awk '{print $3}'`
+	if [[ $section_alias = '' || $section_path = '' ]]; then
+	    echo "Sorry, No path/alias found in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 1
+	fi
+
+	if [ $closed_file != $opened_file ]; then
+	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 1
+	else
+	    opened_flag="0"
+	    full_cmdline="$full_cmdline$section_alias:$section_path,"
+	    section_alias=''
+	    section_path=''
+	fi
+
+	# Or maybe.. we don't have an open section
+	if [ $opened_flag = "1" ]; then
+	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 1    
+	fi
+    fi	    
+
+    if [[ $line = *path* ]]; then
+	if [ $opened_flag = "1" ]; then
+	    if [ -z $section_path ]; then
+		section_path=`echo $line | awk '{print $3}'`	
+	    else
+		echo "Sorry, you have two paths in one section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+		exit 1
+	    fi
+	else
+	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 0
+	fi
+    fi
+
+    if [[ $line = *alias* ]]; then
+	if [ $opened_flag = "1" ]; then
+	    if [ -z $section_alias ]; then
+		section_alias=`echo $line | awk '{print $3}'`
+	    else
+		echo "Sorry, you have two alias in one section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+		exit 1
+	    fi
+	else
+	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
+	    exit 1
+	fi
+    fi
+
+	
+done
+
+echo $full_cmdline | sed 's/,$//'


Property changes on: xsp/trunk/debian/mono-server-reader.old
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server-update.conf
===================================================================
--- xsp/trunk/debian/mono-server-update.conf	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server-update.conf	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,140 @@
+#!/usr/bin/perl -w
+# Automatic mono-server file generator
+#
+# With this script the user can update the host files 
+# that are installed in /etc/mono-server/conf.d/package and create a 
+# 'big' host file (/etc/mono-server/mono-server*-hosts.conf) that will be used
+# by mono-server to setup the virtual hosts needed by 
+# the user.
+#
+# Under GPL, please read: 
+# http://www.gnu.org/copyleft/gpl.html
+#
+# Written by: Pablo Fischer
+
+use strict; 
+use Digest::MD5;
+
+#Main vars..
+my ($monoserver_dir, $monoserver_confd, $monoserver_hostfile, $daemon);
+
+#Setup main vars
+$monoserver_dir = "/etc/mono-server";
+$monoserver_confd = "$monoserver_dir/conf.d";
+$monoserver_hostfile = "$monoserver_dir/mono-server-hosts.conf";
+$daemon = "/etc/init.d/mono-server";
+
+
+my $restart = "yes";
+my $first_file = "yes";
+my ($orig_md5, $new_md5);
+
+#Check if the user have write access to $monoserver_hostfile
+if( ( -e "$monoserver_hostfile" && ! -w "$monoserver_hostfile" ) || ! -w "$monoserver_dir" ) {
+    print "mono-xsp-update.conf requires write access to $monoserver_hostfile or run it
+as root\n" ; 
+    exit 1 ;
+}
+
+#The user doesn't wants to restart the server?
+if($#ARGV eq "0") {
+    if($ARGV[0] eq "--norestart") {
+	$restart = "no";
+    }
+}
+
+
+
+#Orig md5
+$orig_md5 = &get_md5;
+#Read directory..
+&read_dir;
+if(-f "$monoserver_hostfile.tmp") {
+    #cp the temp file to the original one..
+    system("cp -f $monoserver_hostfile.tmp $monoserver_hostfile");
+    #rm the temp
+    system("rm -Rf $monoserver_hostfile.tmp");
+    #Final md5
+    $new_md5 = &get_md5;
+    #Equal?
+    if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
+	if( -f $daemon ) {
+	    system("$daemon restart");
+	}
+    }
+}
+
+sub get_md5 {
+    if( -e $monoserver_hostfile ) {
+	open(HOSTFILE, $monoserver_hostfile);
+	binmode(HOSTFILE);
+	return Digest::MD5->new->addfile(*HOSTFILE)->hexdigest;
+	
+    }
+    else {
+	return "";
+    }
+}
+
+
+sub read_dir {
+    opendir(DIR, $monoserver_confd);
+    my @host_dirs = sort (grep { -d "$monoserver_confd/$_" } readdir(DIR));
+    closedir(DIR);
+
+    #to verify that the cfg file is new.. we should create a new one
+    system("rm -Rf $monoserver_hostfile");
+    system("touch $monoserver_hostfile");
+
+    #How many dirs?
+    if($#host_dirs ne "0") {
+	foreach my $dir (@host_dirs) {
+	    if(($dir ne "..") && ($dir ne ".")) {
+		#Ok, in the dir.. we have more files, so read them
+		opendir(DIR, "$monoserver_confd/$dir");
+		my @host_files = sort (readdir(DIR));
+		closedir(DIR);
+		#Is it empty?		
+		if($#host_files ne "0") {
+		    #So, read it..
+		    foreach my $hostfile (@host_files) {
+			#Just remember.. we don't like directories inside directories!
+			if(($hostfile ne "..") && ($hostfile ne ".")) {
+			    $hostfile = "$monoserver_confd/$dir/$hostfile";
+			    write_tempxsphostfile($hostfile);
+			}
+		    }
+		}
+	    }
+	}
+    }
+}
+
+sub write_tempxsphostfile {
+    my $hostfile = shift;
+    local $/;
+
+    #Write the content to a temp file..
+    open(TEMPHOST, ">> $monoserver_hostfile.tmp");
+    #And open the hostfile..
+    open(HOSTFILE, "$hostfile");
+    #Read it..
+    my $content_hostfile = <HOSTFILE>;
+    #Close it..
+    close(HOSTFILE);
+    #Write the header to the monoserver_hostfile
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST "### begin $hostfile\n";
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST $content_hostfile, "\n";
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST "### end $hostfile\n";
+    print TEMPHOST "###########################################\n";
+    close(TEMPHOST);
+}
+
+    
+
+    
+    
+    


Property changes on: xsp/trunk/debian/mono-server-update.conf
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server-update.old
===================================================================
--- xsp/trunk/debian/mono-server-update.old	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server-update.old	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+MONOSERVER_confdir="/etc/mono-server"
+MONOSERVER_conffile=$MONOSERVER_confdir/mono-server-hosts.conf
+MONOSERVER_comments=no
+MONOSERVER_restart=yes
+
+usage() {
+    cat <<EOF
+$0 - Generate the Mono Server Host Configuration
+  Options:
+     --help              - Show this message
+     --output file       - write the output to other file instead of ${MONOSERVER_conffile}
+     --confdir directory - read the configuration files in a directory instead of ${MONOSERVER_confdir}
+     --norestart         - Do not restart the daemon (by default, it will)
+EOF
+}
+
+#Read the commandline
+TEMP=$(getopt -n mono-server-update.conf \
+    -l output:,confdir:,norestart,help -- \
+    : "$@")
+
+
+eval set -- ${TEMP}
+while test "$1" != "--"; do
+    case $1 in
+	--help)
+	    usage
+	    exit 0
+	    ;;
+	--norestart)
+#	    shift
+	    MONOSERVER_restart="no"
+	    ;;
+	--output)
+	    shift
+	    MONOSERVER_conffile="$1"
+	    ;;
+	--confdir)
+	    shift
+	    MONOSERVER_confdir="$1"
+	    ;;
+	esac
+    shift
+done
+shift
+
+# No non-options arguments 
+if [ "$#" -ne 0 ]; then
+	echo "No non option arguments ($@) allowed" >&2
+	usage >&2
+	exit 1
+fi
+	    
+
+MONOSERVER_confd=$MONOSERVER_confdir/conf.d
+
+if [ ! -d ${MONOSERVER_confd} ]; then
+    printf "$0: Error, no ${MONOSERVER_confd} directory, exiting..\n" 1>&2 
+    exit 1 
+fi
+
+if [ ! -d `dirname $MONOSERVER_conffile ` ]; then
+    printf "$0: Error, missing `dirname $MONOSERVER_conffile` directory, exiting.\n" 1>&2 
+    exit 1
+fi
+
+if [ -e "$MONOSERVER_conffile" ]; then
+    md5_orig=`md5sum $MONOSERVER_conffile | awk '{print $1}'`
+else
+    md5_orig="0"
+fi
+
+
+# based on exim4-update.conf
+errormessage () {
+	# pretty-print messages of arbitrary length (no trailing newline)
+	echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
+}
+
+restart_firsttime() {    
+    confd="${MONOSERVER_confd}"
+    almost_empty="`ls -lA $confd | wc -l`"
+    if [ "$almost_empty" = "2" ] ; then
+	echo "Starting Mono Server: mono-server"
+	/etc/init.d/mono-server start > /dev/null 2>&1 || true		
+    fi    
+}
+
+restart_monoserver() {
+    #Ok, include the default file
+    . "/etc/default/mono-server"
+    #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
+	    if [ "$start_boot" = "true" ]; then
+		echo "Restarting Mono Server: mono-server"
+		/etc/init.d/mono-server restart > /dev/null 2>&1 || true
+	    fi
+	else
+	    restart_firsttime
+	fi
+    else
+	if [ "$start_boot" = "true" ]; then
+	    restart_firsttime 
+	fi
+    fi
+}
+
+
+# stolen from /etc/X11/Xsession
+run_parts () {
+  # until run-parts --noexec is implemented
+  if [ -z "$1" ]; then
+      errormessage "run_parts() called without an argument."
+  fi
+  if [ ! -d "$1" ]; then
+      errormessage "run_parts() called, but \"$1\" does not exist or is" \
+	  "not a directory."
+  fi
+  for F in $(ls $1); do
+      if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
+	  if [ -f "$1/$F" ]; then
+	      echo "$1/$F"
+	  fi
+      fi
+  done
+}
+
+
+# based on exim4-update.conf
+cat_parts() {
+    if [ -z "$1" ]; then
+	errormessage "$0: internal cat_parts called without an argument"
+    fi
+    if [ ! -d "$1" ]; then
+	errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
+    fi
+    for file in `run_parts $1`; do
+	echo "#####################################################"
+	echo "### begin $file"
+	echo "#####################################################"
+	cat $file 
+	echo "#####################################################"
+	echo "### end $file" 
+	echo "#####################################################"
+	echo ""	
+    done
+}
+
+
+gentmpconf() {
+	touch ${MONOSERVER_conffile}.tmp
+	chmod 640 ${MONOSERVER_conffile}.tmp
+	[ -e ${MONOSERVER_conffile} ] && chmod 640 ${MONOSERVER_conffile}
+}
+
+#Ok, we start here..
+gentmpconf
+for vhosts in `ls ${MONOSERVER_confd}`; do
+    cat_parts ${MONOSERVER_confd}/$vhosts
+done > ${MONOSERVER_conffile}.tmp
+
+mv -f ${MONOSERVER_conffile}.tmp ${MONOSERVER_conffile}
+chmod 644 ${MONOSERVER_conffile}
+
+#re-check the md5
+md5_new=`md5sum $MONOSERVER_conffile | awk '{print $1}'`
+
+#The orig and new.. are the same?
+if [ "$md5_new" != "$md5_orig" ]; then
+    #So, restart the server.. but.. should we?
+    if [ "${MONOSERVER_restart}" = "yes" ]; then
+	restart_monoserver
+    fi
+fi


Property changes on: xsp/trunk/debian/mono-server-update.old
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.README.Debian
===================================================================
--- xsp/trunk/debian/mono-server.README.Debian	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.README.Debian	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,49 @@
+mod-mono-server for Debian
+--------------
+
+The mono-server package creates a socket in /tmp, so that mod_mono (in Apache) can be started
+without errors. 
+
+Also, to download mono-server there is no need to download libapache-mod-mono (viceversa, yes), 
+however, to run the daemon you NEED to have libapache-mod-mono. It's easy, there's no need to create
+the socket if mod_mono is not present, right?
+
+Also, after you downloaded libapache-mod-mono, mono-server can create the socket and chmod/chown 
+the socket. The user and group that mono-server uses are www-data.
+
+The way that mono-server manage the /alias (virtual hosts) is like exim does and using the VirtualHosts
+of Apache. The first way is inside /etc/mono-server, were we have a conf.d directory, then we 
+have directories for each 'virtualhost'.
+
+For example, we have monodoc-http, so we have:
+
+/etc/mono-server 		<- Mono Server Config Dir
+/etc/mono-server/conf.d 	<- Mono Server VirtualHosts Config Directories
+/etc/mono-server/conf.d/monodoc <- MonoDoc Config Files for Mono Server
+
+Every file is marked by a number, an underscore and the alias name, for example:
+
+/etc/mono-server/conf.d/monodoc/10_monodochttp
+
+If you want to install a new virtualhost for Mono Server, you just need to apt-get it, and if 
+Mono Server is running it should be started normally, if it's the first virtualhost and you configured
+mono-server to be started automatically it will start mono-server by default.
+
+If you configured mono-server to NOT be started automatically, you should start mono-server manually:
+
+/etc/init.d/mono-server start
+
+And the second way to manage the virtualhost, is to also add an /alias mono.conf:
+
+/etc/apache/conf.d/mono.conf
+
+Also, if you are installing YOUR OWN VirtualHost, you should read the template file (in the config dir) 
+and follow the steps of this little FAQ.
+
+NOTE: In some cases you can find that /etc/mono-server|/etc/xsp exists with other virtualhosts and you  
+don't have mono-server|mono-xsp installed, don't get in panic, some virtualhosts installs host configuration 
+files in both server (xsp and mono-server).
+
+Happy Hacking
+
+ -- Pablo Fischer <pablo at pablo.com.mx>, Mon, 15 Mar 2004 18:52:30 -0600

Added: xsp/trunk/debian/mono-server.config
===================================================================
--- xsp/trunk/debian/mono-server.config	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.config	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+db_capb backup
+db_title ModMono Server
+
+STATE=1
+while [ "$STATE"  != 0 -a "$STATE" != 2 ]; do
+    case "$STATE" in
+	1) 
+	    db_input medium monoserver/monoserver_autostart || true
+	    if db_go; then
+		db_get monoserver/monoserver_autostart || true
+		if [ "$RET" = "true" ]; then
+		    STATE=2
+		else
+		    db_set  monoserver/monoserver_autostart false || true
+		    STATE=2
+		fi
+	    else
+		STATE=0
+	    fi
+	    ;;
+	esac
+done
+
+if [ "$STATE" = 0 ]; then
+    exit 1
+fi
+
+	    
+
+
+


Property changes on: xsp/trunk/debian/mono-server.config
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.default
===================================================================
--- xsp/trunk/debian/mono-server.default	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.default	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,14 @@
+# Defaults for mono-server, official version
+# sourced by /etc/init.d/mono-server
+
+# Should we start it?
+start_boot=true
+
+# User and group to chmod the *socket*
+user=www-data
+group=www-data
+
+# Name of the socket file
+socket_file=/tmp/.mono-server/mod_mono_server
+
+

Added: xsp/trunk/debian/mono-server.dirs
===================================================================
--- xsp/trunk/debian/mono-server.dirs	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.dirs	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,6 @@
+usr/bin
+etc/mono-server
+etc/mono-server/conf.d
+usr/share/dotnet/bin
+usr/share/dotnet/monoserver
+

Added: xsp/trunk/debian/mono-server.files
===================================================================
--- xsp/trunk/debian/mono-server.files	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.files	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1 @@
+usr/bin/mod-mono-server.exe

Added: xsp/trunk/debian/mono-server.init
===================================================================
--- xsp/trunk/debian/mono-server.init	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.init	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,145 @@
+#! /bin/sh
+#
+# mono-server	Start the mono-server, the mod-mono-server one
+#
+#		Written by Pablo Fischer <pablo at pablo.com.mx>
+#		Modified for Debian GNU/Linux
+#
+# Version:	@(#)mono-server pablo at pablo.com.mx
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/mod-mono-server
+NAME=mono-server
+DESC="Mono Server, mod-mono-server"
+DEFAULT=/etc/default/$NAME
+CFGDIR=/etc/$NAME
+VIRTUALFILE=$CFGDIR/mono-server-hosts.conf
+
+test -x $DAEMON || exit 0
+
+virtual_dirs=`mono-server-reader.conf --norestart`
+
+prepare_socket() {
+    . $DEFAULT
+    if [ ! -d /tmp/.mono-server ]; then
+        mkdir /tmp/.mono-server
+    fi
+
+    if [ -e $socket_file ]; then
+	rm -Rf $socket_file
+    fi
+}
+
+fix_privileges() {
+    . $DEFAULT
+    chown $user.$group $socket_file
+}
+
+should_start() {
+    if [ -e $DEFAULT ]; then
+        . $DEFAULT
+        if [ "$start_boot" != "true" ]; then
+            echo "$NAME not started as requested"
+            return 1
+        fi
+    fi
+
+    if [ ! -f /usr/lib/apache/1.3/500mod_mono.info ]; then
+	echo "There's no need to start me if you don't have libapache-mod-mono, sorry!"
+	return 1
+    fi
+	
+    if [ ! -x $DAEMON ]; then
+        echo "$NAME is not executable, not starting"
+        return 1
+    fi
+
+    if [ ! -e $VIRTUALFILE ]; then
+	echo "You dont have $VIRTUALFILE "
+	echo "To have it, you need to install at least one package for xsp (like asp.net-examples)"	
+	return 1
+    fi
+
+    if [[ -z $virtual_dirs ]]; then
+        echo "Sorry, I found an empty /etc/mono-server/mono-server-hosts.conf"
+        return 1
+    fi
+    
+    if [[ $virtual_dirs = *Sorry* ]]; then
+        echo "Sorry, I found a missconfiguration in /etc/mono-server/mono-server-hosts.conf, fix it, or dpkg-reconfigure mono-server/virtua\lhosts packages"
+        return 1
+    fi
+                                                                                                                              
+    prepare_socket
+    return 0
+}
+
+
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running monoserver?
+	monoserver_pid=`cat /var/run/$NAME`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$monoserver_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    else
+	return 0
+    fi  
+}
+
+case "$1" in
+  start)
+	if should_start ; then
+	    . $DEFAULT
+	    echo -n "Starting $DESC: $NAME"
+	    start-stop-daemon --start --background --make-pidfile \
+		--quiet --pidfile /var/run/$NAME \
+		--exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop	
+	    echo "."
+	    sleep 2
+	    fix_privileges
+	fi	    
+	;;
+  stop)
+	if should_stop ; then
+	    echo -n "Stopping $DESC: $NAME "
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    echo "."
+	fi
+	;;
+  restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	if should_stop ; then
+	    echo "Restarting $DESC: $NAME"
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    sleep 1
+	fi
+	
+	if should_start ; then
+	    . $DEFAULT	
+	    start-stop-daemon --start --background --make-pidfile \
+		--quiet --pidfile /var/run/$NAME \
+		--exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop	
+	    echo "."
+	    sleep 2
+	    fix_privileges
+	fi
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0


Property changes on: xsp/trunk/debian/mono-server.init
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.links
===================================================================
--- xsp/trunk/debian/mono-server.links	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.links	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,2 @@
+/usr/share/dotnet/monoserver/mono-server-reader.conf /usr/sbin/mono-server-reader.conf
+/usr/share/dotnet/monoserver/mono-server-update.conf /usr/sbin/mono-server-update.conf

Added: xsp/trunk/debian/mono-server.postinst
===================================================================
--- xsp/trunk/debian/mono-server.postinst	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.postinst	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,92 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+tempfile=`/bin/tempfile`
+modmono_default="/etc/default/mono-server"
+NAME=mono-server
+DESC="Mono Server, mono-server"
+CFGDIR=/etc/$NAME
+VIRTUALFILE=$CFGDIR/mono-server-hosts.conf
+virtual_dirs=`mono-server-reader.conf`
+
+
+activate_monoserver() {
+    sed s/start_boot=false/start_boot=true/g $modmono_default > $tempfile
+    cp -f $tempfile $modmono_default
+    rm -Rf $tempfile
+
+}
+
+deactivate_monoserver() {
+    sed s/start_boot=true/start_boot=false/g $modmono_default > $tempfile
+    cp -f $tempfile $modmono_default
+    rm -Rf $tempfile
+}
+
+
+should_start() {
+    if [ -e $modmono_default ]; then
+        . $modmono_default
+        if [ "$start_boot" != "true" ]; then
+	    return 1
+        fi
+    fi
+
+    if [ ! -f /usr/lib/apache/1.3/500mod_mono.info ]; then
+	return 1
+    fi
+	
+    if [ ! -e $VIRTUALFILE ]; then
+	return 1
+    fi
+
+    if [[ $virtual_dirs = *Sorry* ]]; then
+	return 1
+    fi
+                                                                                                                              
+    if [[ -z $virtual_dirs ]]; then
+	return 1
+    fi
+    return 0
+
+}
+
+case "$1" in
+    configure)
+	db_get monoserver/monoserver_autostart || true
+	if [ "$RET" = "true" ]; then
+	    activate_monoserver
+	    if [ -x "/etc/init.d/mono-server" ]; then
+		update-rc.d mono-server defaults >/dev/null
+	    fi
+	else
+	    deactivate_monoserver
+	fi
+	mono-server-update.conf
+	
+	if should_start ; then
+	    echo -n "Starting $DESC: $NAME "
+	    /etc/init.d/mono-server start > /dev/null 2>&1 || true
+	fi	
+	;;
+    
+    *)
+	echo "postinst failed \`$1'" >&2
+	exit 0
+	;;
+esac
+
+exit 0
+
+
+	    
+	    
+
+		
+
+    
+


Property changes on: xsp/trunk/debian/mono-server.postinst
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.postrm
===================================================================
--- xsp/trunk/debian/mono-server.postrm	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.postrm	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+monoserverconfd="/etc/mono-server/conf.d/"
+
+case "$1" in
+    purge)
+	rm -Rf "$monoserverconfd/*"
+	. /usr/share/debconf/confmodule
+        db_purge
+	#update-rc.d
+	update-rc.d -f mono-server remove >/dev/null
+	;;
+    esac
+exit 0


Property changes on: xsp/trunk/debian/mono-server.postrm
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.preinst
===================================================================
--- xsp/trunk/debian/mono-server.preinst	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.preinst	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+NAME=mono-server
+DESC="Mono Server, mod-mono-server"
+
+#0 : false
+#1 : true
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running monoserver?
+	monoserver_pid=`cat /var/run/$NAME`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$monoserver_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    fi  
+    return 0
+}
+
+case "$1" in
+   upgrade|install)
+	if should_stop ; then
+	    echo -n "Stopping $DESC: $NAME "
+	    /etc/init.d/mono-server stop > /dev/null 2>&1 || true
+	fi
+	;;
+esac
+exit 0


Property changes on: xsp/trunk/debian/mono-server.preinst
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.prerm
===================================================================
--- xsp/trunk/debian/mono-server.prerm	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.prerm	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,33 @@
+#!/bin/sh -e
+
+NAME=mono-server
+DESC="Mono Server, mono-server"
+
+monoserverconfd="/etc/mono-server/conf.d/"
+
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running monoserver?
+	monoserver_pid=`cat /var/run/$NAME`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$monoserver_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    fi  
+    return 0
+}
+
+case "$1" in
+    remove)
+	# should we stop the server?
+	if should_stop ; then
+	    echo "Stopping $DESC: $NAME "
+	    /etc/init.d/mono-server stop > /dev/null 2>&1 || true
+	fi
+	;;
+esac
+exit 0
+


Property changes on: xsp/trunk/debian/mono-server.prerm
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-server.substvars
===================================================================
--- xsp/trunk/debian/mono-server.substvars	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.substvars	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1 @@
+misc:Depends=debconf (>= 0.5) | debconf-2.0

Added: xsp/trunk/debian/mono-server.templates
===================================================================
--- xsp/trunk/debian/mono-server.templates	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-server.templates	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,4 @@
+Template: monoserver/monoserver_autostart
+Type: boolean
+Default: true
+Description: Would you like to autostart the mod-mono-server when you start your computer?

Added: xsp/trunk/debian/mono-xsp-reader.conf
===================================================================
--- xsp/trunk/debian/mono-xsp-reader.conf	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp-reader.conf	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,109 @@
+#!/usr/bin/perl -w
+# Automatic XSP file generator
+#
+# With this script the user (or daemon) can check if the 'big' XPS host 
+# file is ok and in the right sintax, if there is an error it will exit
+# and print the reason in the format: *SORRY*: message.
+#
+# Under GPL, please read: 
+# http://www.gnu.org/copyleft/gpl.html
+#
+# Written by: Pablo Fischer
+
+use strict;
+
+#Main vars..
+my ($xsp_dir, $xsp_confd, $xsp_hostfile);
+
+#Setup main vars
+$xsp_dir = "/etc/xsp";
+$xsp_confd = "$xsp_dir/conf.d";
+$xsp_hostfile = "$xsp_dir/mono-xsp-hosts.conf";
+
+
+#Check if the user have write access to $xsp_hostfile
+if( ( -e "$xsp_hostfile" && ! -w "$xsp_hostfile" ) || ! -w "$xsp_dir" ) {
+    print "mono-host-reader requires to be executed as root\n" ; 
+    exit 1 ;
+}
+
+if( ! -f "$xsp_hostfile" ) {
+    print "Sorry\, but you don't have $xsp_hostfile\n";
+    exit 0;
+}
+
+
+my $opened_section = 0;
+my $applications = "";
+
+my ($path, $alias);
+#1 -> true
+#0 -> false
+#Ok, open the file for read mode
+open(HOSTFILE, $xsp_hostfile);
+#.. read it!
+#Line counter
+my $counter = 0;
+while(my $line = <HOSTFILE>) {
+    $counter++;
+    if($line =~ /begin/i) {
+	if($opened_section eq "1") {
+	    print "Sorry\, but you are opening a section before closing the last one (line $counter)\n";
+	    last;
+	}
+	else {
+	    $opened_section = "1";
+	}
+    }
+
+    if($line =~ /end/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you are closing an unopened section (line $counter)\n";
+	}
+	else {
+	    $opened_section = "0";
+	    $applications = "$applications$alias:$path,";
+	}
+    }	
+    
+    if($line =~ /path/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you have a path in a unopened section (line $counter)\n";
+	    last;
+	}
+	else {
+	    #Ok, the directory exists?
+	    my $dir = (split /\=/, $line)[1];
+	    #Remove blank spaces
+	    $dir =~ tr/\ //d;
+	    #remove that \n
+	    $dir =~ s/\n//;
+ 	    if ( ! -d "$dir" ) {
+ 		print "Sorry\, but you have a path that doesn't exists in your system! (line $counter)\n";
+		last;
+ 	    }
+	    else {
+		$path = $dir;
+	    }
+	}
+    }
+
+    if($line =~ /alias/i) {
+	if($opened_section eq "0") {
+	    print "Sorry\, but you have an alias in a unopened section (line $counter)\n";
+	    last;
+	}
+	else {	    
+	    $alias = (split /\=/, $line)[1];
+	    #Blank Spaces
+	    $alias =~ tr/\ //d;
+	    #New lines..
+	    $alias =~ s/\n//;
+	    
+	}
+    }	
+}
+	
+close(HOSTFILE);
+$applications =~ s/,$//;
+print $applications;


Property changes on: xsp/trunk/debian/mono-xsp-reader.conf
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp-reader.old
===================================================================
--- xsp/trunk/debian/mono-xsp-reader.old	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp-reader.old	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+MONOXSP_confdir="/etc/xsp"
+MONOXSP_conffile=$MONOXSP_confdir/mono-xsp-hosts.conf
+MONOXSP_validate=no
+
+usage() {
+    cat <<EOF
+$0 - Read the XSP Host Configuration
+  Options:
+     --help              - Show this message
+     --output file       - Read other host configuration file instead of ${MONOXSP_conffile}
+EOF
+}
+
+
+#Read the commandline
+TEMP=$(getopt -n mono-xsp-reader.conf \
+    -l output:,help -- \
+    : "$@")
+
+
+eval set -- ${TEMP}
+while test "$1" != "--"; do
+    case $1 in
+	--help)
+	    usage
+	    exit 0
+	    ;;
+	--output)
+	    shift
+	    MONOXSP_conffile="$1"
+	    ;;
+    esac
+    shift
+done
+shift
+
+opened_file=''
+opened_flag=0
+counter=0
+first_line='yes'
+
+
+section_alias=''
+section_path=''
+
+full_cmdline=''
+
+if [ ! -f $MONOXSP_conffile ]; then
+    echo "Sorry, but you don't have $MONOXSP_conffile, install a package, like asp.net-examples"
+    exit 1
+else
+    if [ ! -e $MONOXSP_conffile ]; then
+        echo "Sorry, but you don't have a $MONOSERVER_conffile, install a package, like asp.net-examples"
+        exit 1
+    fi
+fi
+
+    
+for line in `cat $MONOXSP_conffile | tr ' ' '~'`; do
+    line=`echo $line | tr '~' ' '`
+    if [[ $line = *begin* ]]; then
+	if [[ $opened_flag = "1" && $first_line = 'no' ]]; then
+	    echo "Sorry, you have a bad $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 1
+	fi
+	opened_file=`echo $line | awk '{print $3}'`
+	opened_flag=1
+	first_line='no'
+    fi
+    
+    if [[ $line = *end* ]]; then
+	closed_file=`echo $line | awk '{print $3}'`
+	if [[ $section_alias = '' || $section_path = '' ]]; then
+	    echo "Sorry, No path/alias found in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 1
+	fi
+
+	if [ $closed_file != $opened_file ]; then
+	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 1
+	else
+	    opened_flag="0"
+	    full_cmdline="$full_cmdline$section_alias:$section_path,"
+	    section_alias=''
+	    section_path=''
+	fi
+
+	# Or maybe.. we don't have an open section
+	if [ $opened_flag = "1" ]; then
+	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 1    
+	fi
+    fi	    
+
+    if [[ $line = *path* ]]; then
+	if [ $opened_flag = "1" ]; then
+	    if [ -z $section_path ]; then
+		section_path=`echo $line | awk '{print $3}'`	
+	    else
+		echo "Sorry, you have two paths in one section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+		exit 1
+	    fi
+	else
+	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 0
+	fi
+    fi
+
+    if [[ $line = *alias* ]]; then
+	if [ $opened_flag = "1" ]; then
+	    if [ -z $section_alias ]; then
+		section_alias=`echo $line | awk '{print $3}'`
+	    else
+		echo "Sorry, you have two alias in one section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+		exit 1
+	    fi
+	else
+	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
+	    exit 1
+	fi
+    fi
+
+	
+done
+
+echo $full_cmdline | sed 's/,$//'


Property changes on: xsp/trunk/debian/mono-xsp-reader.old
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp-update.conf
===================================================================
--- xsp/trunk/debian/mono-xsp-update.conf	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp-update.conf	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,139 @@
+#!/usr/bin/perl -w
+# Automatic XSP file generator
+#
+# With this script the user can update the host files 
+# that are installed in /etc/xspconf.d/package and create a 
+# 'big' host file (/etc/xsp/mono-xsp-hosts.conf) that will be used
+# by xsp to setup the virtual hosts needed by 
+# the user.
+#
+# Under GPL, please read: 
+# http://www.gnu.org/copyleft/gpl.html
+#
+# Written by: Pablo Fischer
+
+use strict; 
+use Digest::MD5;
+
+#Main vars..
+my ($xsp_dir, $xsp_confd, $xsp_hostfile, $daemon);
+
+#Setup main vars
+$xsp_dir = "/etc/xsp";
+$xsp_confd = "$xsp_dir/conf.d";
+$xsp_hostfile = "$xsp_dir/mono-xsp-hosts.conf";
+$daemon = "/etc/init.d/mono-xsp";
+
+
+my $restart = "yes";
+my $first_file = "yes";
+my ($orig_md5, $new_md5);
+
+#Check if the user have write access to $xsp_hostfile
+if( ( -e "$xsp_hostfile" && ! -w "$xsp_hostfile" ) || ! -w "$xsp_dir" ) {
+    print "mono-xsp-update.conf requires write access to $xsp_hostfile or run it
+as root\n" ; 
+    exit 1 ;
+}
+
+#The user doesn't wants to restart the server?
+if($#ARGV eq "0") {
+    if($ARGV[0] eq "--norestart") {
+	$restart = "no";
+    }
+}
+
+
+#Orig md5
+$orig_md5 = &get_md5;
+#Read directory..
+&read_dir;
+#cp the temp file to the original one..
+if( -f "$xsp_hostfile.tmp" ) {
+    system("cp -f $xsp_hostfile.tmp $xsp_hostfile");
+    #rm the temp
+    system("rm -Rf $xsp_hostfile.tmp");
+    #Final md5
+    $new_md5 = &get_md5;
+    #Equal?
+    if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
+	if( -f $daemon ) {
+	    system("$daemon restart");
+	}
+    }
+}
+
+sub get_md5 {
+    if( -e $xsp_hostfile ) {
+	open(HOSTFILE, $xsp_hostfile);
+	binmode(HOSTFILE);
+	return Digest::MD5->new->addfile(*HOSTFILE)->hexdigest;
+	
+    }
+    else {
+	return "";
+    }
+}
+
+
+sub read_dir {
+    opendir(DIR, $xsp_confd);
+    my @host_dirs = sort (grep { -d "$xsp_confd/$_" } readdir(DIR));
+    closedir(DIR);
+    
+    #to verify that the cfg file is new.. we should create a new one
+    system("rm -Rf $xsp_hostfile");
+    system("touch $xsp_hostfile");
+
+    #How many dirs?
+    if($#host_dirs ne "0") {
+	foreach my $dir (@host_dirs) {
+	    if(($dir ne "..") && ($dir ne ".")) {
+		#Ok, in the dir.. we have more files, so read them
+		opendir(DIR, "$xsp_confd/$dir");
+		my @host_files = sort (readdir(DIR));
+		closedir(DIR);
+		#Is it empty?		
+		if($#host_files ne "0") {
+		    #So, read it..
+		    foreach my $hostfile (@host_files) {
+			#Just remember.. we don't like directories inside directories!
+			if(($hostfile ne "..") && ($hostfile ne ".")) {
+			    $hostfile = "$xsp_confd/$dir/$hostfile";
+			    write_tempxsphostfile($hostfile);
+			}
+		    }
+		}
+	    }
+	}
+    }	    
+}
+
+sub write_tempxsphostfile {
+    my $hostfile = shift;
+    local $/;
+
+    #Write the content to a temp file..
+    open(TEMPHOST, ">> $xsp_hostfile.tmp");
+    #And open the hostfile..
+    open(HOSTFILE, "$hostfile");
+    #Read it..
+    my $content_hostfile = <HOSTFILE>;
+    #Close it..
+    close(HOSTFILE);
+    #Write the header to the xsp_hostfile
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST "### begin $hostfile\n";
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST $content_hostfile, "\n";
+    print TEMPHOST "###########################################\n";
+    print TEMPHOST "### end $hostfile\n";
+    print TEMPHOST "###########################################\n";
+    close(TEMPHOST);
+}
+
+    
+
+    
+    
+    


Property changes on: xsp/trunk/debian/mono-xsp-update.conf
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp-update.old
===================================================================
--- xsp/trunk/debian/mono-xsp-update.old	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp-update.old	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+MONOXSP_confdir="/etc/xsp"
+MONOXSP_conffile=$MONOXSP_confdir/mono-xsp-hosts.conf
+MONOXSP_comments=no
+MONOXSP_restart=yes
+
+
+usage() {
+    cat <<EOF
+$0 - Generate the XSP Host Configuration
+  Options:
+     --help              - Show this message
+     --output file       - write the output to other file instead of ${MONOXSP_conffile}
+     --confdir directory - read the configuration files in a directory instead of ${MONOXSP_confdir}
+     --norestart         - Do not restart the daemon (by default, it will)
+EOF
+}
+
+#Read the commandline
+TEMP=$(getopt -n mono-xsp-update.conf \
+    -l output:,confdir:,norestart,help -- \
+    : "$@")
+
+
+eval set -- ${TEMP}
+while test "$1" != "--"; do
+    case $1 in
+	--help)
+	    usage
+	    exit 0
+	    ;;
+	--norestart)
+#	    shift
+	    MONOXSP_restart="no"
+	    ;;
+	--output)
+	    shift
+	    MONOXSP_conffile="$1"
+	    ;;
+	--confdir)
+	    shift
+	    MONOXSP_confdir="$1"
+	    ;;
+	esac
+    shift
+done
+shift
+
+# No non-options arguments 
+if [ "$#" -ne 0 ]; then
+    echo "Si aja"
+	echo "No non option arguments ($@) allowed" >&2
+	usage >&2
+	exit 1
+fi
+	    
+
+MONOXSP_confd=$MONOXSP_confdir/conf.d
+
+if [ ! -d ${MONOXSP_confd} ]; then
+    printf "$0: Error, no ${MONOXSP_confd} directory, exiting..\n" 1>&2 
+    exit 1 
+fi
+
+if [ ! -d `dirname $MONOXSP_conffile ` ]; then
+    printf "$0: Error, missing `dirname $MONOXSP_conffile` directory, exiting.\n" 1>&2 
+    exit 1
+fi
+
+if [ -e "$MONOXSP_conffile" ]; then
+    md5_orig=`md5sum $MONOXSP_conffile | awk '{print $1}'`
+else
+    md5_orig="0"
+fi
+
+# based on exim4-update.conf
+errormessage () {
+	# pretty-print messages of arbitrary length (no trailing newline)
+	echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
+}
+
+restart_firsttime() {    
+    confd="${MONOXSP_confd}"
+    almost_empty="`ls -lA $confd | wc -l`"
+    if [ "$almost_empty" = "2" ] ; then
+	echo "Starting XSP WebServer: mono-xsp"
+	/etc/init.d/mono-xsp start > /dev/null 2>&1 || true		
+    fi    
+}
+
+restart_xsp() {
+    #Ok, include the default file
+    . "/etc/default/mono-xsp"
+    #MonoServer 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
+	    if [ "$start_boot" = "true" ]; then
+		echo "Restarting XSP WebServer: mono-xsp"
+		/etc/init.d/mono-xsp restart > /dev/null 2>&1 || true
+	    fi
+	else
+	    restart_firsttime
+	fi
+    else
+	if [ "$start_boot" = "true" ]; then
+	    restart_firsttime 
+	fi
+    fi
+}
+
+# stolen from /etc/X11/Xsession
+run_parts () {
+  # until run-parts --noexec is implemented
+  if [ -z "$1" ]; then
+      errormessage "run_parts() called without an argument."
+  fi
+  if [ ! -d "$1" ]; then
+      errormessage "run_parts() called, but \"$1\" does not exist or is" \
+	  "not a directory."
+  fi
+  for F in $(ls $1); do
+      if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
+	  if [ -f "$1/$F" ]; then
+	      echo "$1/$F"
+	  fi
+      fi
+  done
+}
+
+
+# based on exim4-update.conf
+cat_parts() {
+    if [ -z "$1" ]; then
+	errormessage "$0: internal cat_parts called without an argument"
+    fi
+    if [ ! -d "$1" ]; then
+	errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
+    fi
+    for file in `run_parts $1`; do
+	echo "#####################################################"
+	echo "### begin $file"
+	echo "#####################################################"
+	cat $file 
+	echo "#####################################################"
+	echo "### end $file" 
+	echo "#####################################################"
+	echo ""	
+    done
+}
+
+
+gentmpconf() {
+	touch ${MONOXSP_conffile}.tmp
+	chmod 640 ${MONOXSP_conffile}.tmp
+	[ -e ${MONOXSP_conffile} ] && chmod 640 ${MONOXSP_conffile}
+}
+
+#Ok, we start here..
+gentmpconf
+for vhosts in `ls ${MONOXSP_confd}`; do
+    cat_parts ${MONOXSP_confd}/$vhosts
+done > ${MONOXSP_conffile}.tmp
+
+mv -f ${MONOXSP_conffile}.tmp ${MONOXSP_conffile}
+chmod 644 ${MONOXSP_conffile}
+
+#re-check the md5
+md5_new=`md5sum $MONOXSP_conffile | awk '{print $1}'`
+
+#The orig and new.. are the same?
+if [ "$md5_new" != "$md5_orig" ]; then
+    #So, restart the server.. but.. should we?
+    if [ "${MONOXSP_restart}" = "yes" ]; then
+	restart_xsp
+    fi
+fi


Property changes on: xsp/trunk/debian/mono-xsp-update.old
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.README.Debian
===================================================================
--- xsp/trunk/debian/mono-xsp.README.Debian	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.README.Debian	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,46 @@
+xsp for Debian
+--------------
+
+The mono-xsp package contains a standalone WebServer to run ASP.NET, developed
+by the Mono hackers, it should run in port 8080 or 8081, the scripts detects which port
+to use.
+
+For example, if you have a mail proxy (or http proxy) using 8080 it should run in 8081.
+
+To change the port, you need to kill your http/mail proxy or move them to other port, and then
+reconfigure xsp as root:
+
+# dpkg-reconfigure mono-xsp
+
+The way that xsp manage the /alias (virtual hosts) is like exim does. We have a directory in 
+/etc called xsp, inside it we have a conf.d directory, were we have directories for each 
+'virtualhost'.
+
+For example, we have monodoc-http, so we have:
+
+/etc/xsp 		<- Mono XSP Config Dir
+/etc/xsp/conf.d 	<- Mono XSP VirtualHosts Config Directories
+/etc/xsp/conf.d/monodoc <- MonoDoc Config Files for XSP
+
+Every file is marked by a number, an underscore and the alias name, for example:
+
+/etc/xsp/conf.d/monodoc/10_monodochttp
+
+If you want to install a new virtualhost to XSP, you just need to apt-get it, and if 
+XSP is running it should be started normally, if it's the first virtualhost and you configured
+mono-xsp to be started automatically it will start xsp by default.
+
+If you configured mono-xsp to NOT be started automatically, you should start mono-xsp manually:
+
+/etc/init.d/mono-xsp start
+
+Also, if you are installing YOUR OWN VirtualHost, you should read the template file (in the config dir) 
+and follow the steps of this little FAQ.
+
+NOTE: In some cases you can find that /etc/mono-server|/etc/xsp exists with other virtualhosts and you  
+don't have mono-server|mono-xsp installed, don't get in panic, some virtualhosts installs host configuration 
+files in both server (xsp and mono-server).
+
+Happy Hacking
+
+ -- Pablo Fischer <pablo at pablo.com.mx>, Mon, 15 Mar 2004 18:52:30 -0600

Added: xsp/trunk/debian/mono-xsp.config
===================================================================
--- xsp/trunk/debian/mono-xsp.config	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.config	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,36 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+db_capb backup
+db_title XSP WebServer
+
+STATE=1
+while [ "$STATE"  != 0 -a "$STATE" != 2 ]; do
+    case "$STATE" in
+	1) 
+	    db_input medium xsp/xsp_autostart || true
+	    if db_go; then
+		db_get xsp/xsp_autostart || true
+		if [ "$RET" = "true" ]; then
+		    STATE=2
+		else
+		    db_set  xsp/xsp_autostart false || true
+		    STATE=2
+		fi
+	    else
+		STATE=0
+	    fi
+	    ;;
+	esac
+done
+
+if [ "$STATE" = 0 ]; then
+    exit 1
+fi
+
+	    
+
+
+
+


Property changes on: xsp/trunk/debian/mono-xsp.config
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.default
===================================================================
--- xsp/trunk/debian/mono-xsp.default	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.default	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,15 @@
+# Defaults for mono-xsp, official version
+# sourced by /etc/init.d/mono-xsp
+
+# Should we start it?
+start_boot=true
+
+# User and group by default
+user=www-data
+group=www-data
+
+# Default port
+port=8080
+
+# Directory for config files
+config_files=/etc/xsp

Added: xsp/trunk/debian/mono-xsp.dirs
===================================================================
--- xsp/trunk/debian/mono-xsp.dirs	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.dirs	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,7 @@
+usr/bin
+etc/xsp
+etc/xsp/conf.d
+usr/share/dotnet/bin
+usr/share/dotnet/xsp
+
+

Added: xsp/trunk/debian/mono-xsp.files
===================================================================
--- xsp/trunk/debian/mono-xsp.files	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.files	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1 @@
+usr/bin/xsp.exe

Added: xsp/trunk/debian/mono-xsp.init
===================================================================
--- xsp/trunk/debian/mono-xsp.init	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.init	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,131 @@
+#! /bin/sh
+#
+# mono-xsp Start the XSP WebServer, that works just for ASP.NET scripts.
+#
+#		Written by Pablo Fischer <pablo at pablo.com.mx>.
+#		Modified for Debian GNU/Linux
+#
+# Version:	@(#)mono-xsp pablo at pablo.com.mx
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/xsp
+NAME=mono-xsp
+DESC="XSP WebServer"
+DEFAULT=/etc/default/$NAME
+CFGDIR=/etc/xsp
+VIRTUALFILE=$CFGDIR/mono-xsp-hosts.conf
+
+test -x $DAEMON || exit 0
+
+virtual_dirs=`mono-xsp-reader.conf --norestart`
+
+should_start() {
+    if [ -e $DEFAULT ]; then
+        . $DEFAULT
+        if [ "$start_boot" != "true" ]; then
+            echo "$NAME not started as requested"
+            return 1
+        fi
+    fi
+
+    if [ ! -x $DAEMON ]; then
+        echo "$NAME is not executable, not starting"
+        return 1
+    fi
+
+    if [ ! -e $VIRTUALFILE ]; then
+	echo "You dont have $VIRTUALFILE "
+	echo "To have it, you need to install at least one package for xsp (like asp.net-examples)"	
+	return 1
+    fi
+    
+    if [[ $virtual_dirs = *Sorry* ]]; then
+	echo "Sorry, I found a missconfiguration in /etc/xsp/mono-xsp-hosts.conf, fix it, or dpkg-reconfigure mono-xsp/virtualhosts packages"
+	return 1
+    fi
+	
+    if [[ -z $virtual_dirs ]]; then
+        echo "Sorry, I found an empty /etc/xsp/mono-xsp-hosts.conf"
+        return 1
+    fi
+
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running xsp?
+	xsp_pid=`cat /var/run/$NAME`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+	if [ "$xsp_ps" != "1" ]; then
+	    echo "Sorry, there is already a xsp running, stop it first"
+	    return 1		
+	fi
+    fi
+    return 0
+	
+}
+
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running xsp?
+	xsp_pid=`cat /var/run/$NAME`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$xsp_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    else
+	return 0
+    fi
+}
+
+case "$1" in
+    start)
+	if should_start ; then
+	    . $DEFAULT	
+	    echo -n "Starting $DESC: $NAME"
+	    start-stop-daemon --start --background --make-pidfile \
+		--quiet --pidfile /var/run/$NAME \
+		--exec $DAEMON -- \
+		--port $port --applications $virtual_dirs --nonstop
+	    echo "."
+	fi
+	;;
+    stop)
+	if should_stop ; then
+	    echo -n "Stopping $DESC: $NAME "
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    echo "."
+	fi
+	;;
+    restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	
+	if should_stop ; then
+	    echo "Restarting $DESC: $NAME"	
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    sleep 1
+	fi
+	
+	if should_start ; then
+	    . $DEFAULT	
+	    echo "Starting $DESC: $NAME"
+	    start-stop-daemon --start --background --make-pidfile \
+		--quiet --pidfile /var/run/$NAME \
+		--exec $DAEMON -- \
+		--port $port --applications $virtual_dirs --nonstop
+	    echo "."
+	fi
+	;;
+    *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0


Property changes on: xsp/trunk/debian/mono-xsp.init
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.links
===================================================================
--- xsp/trunk/debian/mono-xsp.links	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.links	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,2 @@
+/usr/share/dotnet/xsp/mono-xsp-reader.conf /usr/sbin/mono-xsp-reader.conf
+/usr/share/dotnet/xsp/mono-xsp-update.conf /usr/sbin/mono-xsp-update.conf

Added: xsp/trunk/debian/mono-xsp.postinst
===================================================================
--- xsp/trunk/debian/mono-xsp.postinst	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.postinst	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,126 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+tempfile=`/bin/tempfile`
+xsp_default="/etc/default/mono-xsp"
+NAME=mono-xsp
+DESC="XSP WebServer"
+CFGDIR=/etc/xsp
+VIRTUALFILE=$CFGDIR/mono-xsp-hosts.conf
+virtual_dirs=`mono-xsp-reader.conf`
+
+activate_xsp() {
+    sed s/start_boot=false/start_boot=true/g $xsp_default > $tempfile
+    cp -f $tempfile $xsp_default
+    rm -Rf $tempfile
+
+}
+
+deactivate_xsp() {
+    sed s/start_boot=true/start_boot=false/g $xsp_default > $tempfile
+    cp -f $tempfile $xsp_default
+    rm -Rf $tempfile
+}
+
+enable_8080() {
+    sed s/port=8081/port=8080/g $xsp_default > $tempfile
+    cp -f $tempfile $xsp_default
+    rm -Rf $tempfile
+}
+
+disable_8080() {
+    sed s/port=8080/port=8081/g $xsp_default > $tempfile
+    cp -f $tempfile $xsp_default
+    rm -Rf $tempfile
+}
+
+should_start() {
+    if [ -e $xsp_default ]; then
+	. $xsp_default
+        if [ "$start_boot" != "true" ]; then
+	    return 1
+        fi
+    fi
+    
+    if [ ! -e $VIRTUALFILE ]; then
+	return 1
+    fi
+    
+    if [[ $virtual_dirs = *Sorry* ]]; then
+	return 1
+    fi
+    
+    if [[ -z $virtual_dirs ]]; then
+	return 1
+    fi
+
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running xsp?
+	xsp_pid=`cat /var/run/$NAME`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+	if [ "$xsp_ps" != "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    else
+	return 1
+    fi
+    
+    return 1
+
+}
+
+case "$1" in
+    configure)
+	db_get xsp/xsp_autostart || true
+	if [ "$RET" = "true" ]; then	    
+	    activate_xsp
+	    if [ -x "/etc/init.d/mono-xsp" ]; then
+		update-rc.d mono-xsp defaults >/dev/null
+	    fi
+
+	else
+	    deactivate_xsp
+	fi
+
+	#Check the port 8080, is it available?
+	port_8080=`netstat -ta | grep 'webcache' | wc -l`
+	
+	if [ $port_8080 = "1" ]; then
+	    disable_8080
+	    echo "XSP is going to use the port 8081"
+	else
+	    enable_8080
+	    echo "XSP is going to use the port 8080 (default)"
+	fi
+
+	mono-xsp-update.conf
+	if [ "$RET" = "true" ]; then
+	    if should_start ; then
+		echo "Starting $DESC: $NAME "
+		/etc/init.d/mono-xsp start > /dev/null 2>&1 || true
+	    fi
+	fi
+	;;
+    
+    *)
+	echo "postinst failed \`$1'" >&2
+	exit 0
+	;;
+esac
+
+exit 0
+
+
+	    
+	    
+
+		
+
+    
+


Property changes on: xsp/trunk/debian/mono-xsp.postinst
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.postrm
===================================================================
--- xsp/trunk/debian/mono-xsp.postrm	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.postrm	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+
+xspconfd="/etc/xsp/conf.d/"
+
+case "$1" in
+    purge)
+	rm -Rf "$xspconfd/*"
+	#Purge debconf
+	. /usr/share/debconf/confmodule
+        db_purge
+	#update-rc.d
+	update-rc.d -f mono-xsp remove >/dev/null
+	
+	;;
+    esac
+
+exit 0


Property changes on: xsp/trunk/debian/mono-xsp.postrm
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.preinst
===================================================================
--- xsp/trunk/debian/mono-xsp.preinst	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.preinst	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+NAME=mono-xsp
+DESC="XSP WebServer"
+
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+        # Are we really running xsp?
+	xsp_pid=`cat /var/run/$NAME`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$xsp_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    fi
+    return 0
+}
+
+case "$1" in
+   upgrade|install)
+	if should_stop ; then
+	    echo -n "Stopping $DESC: $NAME "
+	    /etc/init.d/mono-xsp stop > /dev/null 2>&1 || true
+	fi
+	;;
+esac
+
+
+exit 0


Property changes on: xsp/trunk/debian/mono-xsp.preinst
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.prerm
===================================================================
--- xsp/trunk/debian/mono-xsp.prerm	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.prerm	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,34 @@
+#!/bin/sh -e
+
+NAME=mono-xsp
+DESC="XSP WebServer"
+
+#0 : false
+#1 : true
+should_stop() {
+    if [ -f /var/run/$NAME ]; then
+	# Are we really running xsp?
+	xsp_pid=`cat /var/run/$NAME`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+	# Are there any process running by that pid?
+	if [ "$xsp_ps" = "2" ]; then
+	    return 0
+	else
+	    return 1
+	fi
+    fi  
+    return 0
+}
+
+case "$1" in
+    remove)
+	# should we stop the server?
+	if should_stop ; then
+	    echo "Stopping $DESC: $NAME "
+	    /etc/init.d/mono-xsp stop > /dev/null 2>&1 || true
+	fi
+	    ;;
+    esac
+
+exit 0
+


Property changes on: xsp/trunk/debian/mono-xsp.prerm
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/mono-xsp.substvars
===================================================================
--- xsp/trunk/debian/mono-xsp.substvars	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.substvars	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1 @@
+misc:Depends=debconf (>= 0.5) | debconf-2.0

Added: xsp/trunk/debian/mono-xsp.templates
===================================================================
--- xsp/trunk/debian/mono-xsp.templates	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/mono-xsp.templates	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,4 @@
+Template: xsp/xsp_autostart
+Type: boolean
+Default: true
+Description: Would you like to autostart the XSP process when you start your computer?.

Added: xsp/trunk/debian/rules
===================================================================
--- xsp/trunk/debian/rules	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/rules	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,127 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+export DH_COMPAT=3
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+config.status: configure
+	dh_testdir
+	# Add here commands to configure the package.
+	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+
+
+build: build-stamp
+
+build-stamp:  config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#/usr/bin/docbook-to-man debian/xsp.sgml > xsp.1
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp 
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+#ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+#	cp -f /usr/share/misc/config.sub config.sub
+#endif
+#ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+#	cp -f /usr/share/misc/config.guess config.guess
+#endif
+
+
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+	cd server && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+	dh_movefiles
+	# We should follow the MonoConventions
+	# First, for mono-xsp
+	for x in debian/mono-xsp/usr/bin/*.exe ; do ln -sf cli-wrapper $${x%.exe} ; done
+	mv debian/mono-xsp/usr/bin/*.exe debian/mono-xsp/usr/share/dotnet/bin
+	# Now, for mono-server
+	for x in debian/mono-server/usr/bin/*.exe ; do ln -sf cli-wrapper $${x%.exe} ; done
+	mv debian/mono-server/usr/bin/*.exe debian/mono-server/usr/share/dotnet/bin	
+
+binary-arch: build install
+# We have nothing to do by default.
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+#	dh_movefiles 
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+	dh_installdirs
+	dh_install 
+	cd test && cp ServiceClient.exe *.aspx *.ascx *.asmx *.ashx *.config *.asax *.xml *.png *.inc *.xsl *.cs $(CURDIR)/debian/asp.net-examples/usr/share/asp.net-demos/asp
+	cp debian/web.config $(CURDIR)/debian/asp.net-examples/usr/share/asp.net-demos/asp
+	cd test && cp *.dll $(CURDIR)/debian/asp.net-examples/usr/share/asp.net-demos/dll
+	rm -Rf $(CURDIR)/debian/asp.net-examples/usr/share/asp.net-demos/asp/monodoc.ashx
+	chmod -x $(CURDIR)/debian/asp.net-examples/usr/share/asp.net-demos/*/*
+
+	cp $(CURDIR)/debian/mono-xsp-reader.conf debian/mono-xsp/usr/share/dotnet/xsp/
+	cp $(CURDIR)/debian/mono-xsp-update.conf debian/mono-xsp/usr/share/dotnet/xsp/
+
+	cp $(CURDIR)/debian/mono-server-reader.conf $(CURDIR)/debian/mono-server/usr/share/dotnet/monoserver/
+	cp $(CURDIR)/debian/mono-server-update.conf $(CURDIR)/debian/mono-server/usr/share/dotnet/monoserver/
+
+	chmod +x $(CURDIR)/debian/mono-server/usr/share/dotnet/monoserver/*.conf
+	chmod +x $(CURDIR)/debian/mono-xsp/usr/share/dotnet/xsp/*.conf
+
+	#cd $(CURDIR)/debian/mono-server/usr/sbin; ln -s ../share/dotnet/monoserver/*.conf .
+	#cd $(CURDIR)/debian/mono-xsp/usr/sbin; ln -s ../share/dotnet/xsp/*.conf .
+
+#	ln -s $(CURDIR)/debian/mono-server/usr/share/dotnet/monoserver/*.conf $(CURDIR)/debian/mono-server/usr/bin/ 
+#	ln -s $(CURDIR)/debian/mono-xsp/usr/share/dotnet/xsp/*.conf $(CURDIR)/debian/mono-xsp/usr/bin/ 
+
+#	install -m755 debian/asp.net-examples-server-snapshot $(CURDIR)/debian/asp.net-examples-snapshot/usr/bin
+	#cd test && cp *.dll $(CURDIR)/debian/asp.net-examples/usr/lib
+#	dh_install
+#	dh_installmenu
+	dh_installdebconf	
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	if [ -x /usr/bin/dh_installxsp ]; then \
+		dh_installxsp;	\
+	fi;
+	dh_installman doc/xsp.1
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_perl
+#	dh_python
+#	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 


Property changes on: xsp/trunk/debian/rules
___________________________________________________________________
Name: svn:executable
   + *

Added: xsp/trunk/debian/web.config
===================================================================
--- xsp/trunk/debian/web.config	2004-04-21 14:24:07 UTC (rev 619)
+++ xsp/trunk/debian/web.config	2004-04-21 14:47:15 UTC (rev 620)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <configSections>
+	    <sectionGroup name="mono.aspnet">
+		<section name="acceptEncoding" type="Mono.Http.AcceptEncodingSectionHandler, Mono.Http"/>
+	    </sectionGroup>
+    </configSections>
+
+    <system.web>
+        <customErrors mode="Off"/>
+	<webServices>
+		<soapExtensionTypes>
+			<add type="DumpExtension, extensions" priority="0" group="0" />
+			<add type="EncryptExtension, extensions" priority="1" group="0" />
+		</soapExtensionTypes>
+	</webServices>
+	<authentication mode= "Forms">
+	</authentication>
+    	<!--httpModules>
+            <add name="AcceptEncodingModule" type="Mono.Http.AcceptEncodingModule, Mono.Http"/>
+	</httpModules-->
+    </system.web>
+
+    <mono.aspnet>
+        <acceptEncoding>
+	    <!-- Change disabled to 'no' to enable gzip content encoding -->
+	    <add encoding="gzip" type="Mono.Http.GZipWriteFilter, Mono.Http" disabled="no" />
+	</acceptEncoding>
+    </mono.aspnet>
+
+    <appSettings>
+	<add key="MonoServerDefaultIndexFiles"
+	     value="index.aspx, Default.aspx, default.aspx, index.html, index.htm" />
+	<add key="DBProviderAssembly"
+	     value="Mono.Data.PostgreSqlClient"/>
+	<add key="DBConnectionType"
+	     value="Mono.Data.PostgreSqlClient.PgSqlConnection"/>
+	<add key="DBConnectionString"
+	     value="hostaddr=127.0.0.1;user=monotest;password=monotest;dbname=monotest"/>
+    </appSettings>
+</configuration>
+




More information about the Pkg-mono-svn-commits mailing list