Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 scheme2c (2011.07.26-5) unstable; urgency=low
 .
   * include missing xlib .sch files used by, e.g., QobiScheme
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- scheme2c-2011.07.26.orig/README
+++ scheme2c-2011.07.26/README
@@ -170,7 +170,7 @@ running ULTRIX.
     such as ~/bin:
 
 	8 >cd ..
-	9 >make "DESTDIR = /udir/`whoami`/bin" install-private
+	9 >make prefix=$HOME/s2c BINDIR=. LIBDIR=. LIBSUBDIR=. install
 	10 >rehash
 
     Given that this directory in the current search path, the compiler can
--- scheme2c-2011.07.26.orig/CHANGES
+++ scheme2c-2011.07.26/CHANGES
@@ -64,7 +64,7 @@ Compiler changes since the 01nov91jfb re
 	  (set! bar 4) )
 
     containging let's whose only purpose is to introduce a new lexical scope
-    are now correctly compiled when the appear at the top level.
+    are now correctly compiled when they appear at the top level.
 
 7.  Lambda expressions containing arguments that are not symbols now result
     in an error message rather than a compiler error.
--- /dev/null
+++ scheme2c-2011.07.26/INSTALL
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# QUICK BUILD/INSTALLATION GUIDE
+
+# Quick instructions for building s2c on Debian amd64, including the
+# X11-enabled libraries etc.  All lines including "-C doc" can be
+# omitted to skip the manuals.  Switch AMD64 to LINUX (for i386) or ARM
+# (for arm).  Change prefix to /usr or /home/username, and other
+# locations, as appropriate.
+
+# required development libraries: libsigsegv-dev, libx11-dev
+
+# required to build documentation:
+# 	texlive-latex-base, texlive-latex-extra, latex209-bin,
+# 	texlive-fonts-recommended, ghostscript
+
+# In the root of the unpacked sources run:
+
+set -e
+set -x
+
+A=AMD64
+P="prefix=/usr/local MANDIR=\$(prefix)/share/man DOCDIR=\$(prefix)/share/doc/scheme2c"
+D=~/tmp/s2c
+I="$P DESTDIR=$D"
+T=~/tmp/scheme2c-binary.tar.gz
+MAKE=make
+
+${MAKE} $P for$A
+${MAKE} $P -C $A
+${MAKE} $P -C $A/cdecl all
+${MAKE} $P -C $A/xlib sizeof.cdecl libs2cxl.a s2cixl
+${MAKE} $P -C doc
+
+${MAKE} $I -C $A/scrt  install
+${MAKE} $I -C $A/scsc  install
+${MAKE} $I -C $A/cdecl install
+${MAKE} $I -C $A/xlib  install
+${MAKE} $I -C doc      install
+
+tar -zcf $T -C $D .
+
+# The result is a tarball which can be installed with, e.g.,
+
+# sudo tar -C / -zxf $T
--- scheme2c-2011.07.26.orig/cdecl/makefile
+++ scheme2c-2011.07.26/cdecl/makefile
@@ -19,7 +19,7 @@ MISC = sizeof.c sch.sc README document l
 
 SRCDIR = ../../cdecl
 
-SCC = ../scsc/s2cc
+SCC = ../scsc/Xs2cc
 
 .sc.c:
 	${SCC} -C $*.sc
--- scheme2c-2011.07.26.orig/doc/embedded.tex
+++ scheme2c-2011.07.26/doc/embedded.tex
@@ -150,11 +150,11 @@ application. The current time slice valu
 \subsection*{Sample embedded application}
 
 A sample embedded Scheme application, \texttt{embedded}, is found in
-the directory \texttt{server}.  A typescript of its execution shows
+the directory \texttt{scrt}.  A typescript of its execution shows
 how an application should interact with an embedded Scheme system.
 \begin{quote}
 \begin{verbatim}
-csh 990 >embedded
+$ embedded
 Embedded Scheme->C Test Bed
 0- (+ 1 2)
 3
--- scheme2c-2011.07.26.orig/doc/smithnotes.tex
+++ scheme2c-2011.07.26/doc/smithnotes.tex
@@ -62,7 +62,7 @@ is executed, the window looks like this:
 
 \begin{quote}
 \begin{verbatim}
-csh >s2ci
+$ s2ci
 Scheme->C -- 01sep91jfb -- Copyright 1989 Digital Equipment Corporation
 >
 \end{verbatim}
--- scheme2c-2011.07.26.orig/doc/s2cc.l
+++ scheme2c-2011.07.26/doc/s2cc.l
@@ -149,7 +149,7 @@ error file.
 .br
 /.../libs2c_p.a	profiled library (optional)
 .br
-/.../s2cc	c-shell script
+/.../s2cc	shell script
 .br
 /.../s2ccomp	compiler
 .br
--- scheme2c-2011.07.26.orig/xlib/makefile
+++ scheme2c-2011.07.26/xlib/makefile
@@ -17,7 +17,7 @@ CDECL = ../cdecl/s2cdecl
 SIZEOF = ../cdecl/s2csizeof
 SCH = ../cdecl/s2ch
 SRCDIR = ../../xlib
-SCC = ../scsc/s2cc
+SCC = ../scsc/Xs2cc
 SCXLIB = libs2cxl.a
 
 XD = X.cdecl Xatom.cdecl Xlib.cdecl Xresource.cdecl Xutil.cdecl \
@@ -39,6 +39,9 @@ xdsc =	depth.sc screen.sc visual.sc xarc
 	xvisualinfo.sc xwindowattributes.sc xwindowchanges.sc xwmhints.sc \
 	xpixmapformatvalues.sc xtextproperty.sc
 
+xdschextra = xws2.sch xws3.sch xws4.sch xws5.sch xws6.sch xws7.sch	\
+	xws8.sch xws9.sch xws10.sch xwsr4.sch
+
 xdsch =	depth.sch screen.sch visual.sch xarc.sch xchar2b.sch xcharstruct.sch \
 	xclasshint.sch xcomposestatus.sch xcolor.sch xlibCONSTANTS.sch \
 	xevent.sch xfontprop.sch xfontstruct.sch xgcvalues.sch \
@@ -49,7 +52,7 @@ xdsch =	depth.sch screen.sch visual.sch
 	xlibSTUBS.sch xtextitem.sch xtextitem16.sch xtimecoord.sch \
 	xlibTYPES.sch xvisualinfo.sch xwindowattributes.sch \
 	xwindowchanges.sch xwmhints.sch	xpixmapformatvalues.sch \
-	xtextproperty.sch
+	xtextproperty.sch $(xdschextra)
 
 
 xdc =	depth.c screen.c visual.c xarc.c xchar2b.c xcharstruct.c \
--- scheme2c-2011.07.26.orig/scsc/makefile
+++ scheme2c-2011.07.26/scsc/makefile
@@ -81,24 +81,29 @@ sc-to-c:	${scc}
 Xs2ccomp:	${scc} ${sco} ${RT}
 	${CC} -o Xs2ccomp ${CFLAGS} ${sco} ${RT} -lm ${LDFLAGS}
 
-Xmv:
-	mv Xs2ccomp s2ccomp
+s2ccomp: Xs2ccomp
+	cp -a Xs2ccomp s2ccomp
 
 port:
-	$(MAKE) "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = echo"  Xs2ccomp
-	$(MAKE) "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = echo"  Xmv
+	$(MAKE) "CC=${CC}" "CFLAGS=${CFLAGS}" "SCC=echo" Xs2ccomp s2ccomp
 
 s2cc:
-	echo '#! /bin/sh' \
-	 > $*
-	echo '${LIBDIR}/${LIBSUBDIR}/s2ccomp -scl ${SCL} -scmh ${SCMH} \
-	     -cc ${CC} -LIBDIR ${LIBDIR}/${LIBSUBDIR} $$*' \
-	 >> $*
-	chmod +x $*
+	echo '#! /bin/sh' > $@
+	echo ${LIBDIR}/${LIBSUBDIR}/s2ccomp -scl ${SCL} -scmh ${SCMH} \
+	     -cc ${CC} -LIBDIR ${LIBDIR}/${LIBSUBDIR} '$$*' >> $@
+	chmod +x $@
+
+Xs2cc:
+	echo '#! /bin/sh' > $@
+	echo $$(pwd)/s2ccomp -scl ${SCL} -scmh ${SCMH} \
+	     -cc ${CC} -LIBDIR $$(pwd)/${RTDIR} '$$*' >> $@
+	chmod +x $@
+
+all: s2cc s2ccomp
 
 install: s2cc # s2ccomp
 	${INSTALL} -d ${DESTDIR}${BINDIR}
-	${INSTALL_SCRIPT} s2cc ${DESTDIR}${BINDIR}
+	${INSTALL_SCRIPT} s2cc ${DESTDIR}${BINDIR}/
 	ln -sf s2cc ${DESTDIR}${BINDIR}/scc
 	${INSTALL} -d ${DESTDIR}${LIBDIR}/${LIBSUBDIR}
 	${INSTALL_PROGRAM} s2ccomp ${DESTDIR}${LIBDIR}/${LIBSUBDIR}/
@@ -112,19 +117,9 @@ clean-sc-to-c:
 noprogs:
 	rm -f s2ccomp Xs2ccomp
 
-all: s2cc
-	$(MAKE) "SCC = ${SCC}" "RTDIR = ${RTDIR}" "CFLAGS = ${CFLAGS}" \
-		Xs2ccomp Xmv
-
-srclinks:
+srclinks: s2cc Xs2cc
 	for x in ${scsc} ${scc} ${scsch}; \
 	    do ln -s ${SRCDIR}/$$x $$x;\
 	done
-	echo '#! /bin/sh' > s2cc
-	echo `pwd`'/s2ccomp -scl ${SCL} -scmh ${SCMH} \
-	     -cc ${CC} -LIBDIR ' `pwd`'/${RTDIR} $$*' >> s2cc
-	chmod +x s2cc
-	echo '#! /bin/sh' > Xs2cc
-	echo `pwd`'/Xs2ccomp -scl ${SCL} -scmh ${SCMH} \
-	     -cc ${CC} -LIBDIR ' `pwd`'/${RTDIR} $$*' >> Xs2cc
-	chmod +x Xs2cc
+
+.PHONY: all clean port install sc-to-c srclinks noprogs clean-sc-to-c
--- scheme2c-2011.07.26.orig/test/makefile
+++ scheme2c-2011.07.26/test/makefile
@@ -2,7 +2,7 @@
 #  Scheme->C compiler and runtime tests.
 #
 
-SCC = ../scsc/s2cc
+SCC = ../scsc/Xs2cc
 SCCFLAGS = -g
 
 n = n must be defined
@@ -91,9 +91,9 @@ noprogs:
 	rm -f ${progs}
 
 all:
-	$(MAKE) "SCC = ${SCC}" "SCCFLAGS = ${SCCFLAGS}" \
+	$(MAKE) "SCC=${SCC}" "SCCFLAGS=${SCCFLAGS}" \
 	     test test50 test51 test52 test54
-	$(MAKE) "SCC = ${SCC}" "SCCFLAGS = ${SCCFLAGS}" "n = 53" testn
+	$(MAKE) "SCC=${SCC}" "SCCFLAGS=${SCCFLAGS}" "n=53" testn
 
 alltests.sc: ${alltests}
 	cat ${alltests} > alltests.sc
@@ -103,5 +103,13 @@ srclinks:
 	    do ln -s ${SRCDIR}/$$x $$x;\
 	done
 
-autotest: test test50 test54
-	./test && ./test50 && ./test54
+autotest: autotest-test autotest-test50 autotest-test54
+
+autotest-test: test
+	./test
+autotest-test50: test50
+	./test50
+autotest-test54: test54
+	./test54
+
+.PHONY: autotest-test autotest-test50 autotest-test54
--- scheme2c-2011.07.26.orig/scrt/makefile
+++ scheme2c-2011.07.26/scrt/makefile
@@ -41,7 +41,7 @@ INSTALL_SCRIPT = ${INSTALL}
 .SUFFIXES:
 .SUFFIXES:	.o .c .sc .s
 
-SCC = ../scsc/s2cc
+SCC = ../scsc/Xs2cc
 SCCFLAGS = 
 
 SRCDIR = ../../scrt
@@ -111,24 +111,20 @@ Xmv:		Xs2ci Xlibs2c.a
 	mv Xlibs2c.a libs2c.a
 
 port:
-	$(MAKE) "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = echo" \
+	$(MAKE) "CC=${CC}" "CFLAGS=${CFLAGS}" "SCC=echo" \
 	     Xlibs2c.a Xs2ci Xmv ${Plib}
 
 libs2c_p.a:	libs2c.a
 	mkdir -p saveobj
 	mv ${Sruntime} ${Cruntime} ${Aruntime} saveobj/
 	rm -f libs2c_p.a
-	$(MAKE) "CC = ${CC}" "CFLAGS = ${CFLAGS} -pg" ${Sruntime} ${Cruntime} \
+	$(MAKE) "CC=${CC}" "CFLAGS=${CFLAGS} -pg" ${Sruntime} ${Cruntime} \
 	     ${Aruntime}
 	ar q libs2c_p.a ${Cruntime} ${Sruntime} ${Aruntime}
 	${RANLIB} libs2c_p.a
 	mv saveobj/* ./
 	rmdir saveobj
 
-install-private:
-	$(MAKE) "DESTDIR=${DESTDIR}" "LIBDIR=/." "BINDIR=/. LIBSUBDIR=." \
-	     "OWNER = -o `whoami`" install
-
 install:
 	${INSTALL} -d ${DESTDIR}${LIBDIR}/${LIBSUBDIR}
 	${INSTALL_DATA} libs2c.a ${DESTDIR}${LIBDIR}/${LIBSUBDIR}/
@@ -160,8 +156,8 @@ bindist:
 	      libs2c.a ${Plib} s2ci ${destdir}
 
 all:
-	$(MAKE) "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = ${SCC}" \
-	     "SCCFLAGS = ${SCCFLAGS}" Xlibs2c.a Xs2ci Xmv ${Plib}
+	$(MAKE) "CC=${CC}" "CFLAGS=${CFLAGS}" "SCC=${SCC}" \
+	     "SCCFLAGS=${SCCFLAGS}" Xlibs2c.a Xs2ci Xmv ${Plib}
 
 srclinks:
 	for x in ${Cruntimec} ${Chfiles} ${Sruntimec} ${Sruntimesc} ${Smisc}; \
