diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..b5d4ad8 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Copyright (c) 2004 Anthony Carrico, Martin Gasbichler diff --git a/INSTALL b/INSTALL index 985eb48..1254a9f 100644 --- a/INSTALL +++ b/INSTALL @@ -6,20 +6,22 @@ The Scheme Untergrund Library requires that scsh is installed on your system. If you don't have it, please obtain and install it before building sunterlib. See the webpage . -CONFIGURING SUNTERLIB +BUILD -Sunterlib does not require configuration at this time. You may want to -adjust the Makefile's "prefix" variable to set the installation -directory. - -BUILDING SUNTERLIB - -Type 'make' to build the package. +If you obtained the source from cvs, type 'make' to build the +package. This is not necessary if you have a tar distribution. INSTALLATION -Type 'make install' to install the package. +As of version 0.6, sunterlib follows Michel Schinz's scsh package +proposal for installation and use. Please see: + scsh/scsh-packages/doc/latex/proposal.tex + +The top-level installation script is install-pkg. It will install all +of the libraries. + +TODO: install-pkg scripts for individual library subdirectories. UNINSTALLATION -Type 'make uninstall' to uninstall the package. +See the packaging proposal for details. diff --git a/Makefile b/Makefile index 41a302f..8f6af51 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,13 @@ SHELL = /bin/sh -prefix = /usr/local -libdir = $(prefix)/lib -docdir = $(prefix)/share/doc -pkglibdir = $(libdir)/sunterlib -pkgdocdir = $(docdir)/sunterlib - -INSTALL = /usr/bin/install -INSTALL_DATA = $(INSTALL) -m 644 - .SUFFIXES: -version := 0.6 +major-version = 0 +minor-version = 6 +version := $(major-version).$(minor-version) + +prefix = /tmp/sunterlib -s48-interfaces := $(shell find s48 \ - -maxdepth 2 -mindepth 2 \ - -name interfaces.scm) -s48-packages := $(shell find s48 \ - -maxdepth 2 -mindepth 2 \ - -name packages.scm) -s48-srcs := $(shell find s48 \ - -mindepth 2 \ - ! -name interfaces.scm \ - ! -name packages.scm \ - -name "*.scm") -s48-docs := $(shell find s48 \ - -mindepth 2 \ - -name README) s48-authors := $(shell find s48 \ -maxdepth 2 -mindepth 2 \ -name AUTHORS) @@ -34,20 +15,6 @@ s48-blurbs := $(shell find s48 \ -maxdepth 2 -mindepth 2 \ -name BLURB) -scsh-interfaces := $(shell find scsh \ - -maxdepth 2 -mindepth 2 \ - -name interfaces.scm) -scsh-packages := $(shell find scsh \ - -maxdepth 2 -mindepth 2 \ - -name packages.scm) -scsh-srcs := $(shell find scsh \ - -mindepth 2 \ - ! -name interfaces.scm \ - ! -name packages.scm \ - -name "*.scm") -scsh-docs := $(shell find scsh \ - -mindepth 2 \ - -name README) scsh-authors := $(shell find scsh \ -maxdepth 2 -mindepth 2 \ -name AUTHORS) @@ -55,83 +22,32 @@ scsh-blurbs := $(shell find scsh \ -maxdepth 2 -mindepth 2 \ -name BLURB) -s48-targets := s48-interfaces.scm s48-packages.scm sunterlib-s48.scm -scsh-targets := interfaces.scm packages.scm sunterlib.scm -targets := $(s48-targets) $(scsh-targets) DETAILS +targets := DETAILS COPYING pkg-def.scm -.PHONY: all s48 scsh -all : s48 scsh DETAILS -s48 : $(s48-targets) -scsh : $(scsh-targets) +.PHONY: all +all : $(targets) -s48-interfaces.scm : $(s48-interfaces) build/header.scm - cat build/header.scm > s48-interfaces.scm - for interface in $(s48-interfaces) ; \ - do \ - cat $${interface} >> s48-interfaces.scm ; \ - done - -s48-packages.scm : $(s48-packages) build/header.scm - build/xpackages.scm s48-packages.scm build/header.scm $(s48-packages) - -interfaces.scm : $(s48-interfaces) $(scsh-interfaces) build/header.scm - cat build/header.scm > interfaces.scm - for interface in $(s48-interfaces) $(scsh-interfaces) ; \ - do \ - cat $${interface} >> interfaces.scm ; \ - done - -packages.scm : $(s48-packages) $(scsh-packages) build/header.scm - build/xpackages.scm packages.scm build/header.scm $(s48-packages) $(scsh-packages) - -sunterlib-s48.scm : s48-interfaces.scm s48-packages.scm - cat s48-interfaces.scm s48-packages.scm > sunterlib-s48.scm - -sunterlib.scm : interfaces.scm packages.scm - cat interfaces.scm packages.scm > sunterlib.scm - -DETAILS : $(s48-authors) $(s48-blurbs) $(scsh-authors) $(scsh-blurbs) +DETAILS : $(s48-authors) $(s48-blurbs) $(scsh-authors) $(scsh-blurbs) \ + build/details.scm build/dirs.scm build/header.scm build/details.scm +COPYING : $(s48-authors) $(scsh-authors) \ + build/copying.scm build/common.scm build/header.scm build/dirs.scm + build/copying.scm + +pkg-def.scm : $(s48-authors) $(scsh-authors) \ + build/make-pkg-def.scm build/common.scm build/header.scm \ + build/dirs.scm + build/make-pkg-def.scm $(major-version) $(minor-version) + .PHONY : install uninstall -install : s48 scsh DETAILS - $(INSTALL) -d $(pkglibdir) - $(INSTALL_DATA) s48-interfaces.scm s48-packages.scm sunterlib-s48.scm $(pkglibdir) - $(INSTALL_DATA) interfaces.scm packages.scm sunterlib.scm $(pkglibdir) - $(INSTALL) -d $(pkgdocdir) - $(INSTALL_DATA) README $(pkgdocdir) - $(INSTALL_DATA) COPYING $(pkgdocdir) - $(INSTALL_DATA) DETAILS $(pkgdocdir) - for s48src in $(s48-srcs); \ - do \ - $(INSTALL) -d $(pkglibdir)/`dirname $${s48src}`; \ - $(INSTALL_DATA) $${s48src} $(pkglibdir)/$${s48src}; \ - done - for s48doc in $(s48-docs); \ - do \ - $(INSTALL) -d $(pkgdocdir)/`dirname $${s48doc}`; \ - $(INSTALL_DATA) $${s48doc} $(pkgdocdir)/$${s48doc}; \ - done - for scshsrc in $(scsh-srcs); \ - do \ - $(INSTALL) -d $(pkglibdir)/`dirname $${scshsrc}`; \ - $(INSTALL_DATA) $${scshsrc} $(pkglibdir)/$${scshsrc}; \ - done - for scshdoc in $(scsh-docs); \ - do \ - $(INSTALL) -d $(pkgdocdir)/`dirname $${scshdoc}`; \ - $(INSTALL_DATA) $${scshdoc} $(pkgdocdir)/$${scshdoc}; \ - done - -uninstall : - -rm -rf $(pkglibdir) $(pkgdocdir) - +install : $(targets) + ./install-pkg --prefix $(prefix) .PHONY : dist -dist : +dist : targets mkdir sunterlib-$(version) - cp COPYING INSTALL Makefile NEWS README README.admin README.contrib sunterlib-$(version)/ - cp -r build sunterlib-$(version)/build + cp pkg-def.scm COPYING INSTALL NEWS README README.admin README.contrib sunterlib-$(version)/ cp -r s48 sunterlib-$(version)/s48 cp -r scsh sunterlib-$(version)/scsh find sunterlib-$(version)/ -name CVS | xargs rm -rf diff --git a/NEWS b/NEWS index ec3eaf3..0a2469a 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,17 @@ version 0.6 +* COPYING is now autogenerated. +* Libraries now have their own version numbers. +* Libraries now have their own NEWS. +* AUTHORS files now must contain copyrights. +* New package system + * interfaces.scm + packages.scm -> load.scm + * add pkg-def.scm +* New scsh library: scsh-packages * New s48 library: mini-profiler * New s48 library: reinitializer * New scsh libraries: file-mode * New s48 libraries: SRFI-34/SRFI-35 exceptions and conditions, SRFI-10 - version 0.5 2003-11-19 * New s48 libraries: procedure-tables. * New scsh libraries: tiff. diff --git a/README b/README index 894a7b0..9347081 100644 --- a/README +++ b/README @@ -1,40 +1,15 @@ Scheme Untergrund Library The Scheme Untergrund Library hosts contributed code for Scheme48 and -Scsh. In addition to acting as host, the project provides a -centralized way to access these packages from the languages' module -system. +Scsh. Sunterlib is hosted at Savannah: http://savannah.nongnu.org/projects/sunterlib/ -USE +INSTALLATION AND USE -To use sunterlib, first make sure the library is installed (see -INSTALL). - -After installation, the library is available in - /usr/local/lib/sunterlib, -and the documentation is available in - /usr/local/share/doc/sunterlib -(or the corresponding subdirectories of the prefix used for -installation). - -The file "sunterlib.scm" is the full sunterlib interface for use with -scsh ("sunterlib.scm" is composed of the deprecated "interfaces.scm" -and "packages.scm"). - -The file "sunterlib-s48.scm" is the sunterlib subset interface for use -with scheme48 ("sunterlib-s48.scm" is composed of the deprecated -"s48-interfaces.scm" and "s48-packages.scm"). - -A typical scsh script might start like this: - -#!/usr/local/bin/scsh \ --lm /usr/local/lib/sunterlib/sunterlib.scm -o foo -s -!# - -where "foo" is a sunterlib package needed by your script. +As of version 0.6, sunterlib follows Michel Schinz's scsh package +proposal for installation and use. Please see INSTALL for details. BUGS diff --git a/README.admin b/README.admin index bb1d555..195d657 100644 --- a/README.admin +++ b/README.admin @@ -1,6 +1,7 @@ How to make a release: -1. Make sure NEWS is up-to-date (at least add the distribution date). +1. Make sure the NEWS files are up-to-date (at least add the + distribution date). 2. Check out a clean source tree from cvs. 3. Make the distribution: make dist @@ -10,4 +11,4 @@ How to make a release: 6. Post the release: scp sunterlib-0.1.tar.gz subversions.gnu.org:/upload/sunterlib/release.pkg/0.1/ 7. Increment the version number in Makefile. -8. Start a new version entry in NEWS. +8. Start a new version entry in the top level NEWS file. diff --git a/README.contrib b/README.contrib index 52aea95..12d6ec9 100644 --- a/README.contrib +++ b/README.contrib @@ -3,26 +3,38 @@ GUIDLINES FOR CONTRIBUTORS ADDING A NEW LIBRARY 0. This library only accepts code with the modified bsd license in the -file COPYING. Add your name to the file COPYING. +(generated) file COPYING. 1. Create a new subdirectory of s48 or scsh for your library. Only touch files in your library's tree. 2. Your library's tree should have at least these files: - AUTHORS -- a list of your library's authors. + AUTHORS -- (CHANGED in Sunterlib 0.6) a list of your library's + copyright(s), keep the year up to date if you make changes to your + library. BLURB -- a one or two line description of your library. It should - start with the name of your library's directory followed by a colon. - README -- a text file documenting your library. - interfaces.scm -- the interfaces defined by your library. - packages.scm -- the packages defined by your library. + start with the name of your library's directory followed by a + colon. + NEWS -- (NEW in Sunterlib 0.6) each contributed library has + its own version number. Start with whatever version + number is appropriate for your library. To avoid releasing + different versions under the same number, if the Sunterlib version + has changed, then bump the local version number before changing + your library. Remember to keep the local NEWS file up to date with + your library. Remember to keep the version number up to date with + your package definition. + pkg-def.scm -- (NEW in Sunterlib 0.6) the package definition for + your library. Use the COPYING procedure to generate the COPYING + file. For an example, see s48/args-fold/pkg-def.scm + load.scm -- (WAS interfaces.scm, packages.scm before Sunterlib 0.6) + the interfaces and packages defined by your library. -Our administration and the build systems depends on these files. +Our administration and the build systems depends on those files. -3. Currently, the install script only installs ".scm" source files and -README documentation files. + README -- a text file documenting your library. Recomended -4. Add an entry for your library to the NEWS file in the top-level - directory of Sunterlib. +3. Add an entry for your library to the NEWS file in the top-level +directory of Sunterlib. CONVENTIONS diff --git a/COPYING b/build/common.scm similarity index 70% rename from COPYING rename to build/common.scm index 55c2beb..5724d7d 100644 --- a/COPYING +++ b/build/common.scm @@ -1,11 +1,9 @@ -Copyright (c) 2003 Anthony Carrico, Martin Gasbichler -Copyright (c) 2003 Eric Knauel, Matthias Neubauer -Copyright (c) 2003 RT Happe -Copyright (c) 2003 Taylor Campbell -Copyright (c) 2003 Michel Schinz -Copyright (c) 2003 Oleg Kiselyov -Copyright (c) 2003 Mike Sperber +;;; This file is part of the Scheme Untergrund Library. For copyright +;;; information, see the file COPYING which comes with the +;;; distribution. +(define license + " All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,3 +27,23 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +") + +(define port->string + (lambda (port) + (let loop ((result "")) + (let ((chunk (read-string 1024 port))) + (if chunk + (loop (string-append result chunk)) + result))))) + +(define get-copyrights + (lambda () + (call-with-input-file + "AUTHORS" + (lambda (port) + (port->string port))))) + +(define COPYING + (lambda () + (string-append (get-copyrights) license))) diff --git a/build/copying.scm b/build/copying.scm new file mode 100755 index 0000000..5d52400 --- /dev/null +++ b/build/copying.scm @@ -0,0 +1,28 @@ +#! /bin/sh +exec scsh -o filenames -s "$0" "$@" +!# + +;;; This file is part of the Scheme Untergrund Library. For copyright +;;; information, see the file COPYING which comes with the +;;; distribution. + +(load "build/common.scm") +(load "build/dirs.scm") + +;; Create the COPYING file from the AUTHORS files. +(define sunterlib-COPYING + (lambda () + (string-append + (call-with-input-file "build/header.scm" port->string) + (apply + string-append + (delete-duplicates + (cons (get-copyrights) + (map (lambda (dir) + (with-cwd dir (get-copyrights))) + (append s48-dirs scsh-dirs))))) + license))) + +(with-current-output-port + (open-output-file "COPYING") + (display (sunterlib-COPYING))) diff --git a/build/details.scm b/build/details.scm index ea498c6..8e0aec5 100755 --- a/build/details.scm +++ b/build/details.scm @@ -2,28 +2,11 @@ exec scsh -o filenames -s "$0" "$@" !# -;;; details.scm -;;; -;;; This file is part of the Scheme Untergrund Library. +;;; This file is part of the Scheme Untergrund Library. For copyright +;;; information, see the file COPYING which comes with the +;;; distribution. -;;; Copyright (c) 2003 by Anthony Carrico -;;; For copyright information, see the file COPYING which comes with -;;; the distribution. - -(define s48-dirs - (run/strings (find s48 - -maxdepth 1 - -mindepth 1 - -type d - ! -name CVS - ! -name rt-modules))) - -(define scsh-dirs - (run/strings (find scsh - -maxdepth 1 - -mindepth 1 - -type d - ! -name CVS))) +(load "build/dirs.scm") (define entry (lambda (dir) @@ -36,7 +19,6 @@ exec scsh -o filenames -s "$0" "$@" (begin (write-char ch) (loop)))))) - (display "Authors: ") (with-current-input-port (open-input-file (string-append dir "/AUTHORS")) (let loop () @@ -51,6 +33,7 @@ exec scsh -o filenames -s "$0" "$@" ;; Create the details file from the AUTHORS and BLURB files. (with-current-output-port (open-output-file "DETAILS") + (display (call-with-input-file "build/header.scm" port->string)) (display "S48 LIBRARIES\n\n") (for-each entry s48-dirs) (display "SCSH LIBRARIES\n\n") diff --git a/build/dirs.scm b/build/dirs.scm new file mode 100644 index 0000000..2cf6a94 --- /dev/null +++ b/build/dirs.scm @@ -0,0 +1,18 @@ +;;; This file is part of the Scheme Untergrund Library. For copyright +;;; information, see the file COPYING which comes with the +;;; distribution. + +(define s48-dirs + (run/strings (find s48 + -maxdepth 1 + -mindepth 1 + -type d + ! -name CVS + ! -name rt-modules))) + +(define scsh-dirs + (run/strings (find scsh + -maxdepth 1 + -mindepth 1 + -type d + ! -name CVS))) diff --git a/build/make-pkg-def.scm b/build/make-pkg-def.scm new file mode 100755 index 0000000..2ec04ff --- /dev/null +++ b/build/make-pkg-def.scm @@ -0,0 +1,35 @@ +#! /bin/sh +exec scsh -o filenames -s "$0" "$@" +!# + +;;; This file is part of the Scheme Untergrund Library. For copyright +;;; information, see the file COPYING which comes with the +;;; distribution. + +(load "build/common.scm") +(load "build/dirs.scm") + +(define version (map string->number command-line-arguments)) + +(define entry + (lambda (dir) + (display "(load-package-in \"") + (display dir) + (display "\")\n"))) + +(with-current-output-port + (open-output-file "pkg-def.scm") + (display (call-with-input-file "build/header.scm" port->string)) + (display (call-with-input-file "build/common.scm" port->string)) + (display "\n(define-package \"sunterlib\"\n ") + (display version) + (display "\n () + (install-file \"COPYING\" 'doc) + (install-file \"DETAILS\" 'doc) + (install-file \"NEWS\" 'doc) + (install-file \"README\" 'doc) + (install-file \"README.contrib\" 'doc))\n") + (display "\n;; S48 LIBRARIES\n\n") + (for-each entry s48-dirs) + (display "\n;; SCSH LIBRARIES\n\n") + (for-each entry scsh-dirs)) diff --git a/build/xpackages.scm b/build/xpackages.scm deleted file mode 100755 index 4ecdd8a..0000000 --- a/build/xpackages.scm +++ /dev/null @@ -1,101 +0,0 @@ -#! /bin/sh -exec scsh -o filenames -o pp -s "$0" "$@" -!# - -;;; xpackages.scm -;;; -;;; Copyright (c) 2003 Anthony Carrico -;;; -;;; All rights reserved. -;;; -;;; Redistribution and use in source and binary forms, with or without -;;; modification, are permitted provided that the following conditions -;;; are met: -;;; 1. Redistributions of source code must retain the above copyright -;;; notice, this list of conditions and the following disclaimer. -;;; 2. Redistributions in binary form must reproduce the above copyright -;;; notice, this list of conditions and the following disclaimer in the -;;; documentation and/or other materials provided with the distribution. -;;; 3. The name of the authors may not be used to endorse or promote products -;;; derived from this software without specific prior written permission. -;;; -;;; THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR -;;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -;;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -;;; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, -;;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -;;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(define copy-header - (lambda (header) - (with-current-input-port - (open-input-file header) - (let loop () - (let ((ch (read-char))) - (if (eof-object? ch) - (values) - (begin - (write-char ch) - (loop)))))))) - -(define process-source - (lambda (source) - (let* ((directory (file-name-directory source)) - (massage-file-spec - (lambda (file-spec) - ;; Uses "namestring" from the "filenames" structure to - ;; process the file-specs, this is the same procedure - ;; used by the module system. - (namestring file-spec directory "scm"))) - (massage-clause - (lambda (clause) - (if (not (and (pair? clause) (eq? 'files (car clause)))) - clause - (cons (car clause) - (map massage-file-spec (cdr clause))))))) - (with-current-input-port - (open-input-file source) - (let loop ((form (read))) - (cond ((eof-object? form) - (values)) - ((pair? form) - (p - (let ((op (car form)) - (rest (cdr form))) - (case op - ((define-structure define-structures) - (if (pair? rest) - (let* ((interface (car rest)) - (clauses (cdr rest))) - (cons op - (cons interface - (map massage-clause clauses)))))) - ((define-interface) - form) - ((define-syntax) - ;; ISSUE: what does define-syntax mean in the - ;; configuration language? - (error "unexpected form in packages" source form)) - (else - (error "unexpected form in packages" source form))))) - (newline) - (loop (read))) - (else - (error "unexpected form in packages" source form)))))))) - -(define xpackages - ;; Copy the header and each source file to the target file, adding - ;; the source directory to each package's file-specs. - (lambda (target header sources) - (with-current-output-port - (open-output-file target) - (copy-header header) - (for-each process-source sources)))) - -(xpackages (car command-line-arguments) - (cadr command-line-arguments) - (cddr command-line-arguments)) diff --git a/install-pkg b/install-pkg new file mode 100755 index 0000000..99a1956 --- /dev/null +++ b/install-pkg @@ -0,0 +1,3 @@ +#!/bin/sh +exec scsh -lm scsh/scsh-packages/scheme/install-lib/configure.scm -lm scsh/scsh-packages/scheme/install-lib/install-lib-module.scm -o pp -o configure -o install -e install-main -s "$0" "$@" +!# diff --git a/scsh/scsh-packages/pkg-def.scm b/scsh/scsh-packages/pkg-def.scm index 1d1c1b5..055652a 100644 --- a/scsh/scsh-packages/pkg-def.scm +++ b/scsh/scsh-packages/pkg-def.scm @@ -1,8 +1,8 @@ (define-package "scsh-packages" (0 0) () - (install-file "load.scm" 'base) - (install-file "README" 'doc) + ; (install-file "load.scm" 'base) + ; (install-file "README" 'doc) (install-file "NEWS" 'doc) (install-string (COPYING) "COPYING" 'doc) (install-file "scheme/install-lib/configure.scm" 'scheme)