--- glkterm-0.8.0.orig/glk.h +++ glkterm-0.8.0/glk.h @@ -17,8 +17,19 @@ /* You may have to edit the definition of glui32 to make sure it's really a 32-bit unsigned integer type, and glsi32 to make sure it's really a 32-bit signed integer type. If they're not, horrible things will happen. */ +#include +#if (USHORT_MAX == 4294967295) +typedef unsigned short glui32; +typedef signed short glsi32; +#elif (UINT_MAX == 4294967295) +typedef unsigned int glui32; +typedef signed int glsi32; +#elif (ULONG_MAX == 4294967295) typedef unsigned long glui32; typedef signed long glsi32; +#else +#error Can not find 32-bit integer type. +#endif /* These are the compile-time conditionals that reveal various Glk optional modules. */ --- glkterm-0.8.0.orig/main.c +++ glkterm-0.8.0/main.c @@ -52,10 +52,10 @@ printf("Compile-time error: glui32 is not unsigned. Please fix glk.h.\n"); return 1; } - if (sizeof(window_t *) > 4) { +/* if (sizeof(window_t *) > 4) { printf("Compile-time error: Pointers cannot fit in a glui32. Start writing hashtable code.\n"); return 1; - } + }*/ /* Now some argument-parsing. This is probably going to hurt. */ startdata.argc = 0; --- glkterm-0.8.0.orig/Makefile +++ glkterm-0.8.0/Makefile @@ -17,7 +17,12 @@ #LIBDIRS = -L/usr/5lib LIBS = -lncurses -OPTIONS = -O +OPTIONS = -g -D_REENTRANT +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + OPTIONS += -O0 +else + OPTIONS += -O2 +endif CFLAGS = $(OPTIONS) $(INCLUDEDIRS) @@ -40,6 +45,7 @@ $(GLKLIB): $(GLKTERM_OBJS) ar r $(GLKLIB) $(GLKTERM_OBJS) ranlib $(GLKLIB) + rm -f *.o Make.glkterm: echo LINKLIBS = $(LIBDIRS) $(LIBS) > Make.glkterm @@ -49,3 +55,17 @@ clean: rm -f *~ *.o $(GLKLIB) Make.glkterm + +install: + install -d $(DESTDIR)/usr/lib/ + install --mode=644 $(GLKLIB) $(DESTDIR)/usr/lib/ + install -d $(DESTDIR)/usr/include/libglkterm/ + cd $(DESTDIR)/usr/include/ ; ln -s ./libglkterm/ glkterm + install --mode=644 gi_blorb.h $(DESTDIR)/usr/include/libglkterm/ + install --mode=644 gi_dispa.h $(DESTDIR)/usr/include/libglkterm/ + install --mode=644 glk.h $(DESTDIR)/usr/include/libglkterm/ + install --mode=644 glkstart.h $(DESTDIR)/usr/include/libglkterm/ + install --mode=644 Make.glkterm $(DESTDIR)/usr/include/libglkterm/ + install -d $(DESTDIR)/usr/share/doc/libglkterm-dev/ + install --mode=644 readme.txt $(DESTDIR)/usr/share/doc/libglkterm-dev/ + --- glkterm-0.8.0.orig/Makefile.shared +++ glkterm-0.8.0/Makefile.shared @@ -0,0 +1,62 @@ +# Unix Makefile for GlkTerm library + +# This generates the shared library. + +# Pick a C compiler. +#CC = cc +CC = gcc -ansi + +# You may need to set directories to pick up the ncurses library. +#INCLUDEDIRS = -I/usr/5include +#LIBDIRS = -L/usr/5lib +LIBS = -lncurses + +OPTIONS = -g -fPIC -D_REENTRANT +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + OPTIONS += -O0 +else + OPTIONS += -O2 +endif + +CFLAGS = $(OPTIONS) $(INCLUDEDIRS) + +SONAME = libglkterm.so.0 +GLKSHAREDLIB = libglkterm.so.0.0 + +GLKTERM_OBJS = \ + main.o gtevent.o gtfref.o gtgestal.o gtinput.o \ + gtmessag.o gtmessin.o gtmisc.o gtstream.o gtstyle.o \ + gtw_blnk.o gtw_buf.o gtw_grid.o gtw_pair.o gtwindow.o \ + gtschan.o gtblorb.o cgunicod.o gi_dispa.o gi_blorb.o + +GLKTERM_HEADERS = \ + glkterm.h gtoption.h gtw_blnk.h gtw_buf.h \ + gtw_grid.h gtw_pair.h gi_dispa.h + +all: $(GLKSHAREDLIB) libglkterm.3.gz + +cgunicod.o: cgunigen.c + +$(GLKSHAREDLIB): $(GLKTERM_OBJS) + $(CC) -shared -Wl,-soname,$(SONAME) -g -D_REENTRANT -o $(GLKSHAREDLIB) $(GLKTERM_OBJS) $(LIBS) + rm -f *.o + +$(GLKTERM_OBJS): glk.h $(GLKTERM_HEADERS) + +libglkterm.3.gz: + cp debian/doc/libglkterm.3 . + gzip libglkterm.3 + +clean: + rm -f *~ *.o $(GLKSHAREDLIB) libglkterm.3.gz + +install: + install -d $(DESTDIR)/usr/lib/ + install --mode=644 $(GLKSHAREDLIB) $(DESTDIR)/usr/lib/ + cd $(DESTDIR)/usr/lib/ ; ln -s ./$(GLKSHAREDLIB) libglkterm.so.0 + cd $(DESTDIR)/usr/lib/ ; ln -s ./$(GLKSHAREDLIB) libglkterm.so + install --mode=644 debian/doc/README.glk $(DESTDIR)/usr/share/doc/libglkterm-dev/ + install -d $(DESTDIR)/usr/share/man/man3 + install --mode=644 libglkterm.3.gz $(DESTDIR)/usr/share/man/man3 + cd $(DESTDIR)/usr/share/man/man3 ; ln -s ./libglkterm.3.gz glkterm.3.gz + --- glkterm-0.8.0.orig/debian/libglkterm-dev.install +++ glkterm-0.8.0/debian/libglkterm-dev.install @@ -0,0 +1,10 @@ +usr/lib/libglkterm.so +usr/include/glkterm +usr/include/libglkterm/gi_blorb.h +usr/include/libglkterm/gi_dispa.h +usr/include/libglkterm/glk.h +usr/include/libglkterm/glkstart.h +usr/include/libglkterm/Make.glkterm +/usr/share/man/man3/libglkterm.3.gz +/usr/share/man/man3/glkterm.3.gz + --- glkterm-0.8.0.orig/debian/control +++ glkterm-0.8.0/debian/control @@ -0,0 +1,32 @@ +Source: glkterm +Priority: extra +Maintainer: Peer Schaefer +Build-Depends: debhelper (>= 6), libncurses5-dev (>= 5.6) +Standards-Version: 3.7.3 +Section: libs +Homepage: http://www.eblong.com/zarf/glk/ + +Package: libglkterm-dev +Section: libdevel +Architecture: any +Depends: libglkterm (= ${binary:Version}) +Description: development files for libglkterm + This package contains the header files and the documentation of glkterm for + developers using glkterm. Please refer to the libglkterm package for a + description of glkterm. + +Package: libglkterm +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: glkterm is an implementation of the glk API for terminals + The glkterm library is an implementation of the glk API (version 0.7.0) for + terminals or terminal emulators which uses the ncurses library. glk is a + standard which specifies an API for interpreters of Interactive Fiction + (a.k.a. text adventures). glkterm provides routines for all input and output + related tasks that such an interpreter has to accomplish, for example reading + text from the keyboard, printing text on the screen and displaying a status + bar. + . + This package contains the shared library of glkterm. + --- glkterm-0.8.0.orig/debian/libglkterm-dev.docs +++ glkterm-0.8.0/debian/libglkterm-dev.docs @@ -0,0 +1,3 @@ +readme.txt +debian/doc/README.glk + --- glkterm-0.8.0.orig/debian/rules +++ glkterm-0.8.0/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + +configure: + dh_testdir + +build: build-stamp +build-stamp: + dh_testdir + $(MAKE) + $(MAKE) --makefile=Makefile.shared + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp install-stamp + $(MAKE) clean + $(MAKE) --makefile=Makefile.shared clean + dh_clean + +install: build-stamp + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + $(MAKE) --makefile=Makefile.shared DESTDIR=$(CURDIR)/debian/tmp install + +# Build architecture-independent files here. +binary-indep: build install + dh_install --sourcedir=debian/tmp + dh_installdocs + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_install --sourcedir=debian/tmp + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + 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 configure --- glkterm-0.8.0.orig/debian/copyright +++ glkterm-0.8.0/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Peer Schaefer on +Thu, 12 Jun 2008 22:29:07 +0200. + +It was downloaded from + +Upstream Author: + + Andrew Plotkin + +Copyright: + + Copyright (C) 1998-2000 by Andrew Plotkin + +License: + You may copy and distribute it freely, by any means and under any + conditions, as long as the code and documentation is not changed. You may + also incorporate this code into your own program and distribute that, or + modify this code and use and distribute the modified version, as long as + you retain a notice in your program or documentation which mentions my + name[1] and the URL shown above[2]. + + Notes by Peer Schaefer : + [1] This refers to: Andrew Plotkin + [2] This refers to: http://eblong.com/zarf/glk/index.html + +The Debian packaging is copyright (C) 2008 by Peer Schaefer + and licensed under the same terms as glkterm itself. +Please read the terms "my name" and "the URL shown above" in the license as +"Peer Schaefer " and +"http://www.wolldingwacht.de/if/debian/glkterm/", respectively. + --- glkterm-0.8.0.orig/debian/libglkterm.install +++ glkterm-0.8.0/debian/libglkterm.install @@ -0,0 +1,4 @@ +usr/lib/libglkterm.so.0.0 +usr/lib/libglkterm.so.0 +usr/lib/libglkterm.a + --- glkterm-0.8.0.orig/debian/compat +++ glkterm-0.8.0/debian/compat @@ -0,0 +1 @@ +6 --- glkterm-0.8.0.orig/debian/changelog +++ glkterm-0.8.0/debian/changelog @@ -0,0 +1,13 @@ +glkterm (0.8.0-1) unstable; urgency=low + + * Initial release (Closes: #486410) + * Renamed the upstream program from 'glkterm' to 'libglkterm'. + * Added a manpage. + * Applied a patch to make glkterm run on 64 bit platforms. The patch is + available here: http://www.wolldingwacht.de/if/glkterm/patch-64-bit.html + * Debianized version provides a shared library (upstream provides only a + static library). + * An 'install' section was added to upstream's makefile. + + -- Peer Schaefer Thu, 12 Jun 2008 22:29:07 +0200 + --- glkterm-0.8.0.orig/debian/README.Debian +++ glkterm-0.8.0/debian/README.Debian @@ -0,0 +1,16 @@ +glkterm for Debian +------------------ + +There are a number of debian specific modifications to the upstream package. +The most important are: + * A manpage was added. + * A patch was applied to make glkterm run on 64 bit platforms. The patch is + available here: http://www.wolldingwacht.de/if/glkterm/patch-64-bit.html + * The debianzied version provides a shared library (upstream provides only a + static library), does not provide a "Makefile.glkterm" file and installs in + the system directories (/usr/lib/ and /usr/include/). If you want to + compile programs that rely on the original behavior of the upstream + package, you have to patch them. + * An 'install' section was added to upstream's makefile. + + -- Peer Schaefer Thu, 12 Jun 2008 22:29:07 +0200 --- glkterm-0.8.0.orig/debian/doc/libglkterm.3 +++ glkterm-0.8.0/debian/doc/libglkterm.3 @@ -0,0 +1,126 @@ +.\" -*- nroff -*- +.TH LIBGLKTERM 3 0.8.0 +.SH NAME +.B glkterm +\- implementation of the glk API with ncurses support + +.SH SYNOPSIS +.B #include + +.SH DESCRIPTION +.B glkterm +glkterm is an implementation of the glk API for terminals or terminal emulators +which uses the curses or ncurses library. It should compile on all POSIX +compliant systems and on all other systems that provide a curses compatible +terminal emulation (e.g. of the VT100), a curses or ncurses library and a C +compiler that is compliant to the ISO/ANSI C standard. glkterm was written by +Andrews Plotkin and is available for download from the website of glk: +.P +http://www.eblong.com/zarf/glk/ +.P +glk is a standard which specifies an API for interpreters of Interactive +Fiction (a.k.a. Text Adventures). Such interpreters are programs that 'run' a +game file that contains the machine-readable representation of an interactive +story (Text Adventure). glk provides a clean API for all input and output +related tasks that such an interpreter has to accomplish, for example reading +text from the keyboard, printing text on the screen and displaying a status +bar. The specification of the glk API (version 0.7.0) is available here: +.P +http://www.eblong.com/zarf/glk/glk-spec-070.html +.P +Please note that the license terms of the specification allows only viewing +and downloading for personal, non-commercial purposes, and disallows any form +of modification or distribution. See the specification for details. + +.SH USAGE +The debianzied version provides a static library as well as a shared library +(upstream provides only a static library) and installs in the system +directories (/usr/lib/ and /usr/include/). If you want to compile programs that +rely on the original behavior of the upstream package, you have to patch them. +.P +GlkTerm can accept command-line arguments both for itself and on behalf +of the underlying program. These are the arguments the library accepts +itself: +.TP +\fB\-width NUM, \-height NUM\fR +These set the screen width and height manually. Normally GlkTerm determines the +screen size itself, by asking the curses library. If this doesn't work, you can +set a fixed size using these options. +.TP +\fB\-ml BOOL\fR +Use message line (default "yes"). Normally GlkTerm reserves the bottom line of +the screen for special messages. By setting this to "no", you can free that +space for game text. Note that some operations will grab the bottom line +temporarily anyway. +.TP +\fB\-revgrid BOOL\fR +Reverse text in grid (status) windows (default "no"). Set this to "yes" to +display all textgrid windows (status windows) in reverse text. +.TP +\fB\-historylen NUM\fR +The number of commands to keep in the command history of each window (default +20). +.TP +\fB\-border BOOL\fR +Draw one-character borders between windows (default "yes"). These are lines +of \'\-\' and \'|\' characters. If you set this "no", there's a little more room for +game text, but it may be hard to distinguish windows. The -revgrid option may +help. +.TP +\fB\-precise BOOL\fR +More precise timing for timed input (default "no"). The curses.h library only +provides timed input in increments of a tenth of a second. So Glk timer events +will only be checked ten times a second, even on fast machines. If this isn't +good enough, you can try setting this option to "yes"; then timer events will +be checked constantly. This busy-spins the CPU, probably slowing down +everything else on the machine, so use it only when necessary. For that matter, +it may not even work on all OSes. (If GlkTerm is compiled without support for +timed input, this option will be removed.) +.TP +\fB\-version\fR +Display Glk library version. +.TP +\fB\-help\fR +Display list of command-line options. +.PP +.B NUM +values can be any number. +.B BOOL +values can be "yes" or "no", or no value to toggle. + +.SH BUGS +No known. + +.SH PORTABILITY +glkterm should compile on all POSIX compliant systems and on all other systems +that provide a curses compatible terminal emulation (e.g. of the VT100), a +curses or ncurses library and a C compiler that is compliant to the ISO/ANSI C +standard. + +.SH AUTHORS +.B glkterm +is written and copyright (C) 1998-2000 by Andrew Plotkin. + +.SH COPYRIGHT +Designed by Andrew Plotkin . +.P +http://eblong.com/zarf/glk/index.html. +.P +The source code in this package is copyright 1998-2000 by Andrew Plotkin. You +may copy and distribute it freely, by any means and under any conditions, +as long as the code and documentation is not changed. You may also +incorporate this code into your own program and distribute that, or modify +this code and use and distribute the modified version, as long as you retain +a notice in your program or documentation which mentions my name and the +URL shown above. +.P +This manpage was written for the Debian package of glkterm. It is copyright (C) +2008 by Peer Schaefer and licensed under the same +terms as glkterm itself. Please read the terms "my name" and "the URL shown +above" in the license as "Peer Schaefer " and +"http://www.wolldingwacht.de/if/debian/glkterm/", respectively. + +.SH "SEE ALSO" +.BR frotz (6) +.BR glulxe (6) + --- glkterm-0.8.0.orig/debian/doc/README.glk +++ glkterm-0.8.0/debian/doc/README.glk @@ -0,0 +1,42 @@ +About the glk API +----------------- + +glk is a standard which specifies an Application Programming Interface (API) +for interpreters of Interactive Fiction (a.k.a. Text Adventures). Such +interpreters are programs that 'run' a game file that contains the machine +readable representation of an interactive story (Text Adventure). glk provides +a clean API for all input and output related tasks that such an interpreter has +to accomplish, for example reading text from the keyboard, printing text to the +screen and displaying a status bar. Thus glk serves two goals: First, it makes +writing interpreters easier because the programmer can concentrate on the +algorithms needed to interpret the game file. Second, it makes interpreters +more portable, because if your write your interpreter in clean ISO/ANSI C all +you have to do to port your interpreter to a new platform is to write an +implementation of the glk API for that platform. + +glk was designed by Andrew Plotkin and the website for glk is here: + + * http://www.eblong.com/zarf/glk/ + +The specification of the glk API (version 0.7.0) is available here: + + * http://www.eblong.com/zarf/glk/glk-spec-070.html + +Please note that the license terms of the specification allows only viewing +and downloading for personal, non-commercial purposes, and disallows any form +of modification or distribution. See the specification for details. + +A list of implementations of the glk API includes cheapglk (an implementation +which utilises only I/O-operations provided by the ISO/ANSI C stdio.h library), +xglk (an implementation for X11 compatible X Window systems) and glkterm (an +implementation for terminals or terminal emulators which uses the curses or +ncurses library). cheapglk should compile on all systems that provide an +ISO/ANSI C compliant compiler. glkterm should compile on all POSIX compliant +systems and on all other systems that provide a curses compatible terminal +emulation (e.g. of the VT100), a curses or ncurses library and a C compiler +that is compliant to the ISO/ANSI C standard. xglk should compile on all POSIX +compliant systems that provide an X11 compatible X Window system. cheapglk, +xglk and glkterm are available for download from the glk homepage, whose URL is +mentioned above. + + -- Peer Schaefer Sat, 07 Jun 2008 20:39:22 +0200