--- dadadodo-1.03.orig/debian/control +++ dadadodo-1.03/debian/control @@ -0,0 +1,14 @@ +Source: dadadodo +Section: text +Priority: optional +Maintainer: Decklin Foster +Standards-Version: 3.5.6 + +Package: dadadodo +Architecture: any +Depends: ${shlibs:Depends} +Description: Exterminates all rational thought + DadaDodo is a program that analyses texts for Markov chains of word + probabilities and then generates random sentences based on that. + Sometimes these sentences are nonsense; but sometimes they cut right + through to the heart of the matter and reveal hidden meanings. --- dadadodo-1.03.orig/debian/maint/prerm +++ dadadodo-1.03/debian/maint/prerm @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/dadadodo ]; then + rm -f /usr/doc/dadadodo +fi --- dadadodo-1.03.orig/debian/maint/postinst +++ dadadodo-1.03/debian/maint/postinst @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/dadadodo -a -d /usr/share/doc/dadadodo ]; then + ln -sf ../share/doc/dadadodo /usr/doc/dadadodo + fi +fi --- dadadodo-1.03.orig/debian/local/README.Debian +++ dadadodo-1.03/debian/local/README.Debian @@ -0,0 +1,20 @@ +dadadodo for Debian +------------------- + +DadaDodo is one of the class of programs known as dissociators, a coin +perhaps termed by the amazing Emacs hack, Dissociated Press. + +DadaDodo works rather differently than Dissociated Press; whereas +Dissociated Press (which, incidentally, refers to itself as a travesty +generator) simply grabs segments of the body of text and shuffles +them, DadaDodo tries to work on a larger scale: it scans bodies of text, +and builds a probability tree expressing how frequently word B tends to +occur after word A, and various other statistics; then it generates +sentences based on those probabilities. + +The theory here is that, with a large enough corpus, the generated +sentences will tend to be grammatically correct, but semantically random: +exterminate all rational thought. + +Sudhakar Chandrasekharan , Wed, 7 Oct 1998 12:46:39 -0700 + --- dadadodo-1.03.orig/debian/local/dadadodo.1 +++ dadadodo-1.03/debian/local/dadadodo.1 @@ -0,0 +1,44 @@ +.TH DADADODO 1 +.SH NAME +dadadodo \- Exterminate all rational thought +.SH SYNOPSIS +.B dadadodo +.I "[options] [input files]" +.br +.SH "DESCRIPTION" +dadadodo is a program that analyses texts for markov chains of word +probabilities and then generates random sentences based on that. Sometimes +these sentences are nonsense; but sometimes they cut right through to the +heart of the matter and reveal hidden meanings. +.PP +.SH OPTIONS +dadadodo accepts the following options: +.TP +.B \-h, \-help +Show summary of options. +.TP +.B \-o, \-output \fIfile\fP +Save compiled data in \fIfile\fP (\- for stdout) +.TP +.B \-l, \-load \fIfile\fP +Load compiled data from \fIfile\fP (\- for stdin) +.TP +.B \-c, \-count \fIn\fP +Generate \fIn\fP sentences. +.TP +.B \-p, \-pause \fIs\fP +Delay \fIs\fP seconds between paragraphs. +.TP +.B \-html +Output HTML instead of plain text. +.SH "NOTES" +Remaining arguments are input files. These should be text files, but may +be mail folders or HTML. MIME messages are handled sensibly. When no +output file is specified, sentences will be generated from the input data +directly. Howevere, loading a saved file is far faster than re\-parsing the +text files each time. +.SH "SEE ALSO" +Also see +.IR "http://www.jwz.org/dadadodo/" +.SH AUTHOR +This manual page was written by Sudhakar Chandrasekharan . --- dadadodo-1.03.orig/debian/rules +++ dadadodo-1.03/debian/rules @@ -0,0 +1,126 @@ +#! /usr/bin/make -f +## Written by Gergely Nagy +## This is under GPL v2. + +PACKAGE = dadadodo +PKGDIR = ${CURDIR}/debian/${PACKAGE} + +CFLAGS = -Wall -O2 +ifneq (,$(findstring debug,${DEB_BUILD_OPTIONS})) + CFLAGS += -g +endif + +build: patch + test -e debian/control + $(MAKE) CFLAGS="${CFLAGS}" + +clean: unpatch + test -e debian/control && test "x`whoami`" = "xroot" + rm -rf debian/${PACKAGE}.substvars ${PKGDIR} debian/files debian/patched + -$(MAKE) clean + +install: build + test -e debian/control + install -d ${PKGDIR}/usr/share/doc/${PACKAGE} \ + ${PKGDIR}/usr/bin ${PKGDIR}/usr/share/man/man1 + install -m 0644 dodotodo ${PKGDIR}/usr/share/doc/${PACKAGE}/TODO + install -m 0644 README ${PKGDIR}/usr/share/doc/${PACKAGE}/ + install -m 0755 dadadodo ${PKGDIR}/usr/bin + +binary-dadadodo: install + test -e debian/control && test "x`whoami`" = "xroot" +## Install debian-specific stuff +# Like README.Debian... + install -m 0644 debian/local/README.Debian \ + ${PKGDIR}/usr/share/doc/${PACKAGE} +# ..the changelogs.. + install -m 0644 debian/changelog \ + ${PKGDIR}/usr/share/doc/${PACKAGE}/changelog.Debian +# ..the copyright file.. + cat debian/copyright patch-stamp >${PKGDIR}/usr/share/doc/${PACKAGE}/copyright +# ..a manual page + gzip -9fc debian/local/dadadodo.1 >${PKGDIR}/usr/share/man/man1/dadadodo.1.gz +## Strip binaries +ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS})) + strip --remove-section=.comment --remove-section=.note \ + ${PKGDIR}/usr/bin/dadadodo +endif +## Compress the changelog + gzip -9f ${PKGDIR}/usr/share/doc/${PACKAGE}/changelog.Debian +## Fix permissions + find ${PKGDIR} -print0 2>/dev/null | xargs -0r chown \ + --no-dereference 0.0 + find ${PKGDIR} ! -type l -print 0 2>/dev/null | xargs -0r \ + chmod go=rX,u+rw,a-s +## Generate ${shlibs:Depends} + dpkg-shlibdeps -Tdebian/${PACKAGE}.substvars -dDepends \ + ${PKGDIR}/usr/bin/dadadodo +## Install stuff to DEBIAN/ + install -d ${PKGDIR}/DEBIAN + install -m 0755 debian/maint/postinst debian/maint/prerm \ + ${PKGDIR}/DEBIAN/ +## Generate DEBIAN/md5sums + cd ${PKGDIR} >/dev/null ;\ + find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums +## Generate DEBIAN/control + dpkg-gencontrol -isp -p${PACKAGE} -Tdebian/${PACKAGE}.substvars \ + -P${PKGDIR} +## Build the binary package + dpkg --build ${PKGDIR} .. + +binary-indep: +binary-arch: binary-dadadodo + +binary: binary-indep binary-arch + +## Below here is the realm of Deep Magic +patch: patch-stamp +patch-stamp: + test -d debian/patched || install -d debian/patched + @echo "Patches applied in the Debian version of ${PACKAGE}:" > $@T + @for entry in `cat debian/patches/00list`; do \ + stamp=debian/patched/$$entry.dpatch; \ + patch=debian/patches/$$entry.dpatch; \ + test -x $$patch || chmod +x $$patch; \ + if test -f $$stamp; then \ + echo "$$patch already applied."; \ + echo -en "\n$$patch " >> $@T; \ + sed -n "s/^## $$entry.dpatch by \(.*\)/(\1)/p" $$patch >>$@T; \ + sed -n 's/^## *DP: */ /p' $$patch >> $@T; \ + else \ + echo -n "applying patch $$patch..."; \ + if $$patch -patch >$$stamp.new 2>&1; then \ + mv $$stamp.new $$stamp; \ + touch $$stamp; \ + echo -en "\n$$patch " >> $@T; \ + sed -n "s/^## $$entry.dpatch by \(.*\)/(\1)/p" $$patch >>$@T; \ + sed -n 's/^## *DP: */ /p' $$patch >> $@T; \ + echo " ok."; \ + else \ + echo " failed."; \ + exit 1; \ + fi; \ + fi; \ + done + mv -f $@T $@ + +unpatch: + @for patch in `tac debian/patches/00list`; do \ + stamp=debian/patched/$$patch.dpatch; \ + patch=debian/patches/$$patch.dpatch; \ + test -x $$patch || chmod +x $$patch; \ + if test -f $$stamp; then \ + echo -n "reverting patch $$patch..."; \ + if $$patch -unpatch 2>&1 >/dev/null; then \ + rm -f $$stamp; \ + echo " ok."; \ + else \ + echo " failed."; \ + exit 1; \ + fi; \ + fi; \ + done + rm -f patch-stamp + +.PHONY: binary binary-arch binary-indep clean build install binary-dadadodo \ + patch unpatch --- dadadodo-1.03.orig/debian/changelog +++ dadadodo-1.03/debian/changelog @@ -0,0 +1,77 @@ +dadadodo (1.03-9) unstable; urgency=low + + * Adopting package (Closes: #154637) + + -- Decklin Foster Thu, 1 Aug 2002 15:05:50 -0400 + +dadadodo (1.03-8) unstable; urgency=low + + * The "Is there anybody in there?" release + * Migrate to build-time patching, and include the list (with + descriptions) of the applied patches in the installed copyright file. + + -- Gergely Nagy Sat, 1 Jun 2002 01:55:46 +0200 + +dadadodo (1.03-7) unstable; urgency=low + + * The "Back from Poland and I am happy" release + * files.c (read_dadadodo_file): cast buf to unsigned char, fixing a + segmentation fault. Patch courtesy of Bernhard R. Link (Closes: + #106891) + + -- Gergely Nagy Mon, 20 May 2002 18:54:32 +0200 + +dadadodo (1.03-6) unstable; urgency=low + + * dadadodo.c (main): Check if enough parameters were given to -p and -c, + and bail out if not. This fixes a segfault on `dadadodo -p'. (Closes: + #137934) + * debian/local/dadadodo.1: escaped a `-', and fixed .TH + * debian/rules: converted to non-debhelper, related files were changed + accordingly. + + -- Gergely Nagy Thu, 14 Mar 2002 10:11:51 +0100 + +dadadodo (1.03-5) unstable; urgency=low + + * New maintainer + * debian/rules (build-stamp, install-stamp): stamp files are Evil + (clean): no stamp files, so remove the rm -f call + * debian/control: Fixed spelling mistake, thanks to Matt Zimmerman + + * debian/copyright: added myself + + -- Gergely Nagy Thu, 13 Dec 2001 14:03:48 +0100 + +dadadodo (1.03-4) unstable; urgency=low + + * New Maintainer (Closes: #107424). + * Pump Standards-Version to 3.5.6: + - honour DEB_BUILD_OPTIONS. + * Use newer debhelper mode. + * Fix 8bit handling, thanks Dmitry Astapov for the patch (Closes: #30117). + * Remove modifications of upstream Makefile and instead add code for + the installation to debian/rules. + * Format dadadodo.README.debian and description nicer. + * Removed Emacs cruft from debian/changelog. + + -- Martin Michlmayr Thu, 02 Aug 2001 19:21:06 +0200 + +dadadodo (1.03-3) unstable; urgency=low + + * Fixing bug # 70245 + + -- Sudhakar Chandrasekharan Wed, 17 Jan 2001 17:39:50 -0800 + +dadadodo (1.03-2) unstable; urgency=low + + * Fixing a whole bunch of warnings and errors that lintian complains + about. + + -- Sudhakar Chandrasekharan Tue, 6 Jun 2000 17:51:01 -0700 + +dadadodo (1.03-1) unstable; urgency=low + + * Initial Release. + + -- Sudhakar Chandrasekharan Wed, 7 Oct 1998 12:46:39 -0700 --- dadadodo-1.03.orig/debian/patches/01-setlocale.dpatch +++ dadadodo-1.03/debian/patches/01-setlocale.dpatch @@ -0,0 +1,39 @@ +#! /bin/sh -e +## 01-setlocale.dpatch by Dmitry Astapov +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set the locale. This fixes non-ASCII handling, and also fixes #30117 + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- dadadodo.c 21 Feb 1998 19:55:58 -0000 ++++ dadadodo.c 14 Mar 2002 09:11:41 -0000 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "hash.h" + #include "dadadodo.h" +@@ -810,6 +811,8 @@ + char *stat_words = 0; + FILE *tmp_file = 0; + ++ setlocale(LC_ALL, ""); ++ + for (i = 1; i < argc; i++) + { + const char *sw = argv[i]; --- dadadodo-1.03.orig/debian/patches/03-casting.dpatch +++ dadadodo-1.03/debian/patches/03-casting.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh -e +## 03-casting.dpatch by Bernhard R. Link +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: files.c (read_dadadodo_file): cast buf to unsigned char, fixing a +## DP: segmentation fault. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- files.c 21 Feb 1998 19:47:53 -0000 ++++ files.c 20 May 2002 17:01:42 -0000 +@@ -592,7 +592,7 @@ + st[i] = ntohs (((u_short *)buf) [i]); + else + for (i = 0; i < nstarters; i++) +- st[i] = NTOHC (((char *)buf) [i]); ++ st[i] = NTOHC (((unsigned char *)buf) [i]); + + # undef NTOHC + --- dadadodo-1.03.orig/debian/patches/00list +++ dadadodo-1.03/debian/patches/00list @@ -0,0 +1,3 @@ +01-setlocale +02-argc +03-casting --- dadadodo-1.03.orig/debian/patches/02-argc.dpatch +++ dadadodo-1.03/debian/patches/02-argc.dpatch @@ -0,0 +1,44 @@ +#! /bin/sh -e +## 02-argc.dpatch by Gergely Nagy +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Bail out if there weren't enough arguments given to -count or -pause. +## DP: This fixes #137934. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- dadadodo.c 13 Dec 2001 12:43:55 -0000 ++++ dadadodo.c 14 Mar 2002 09:11:41 -0000 +@@ -834,10 +834,20 @@ + } + else if (!strcmp(sw, "-c") || !strcmp(sw, "-count")) + { ++ if (i+1 >= argc) ++ { ++ usage(argv[0]); ++ exit(1); ++ } + count = atoi(argv[++i]); + } + else if (!strcmp(sw, "-p") || !strcmp(sw, "-pause")) + { ++ if (i+1 >= argc) ++ { ++ usage(argv[0]); ++ exit(1); ++ } + pause = atoi(argv[++i]); + } + else if (!strcmp(sw, "-html")) --- dadadodo-1.03.orig/debian/copyright +++ dadadodo-1.03/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Sudhakar Chandrasekharan +on Wed, 7 Oct 1998 12:46:39 -0700. + +Martin Michlmayr became the new maintainer of this package +on 2001-08-02. + +Gergely Nagy took it over on 2001-12-13. + +Decklin Foster adopted it on 2002-08-01. + +The source code was downloaded from http://www.jwz.org/dadadodo/ + +Upstream Author: Jamie Zawinski + +Copyright: + +DadaDodo, Copyright (c) 1997, 1998 Jamie Zawinski + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. No representations are made about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. +