--- xavante-2.0.1.orig/debian/localhost.lua +++ xavante-2.0.1/debian/localhost.lua @@ -0,0 +1,54 @@ +-- This is a sample virtual host + +-- Define here where Xavante HTTP documents scripts are located +-- +local webDir = '/usr/share/doc/xavante/' + +local simplerules = { + + { -- URI remapping example + -- here / -> /README + -- + match = "^[^%./]*/$", + with = xavante.redirecthandler, + params = {"README"} + }, + + { -- filehandler example + -- /README -> webDir/README + -- + match = ".", + with = xavante.filehandler, + params = {baseDir = webDir} + }, + + -- { -- This is the WSAPI launcher, it automatically wraps each WSAPI + -- -- app in a (reused) ring + -- -- remember to require 'wsapi.xavante' + -- -- + -- match = { "%.ws$", "%.ws/"}, + -- with = wsapi.xavante.makeGenericHandler(webDir) + -- }, + + -- { -- This is a cgilua handler example + -- -- remember to require 'xavante.cgiluahandler' + -- -- + -- match = {"%.lp$", "%.lp/.*$", "%.lua$", "%.lua/.*$" }, + -- with = xavante.cgiluahandler.makeHandler (webDir) + -- }, + + -- { -- This is an orbit example + -- -- remember to require 'orbit.ophandler' + -- -- + -- match = {"%.op$", "%.op/.*$" }, + -- with = orbit.ophandler.makeHandler (webDir) + -- }, + +} + +-- add your vhost rules to the virtualhosts map +-- +config.virtualhosts["localhost:8080"] = { + rules = simplerules, +} + --- xavante-2.0.1.orig/debian/xavante.preinst +++ xavante-2.0.1/debian/xavante.preinst @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +# Remove a no-longer used conffile +rm_conffile() { + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi + fi +} + +case "$1" in +install|upgrade) + if dpkg --compare-versions "$2" le "2.0.0~cvs20080120-1"; then + rm_conffile xavante /etc/xavante/config.lua + rm_conffile xavante /etc/xavante/xavante_init.lua + fi +esac + +#DEBHELPER# --- xavante-2.0.1.orig/debian/watch +++ xavante-2.0.1/debian/watch @@ -0,0 +1,5 @@ +# test this watch file using: +# uscan --watchfile debian/watch --upstream-version 0.0.1 --package xavante +# +version=3 +http://luaforge.net/frs/?group_id=6 /frs/download.php/\d+/xavante-([\d\.]*).tar.gz --- xavante-2.0.1.orig/debian/control +++ xavante-2.0.1/debian/control @@ -0,0 +1,30 @@ +Source: xavante +Section: net +Priority: optional +Maintainer: Enrico Tassi +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), dpatch +Standards-Version: 3.8.1 +Vcs-Svn: svn://svn.debian.org/pkg-lua/packages/xavante +Vcs-Browser: http://svn.debian.org/viewsvn/pkg-lua/packages/xavante +Homepage: http://www.keplerproject.org/xavante/ + +Package: xavante +Architecture: all +Depends: ${shlibs:Depends}, liblua5.1-socket2, liblua5.1-copas0, liblua5.1-coxpcall0, liblua5.1-filesystem0, ${misc:Depends} +Recommends: liblua5.1-wsapi1, liblua5.1-cgi0 +Description: Lua HTTP 1.1 Web server + This package contains xavante, a Lua HTTP 1.1 Web server that uses a modular + architecture based on URI mapped handlers. Xavante currently offers a file + handler, a redirect handler and a CGILua handler. Those are used for general + files, URI remapping and CGILua scripts respectively. + . + The CGILua handler is considered optional thus xavante just recommends the + packages needed for that handler. + +Package: xavante-doc +Architecture: all +Depends: ${misc:Depends} +Recommends: xavante +Section: doc +Description: Documentation files for the Xavante web server + This package contains the documentation for the Xavante web server. --- xavante-2.0.1.orig/debian/xavante.init +++ xavante-2.0.1/debian/xavante.init @@ -0,0 +1,97 @@ +#!/bin/bash + +### BEGIN INIT INFO +# Provides: xavante +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts the xavante httpd daemon. +# Description: Starts xavante, a lightweight web server +# written in lua +### END INIT INFO + +# lsb functions, to use those ugly colors.. +. /lib/lsb/init-functions + +### some default values ### + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/bin/lua5.1 +PIDFILE=/var/run/xavante.pid + +DESC="xavante web server" + +### /etc/default/ loading ### + +if [ -f /etc/default/xavante ] ; then + . /etc/default/xavante +fi + +if [ -z "$RUN_XAVANTE" ] ; then + exit 0 +fi + +test -x $DAEMON || exit 0 + +set -e + +sites="" +for X in /etc/xavante/sites-enabled/*.lua; do + sites="$sites `basename $X .lua`" +done + +### helpers ### + +start_xavante () { + log_daemon_msg "Starting $DESC" "$sites" + start-stop-daemon --start -b --quiet -m -p $PIDFILE -c www-data:www-data\ + --exec $DAEMON -- /etc/xavante/xavante_start.lua + log_end_msg $? +} + +stop_xavante () { + if [ -e $PIDFILE ]; then + log_daemon_msg "Stopping $DESC" "$sites" + start-stop-daemon --stop --quiet -p $PIDFILE || true + log_end_msg $? + rm $PIDFILE + fi +} + +status_xavante () { + P=`cat $PIDFILE` + N=`ps -e | grep "^ *$P " | grep $DAEMON | wc -l` + if [ $N > 0 ]; then + echo "xavante is running with pid $P." + else + echo "xavante is dead." + fi +} + +### real code ### + +case "$1" in + start) + start_xavante + ;; + stop) + stop_xavante + ;; + restart|force-reload) + stop_xavante + sleep 1 + start_xavante + ;; + status) + status_xavante + ;; + *) + N=/etc/init.d/xavante + echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 --- xavante-2.0.1.orig/debian/copyright +++ xavante-2.0.1/debian/copyright @@ -0,0 +1,32 @@ +This package was debianized by Enrico Tassi +Thu Jul 29 15:05:45 CEST 2007. + +It was downloaded from http://luaforge.net/projects/xavante/. + + +Copyright © 2003-2007 The Kepler Project. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +The software includes in the file sajax.lua a javascript snippet: + +Copyright © 2005 modernmethod, inc. + +Released under BSD license: see /usr/share/common-licenses/BSD --- xavante-2.0.1.orig/debian/xavante_start.lua +++ xavante-2.0.1/debian/xavante_start.lua @@ -0,0 +1,42 @@ +-- Some standard includes used by xavante +-- +require "xavante" +require "xavante.filehandler" +require "xavante.redirecthandler" + +-- xavante only recommends cgilua, thus this handler in not required by default +-- +-- require "xavante.cgiluahandler" + +-- To list the configuration files +-- +require "lfs" +local conf_dir = "/etc/xavante/sites-enabled/" + +-- This is the configuration table, virtual hsots should +-- fill it with rules (see the sample localhost.lua) +config = { + server = {host = "*", port = 8080}, + defaultHost = {}, + virtualhosts = {}, +} + +-- load all configuration files +for f in lfs.dir(conf_dir) do + if string.match(f,"\.lua$") then + local rc, err = pcall(dofile,conf_dir..f) + if not rc then + print('Error loading '..conf_dir..f..': '..tostring(err)) + end + end +end + +-- we also set the default host to localhost +config.defaultHost = config.virtualhosts["localhost:8080"] + +-- load the configuration table +xavante.HTTP(config) + +-- run xavante +xavante.start() + --- xavante-2.0.1.orig/debian/changelog +++ xavante-2.0.1/debian/changelog @@ -0,0 +1,26 @@ +xavante (2.0.1-1) unstable; urgency=low + + * new bugfix upstream release + * bumped standards-version to 3.8.1 + * depend on wsapi 1.1 + * added -e in preinst + + -- Enrico Tassi Tue, 24 Mar 2009 10:12:30 +0100 + +xavante (2.0.0-1) unstable; urgency=low + + * new upstream release + + -- Enrico Tassi Sat, 24 May 2008 11:16:56 +0200 + +xavante (2.0~rc1-1) unstable; urgency=low + + * New upstream major release candidate + + -- Enrico Tassi Thu, 17 Apr 2008 10:09:39 +0200 + +xavante (1.3.2~20070929-1) unstable; urgency=low + + * Initial release. (Closes: #444607) + + -- Enrico Tassi Wed, 12 Sep 2007 12:10:28 +0100 --- xavante-2.0.1.orig/debian/xavante.install +++ xavante-2.0.1/debian/xavante.install @@ -0,0 +1,3 @@ +etc/xavante/* +etc/default/* +usr/share/lua/5.1/* --- xavante-2.0.1.orig/debian/rules +++ xavante-2.0.1/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/dpatch.mk + +DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(DEB_DESTDIR) +DEB_DH_INSTALL_SOURCEDIR := $(DEB_DESTDIR) + +install/xavante:: + # move xavante init file inside the xavante dir and link it to init.lua + mv $(DEB_DESTDIR)/usr/share/lua/5.1/xavante.lua $(DEB_DESTDIR)/usr/share/lua/5.1/xavante/ + cd $(DEB_DESTDIR)/usr/share/lua/5.1/xavante/; ln -s xavante.lua init.lua + + # config file + mkdir -p $(DEB_DESTDIR)/etc/xavante/sites-available + mkdir -p $(DEB_DESTDIR)/etc/xavante/sites-enabled + cp debian/localhost.lua $(DEB_DESTDIR)/etc/xavante/sites-available + cd $(DEB_DESTDIR)/etc/xavante/sites-enabled; ln -s ../sites-available/* . + cp debian/xavante_start.lua $(DEB_DESTDIR)/etc/xavante/xavante_start.lua + + # start + mkdir -p $(DEB_DESTDIR)/etc/default/ + echo "RUN_XAVANTE=" > $(DEB_DESTDIR)/etc/default/xavante --- xavante-2.0.1.orig/debian/xavante-doc.docs +++ xavante-2.0.1/debian/xavante-doc.docs @@ -0,0 +1 @@ +doc/ --- xavante-2.0.1.orig/debian/patches/00list +++ xavante-2.0.1/debian/patches/00list @@ -0,0 +1 @@ +config.dpatch --- xavante-2.0.1.orig/debian/patches/config.dpatch +++ xavante-2.0.1/debian/patches/config.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## config.dpatch by Enrico Tassi +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: add DESTDIR variable + +@DPATCH@ +diff -urNad trunk~/config trunk/config +--- trunk~/config 2007-11-17 15:15:23.000000000 +0100 ++++ trunk/config 2008-01-20 17:41:28.000000000 +0100 +@@ -1,7 +1,7 @@ + # $Id: config,v 1.16 2007/11/17 14:15:23 carregal Exp $ + + # Default prefix +-PREFIX = /usr/local ++PREFIX = $(DESTDIR)/usr/ + + # System's libraries directory (where binary libraries are installed) + LUA_LIBDIR= $(PREFIX)/lib/lua/5.1 +@@ -10,4 +10,4 @@ + LUA_DIR= $(PREFIX)/share/lua/5.1 + + # Complete path to Lua command line interpreter +-LUA_INTERPRETER= $(PREFIX)/bin/lua +\ No newline at end of file ++LUA_INTERPRETER= $(PREFIX)/bin/lua5.1 --- xavante-2.0.1.orig/debian/patches/00dpatch.conf +++ xavante-2.0.1/debian/patches/00dpatch.conf @@ -0,0 +1,2 @@ +conf_debianonly=1 +conf_origtargzpath=../tarballs/