diff options
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | debian/changelog | 52 | ||||
-rw-r--r-- | debian/control | 14 | ||||
-rw-r--r-- | debian/copyright | 30 | ||||
-rw-r--r-- | debian/postinst | 7 | ||||
-rw-r--r-- | debian/postrm | 4 | ||||
-rwxr-xr-x | debian/rules | 93 | ||||
-rw-r--r-- | debian/slibconfig | 7 | ||||
-rw-r--r-- | htmlform.txi | 212 | ||||
-rw-r--r-- | obj2str.txi | 17 |
10 files changed, 442 insertions, 5 deletions
@@ -26,7 +26,7 @@ html: $(htmldir)slib_toc.html $(htmldir)slib_toc.html: $(srcdir)slib.texi cd $(htmldir);make slib_toc.html -prefix = /usr/local +prefix = debian/tmp/usr exec_prefix = $(prefix) bindir = $(exec_prefix)/bin libdir = $(exec_prefix)/lib @@ -99,10 +99,11 @@ htmlform.txi: *.scm $(scheme) -rschmooz -e'(schmooz "slib.texi")' info: $(infodir)/slib.info -$(infodir)/slib.info: slib.texi htmlform.txi - makeinfo slib.texi -o $(infodir)/slib.info - install-info $(infodir)/slib.info $(infodir)/dir - -rm $(infodir)/slib.info*.gz + +slib.info: slib.texi htmlform.txi + makeinfo slib.texi -o slib.info +# /usr/sbin/install-info $(infodir)/slib.info $(infodir)/dir +# -rm $(infodir)/slib.info*.gz infoz: $(infodir)/slib.info.gz $(infodir)/slib.info.gz: $(infodir)/slib.info diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..3c6329a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,52 @@ +slib (2c3-3) frozen unstable; urgency=low + + * Fixes #16235. + * Fixes #19943. + * Fixes #20265. + * Fixes #24917. + * Fixes #27389. + + -- David N. Welton <davidw@efn.org> Mon, 9 Nov 1998 21:18:01 -0800 + +slib (2c3-2) frozen unstable; urgency=low + + * Re-uploaded for slink freeze. + + -- David N. Welton <davidw@efn.org> Mon, 2 Nov 1998 21:07:07 -0800 + +slib (2c3-1) unstable; urgency=low + + * New upstream release. + + -- David N. Welton <davidw@efn.org> Mon, 26 Oct 1998 22:14:30 -0800 + +slib (2c0-3) unstable; urgency=low + + * New maintainer. + * slibconfig script to automatically configure guile. + * Fix type in description, closes: Bug#18996 + + -- Jim Pick <jim@jimpick.com> Sun, 8 Mar 1998 23:05:22 -0800 + +slib (2c0-2) unstable; urgency=low + + * Minor fix for debian/rules targets + + -- Rob Browning <rlb@cs.utexas.edu> Fri, 12 Dec 1997 17:35:22 -0600 + +slib (2c0-1) unstable; urgency=low + + * New upstream source + * New maintainer + + -- Rob Browning <rlb@cs.utexas.edu> Fri, 12 Dec 1997 16:49:13 -0600 + +slib (2a6-1) unstable; urgency=low + + * First Debian release. + + -- Karl Sackett <krs@debian.org> Mon, 16 Dec 1996 09:23:46 -0600 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a1211f3 --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: slib +Section: devel +Priority: optional +Maintainer: David N. Welton <davidw@efn.org> +Standards-Version: 2.1.1.2 + +Package: slib +Architecture: all +Description: Portable Scheme library. + SLIB is a portable scheme library meant to provide compatibility and + utility functions for all standard scheme implementations. SLIB + includes initialization files for Chez, ELK 2.1, GAMBIT, MacScheme, + MITScheme, scheme->C, Scheme48, T3.1, and VSCM. SCM also supports + SLIB. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..65247b2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +This is the Debian GNU/Linux prepackaged version of slib. + +This package was put together by Rob Browning <rlb@cs.utexas.edu> +from sources obtained from: + + ftp://swiss-ftp.ai.mit.edu/archive/scm/slib2c0.tar.gz + +For more information see: + + http://www-swiss.ai.mit.edu/~jaffer/SLIB.html + +The source files are all subject to the following copyright: + +; Copyright (C) 1991, 1992, 1993, 1994, 1997 Aubrey Jaffer. +; +;Permission to copy this software, to redistribute it, and to use it +;for any purpose is granted, subject to the following restrictions and +;understandings. +; +;1. Any copy made of this software must include this copyright notice +;in full. +; +;2. I have made no warrantee or representation that the operation of +;this software will be error-free, and I am under no obligation to +;provide any services, by way of maintenance, update, or otherwise. +; +;3. In conjunction with products arising from the use of this +;material, there shall be no use of my name in any advertising, +;promotional, or sales literature without prior written consent in +;each case. diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..b298e51 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +install-info --quiet --section "Development" "Development" \ + --description="The SLIB portable Scheme library" \ + /usr/info/slib.info.gz +# /usr/sbin/slibconfig diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..03e39ad --- /dev/null +++ b/debian/postrm @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +install-info --quiet --remove slib diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7cba850 --- /dev/null +++ b/debian/rules @@ -0,0 +1,93 @@ +#! /usr/bin/make -f +# -*-Makefile-*- + +CC =gcc +CFLAGS =-O2 -g -Wall +LDFLAGS = + +SHELL =/bin/sh +srcdir =. + +INSTALL =/usr/bin/install +INSTALL_DIR =$(INSTALL) -d -m 755 -o root -g root +INSTALL_PROGRAM =$(INSTALL) -m 755 -o root -g root +INSTALL_DATA =$(INSTALL) -m 644 -o root -g root +INSTALL_MAN =$(INSTALL) -m 444 -o root -g root + +build: + $(checkdir) + make + texi2html -monolithic slib.texi + touch build + +clean: + $(checkdir) + -rm slib.html + -rm slib.info* + make clean + -rm -f build + -rm -rf debian/tmp* *~ debian/*~ debian/files debian/substvars + +binary-arch: checkroot + $(checkdir) + +binary-indep: checkroot build + $(checkdir) + -rm -rf debian/tmp* + +# debian/tmp + $(INSTALL_DIR) debian/tmp + $(INSTALL_DIR) debian/tmp/DEBIAN + $(INSTALL_PROGRAM) debian/postinst debian/tmp/DEBIAN + $(INSTALL_PROGRAM) debian/postrm debian/tmp/DEBIAN + +# library + $(INSTALL_DIR) debian/tmp/usr/share/slib + $(INSTALL_DATA) *.scm debian/tmp/usr/share/slib + +# documentation + $(INSTALL_DIR) debian/tmp/usr/doc/slib + $(INSTALL_DATA) debian/copyright debian/tmp/usr/doc/slib + $(INSTALL_DATA) debian/changelog \ + debian/tmp/usr/doc/slib/changelog.Debian + gzip -9v debian/tmp/usr/doc/slib/changelog.Debian + + $(INSTALL_DATA) ChangeLog debian/tmp/usr/doc/slib + gzip -9v debian/tmp/usr/doc/slib/ChangeLog + $(INSTALL_DATA) README debian/tmp/usr/doc/slib + gzip -9v debian/tmp/usr/doc/slib/README + $(INSTALL_DATA) FAQ debian/tmp/usr/doc/slib + gzip -9v debian/tmp/usr/doc/slib/FAQ + $(INSTALL_DATA) slib.html debian/tmp/usr/doc/slib + + $(INSTALL_DIR) debian/tmp/usr/share/slib/init + $(INSTALL_DATA) *.init debian/tmp/usr/share/slib/init + +# info pages + $(INSTALL_DIR) debian/tmp/usr/info + $(INSTALL_DATA) slib.info* debian/tmp/usr/info + gzip -9v debian/tmp/usr/info/* + +# slibconfig + + $(INSTALL_DIR) debian/tmp/usr/sbin + $(INSTALL_PROGRAM) debian/slibconfig debian/tmp/usr/sbin + $(INSTALL_DIR) debian/tmp/usr/man/man8 + (cd debian/tmp/usr/man/man8; \ + ln -s ../man7/undocumented.7.gz slibconfig.8.gz \ + ) + + dpkg-gencontrol + dpkg --build debian/tmp .. + +define checkdir + test -f slib.texi -a -f debian/rules +endef + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: config build clean binary binary-arch binary-indep diff --git a/debian/slibconfig b/debian/slibconfig new file mode 100644 index 0000000..05eee30 --- /dev/null +++ b/debian/slibconfig @@ -0,0 +1,7 @@ +#! /bin/sh + +if [ -d /usr/share/guile -a -x /usr/bin/guile ]; then + (cd /usr/share/guile + guile -c "(use-modules (ice-9 slib)) (require 'new-catalog)" + ) +fi diff --git a/htmlform.txi b/htmlform.txi new file mode 100644 index 0000000..47dceaf --- /dev/null +++ b/htmlform.txi @@ -0,0 +1,212 @@ + + + +@code{(require 'html-form)} + +@defvar *html:output-port* +Procedure names starting with @samp{html:} send their output +to the port @var{*html:output-port*}. @var{*html:output-port*} is initially the current output port. +@end defvar + + + +@defun html:atval txt +Returns a string with character substitutions appropriate to +send @var{txt} as an @dfn{attribute-value}. +@cindex attribute-value +@end defun + + +@defun html:plain txt +Returns a string with character substitutions appropriate to +send @var{txt} as an @dfn{plain-text}. +@cindex plain-text +@end defun + + +@defun html:comment line @dots{} +Writes (using @code{html:printf}) the strings @var{lines} as HTML +comments. +@end defun + + + + + + + + + +@defun html:start-form method action +The symbol @var{method} is either @code{get}, @code{head}, @code{post}, +@code{put}, or @code{delete}. @code{html:start-form} prints the header for an HTML +@dfn{form}. +@cindex form +@end defun + + +@defun html:end-form pname submit-label +@code{html:end-form} prints the footer for an HTML @dfn{form}. The string @var{submit-label} +@cindex form +appears on the button which submits the form. +@end defun + + +@defun html:start-page title +Outputs headers for an HTML page named @var{title}. +@end defun + + +@defun html:end-page +Outputs HTML codes to end a page. +@end defun + + + +@defun command->html rdb command-table command method action +The symbol @var{command-table} names a command table in the @var{rdb} relational +database. + +@code{command->html} writes an HTML-2.0 @dfn{form} for command @var{command} to the +@cindex form +current-output-port. The @samp{SUBMIT} button, which is labeled @var{command}, +invokes the URI @var{action} with method @var{method} with a hidden attribute +@code{*command*} bound to the command symbol submitted. + +An action may invoke a CGI script +(@samp{http://www.my-site.edu/cgi-bin/search.cgi}) or HTTP daemon +(@samp{http://www.my-site.edu:8001}). + +This example demonstrates how to create a HTML-form for the @samp{build} +command. + +@example +(require (in-vicinity (implementation-vicinity) "build.scm")) +(call-with-output-file "buildscm.html" + (lambda (port) + (fluid-let ((*html:output-port* port)) + (html:start-page 'commands) + (command->html + build '*commands* 'build 'post + (or "/cgi-bin/build.cgi" + "http://localhost:8081/buildscm")) + html:end-page))) +@end example +@end defun + + + + + + +@c node HTTP and CGI service, Printing Scheme, HTML Forms, Textual Conversion Packages +@section HTTP and CGI service + +@code{(require 'html-form)} + + +@defun cgi:serve-command rdb command-table +Reads a @samp{"POST"} or @samp{"GET"} query from +@code{(current-input-port)} and executes the encoded command from @var{command-table} +in relational-database @var{rdb}. + +This example puts up a plain-text page in response to a CGI query. + +@example +(display "Content-Type: text/plain") (newline) (newline) +(require 'html-form) +(load (in-vicinity (implementation-vicinity) "build.scm")) +(cgi:serve-command build '*commands*) +@end example +@end defun + + +@defun serve-urlencoded-command rdb command-table urlencoded +Reads attribute-value pairs from @var{urlencoded}, converts them to +parameters and invokes the @var{rdb} command named by the parameter +@code{*command*}. +@end defun + + + +@defvar http:crlf +@end defvar + + + +@defun http:send-status-line status-code reason +@defunx http:send-header alist +@end defun + + + + +@defun http:serve-query input-port output-port serve-proc +reads the @dfn{query-string} from @var{input-port}. If this is a valid +@cindex query-string +@samp{"POST"} or @samp{"GET"} query, then @code{http:serve-query} calls @var{serve-proc} with two +arguments, the query-string and the header-alist. + +Otherwise, @code{http:serve-query} replies (to @var{output-port}) with appropriate HTML describing the +problem. +@end defun + + +This example services HTTP queries from port 8081: + +@example +(define socket (make-stream-socket AF_INET 0)) +(socket:bind socket 8081) +(socket:listen socket 10) +(dynamic-wind + (lambda () #f) + (lambda () + (do ((port (socket:accept socket) + (socket:accept socket))) + (#f) + (dynamic-wind + (lambda () #f) + (lambda () + (fluid-let ((*html:output-port* port)) + (http:serve-query + port port + (lambda (query-string header) + (http:send-header + '(("Content-Type" . "text/plain"))) + (with-output-to-port port + (lambda () + (serve-urlencoded-command + build '*commands* query-string))))))) + (lambda () (close-port port))))) + (lambda () (close-port socket))) +@end example + + +@defun http:read-request-line port +Reads the first non-blank line from @var{port} and, if successful, +returns a list of three itmes from the request-line: + +@enumerate 0 + +@item Method + +Either one of the symbols @code{options}, @code{get}, @code{head}, +@code{post}, @code{put}, @code{delete}, or @code{trace}; Or a string. + +@item Request-URI + +A string. At the minimum, it will be the string @samp{"/"}. + +@item HTTP-Version + +A string. For example, @samp{HTTP/1.0}. +@end enumerate +@end defun + + +@defun cgi:read-query-string +Reads the @dfn{query-string} from @code{(current-input-port)}. +@cindex query-string +@code{cgi:read-query-string} reads a @samp{"POST"} or @samp{"GET"} queries, depending on the +value of @code{(getenv "REQUEST_METHOD")}. +@end defun diff --git a/obj2str.txi b/obj2str.txi new file mode 100644 index 0000000..3ab34dc --- /dev/null +++ b/obj2str.txi @@ -0,0 +1,17 @@ + + + +@defun object->string obj +Returns the textual representation of @var{obj} as a string. +@end defun + + + + + + + +@defun object->limited-string obj limit +Returns the textual representation of @var{obj} as a string of length +at most @var{limit}. +@end defun |