--- dadadodo-1.04.orig/debian/copyright +++ dadadodo-1.04/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. + --- dadadodo-1.04.orig/debian/rules +++ dadadodo-1.04/debian/rules @@ -0,0 +1,124 @@ +#! /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 +## Create DEBIAN/ + install -d ${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."; \ + printf "\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; \ + printf "\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.04.orig/debian/changelog +++ dadadodo-1.04/debian/changelog @@ -0,0 +1,110 @@ +dadadodo (1.04-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix bashism in debian/rules (Closes: #477621) + * Bump Standards-Version to 3.8.0 + * Don't ignore "make clean" errors + + -- Chris Lamb Sat, 07 Jun 2008 19:31:16 +0100 + +dadadodo (1.04-3) unstable; urgency=low + + * Fix -w option, which was looking at the wrong element of argv and thus + always setting the width to 0. + + -- Decklin Foster Mon, 22 Nov 2004 19:58:47 -0500 + +dadadodo (1.04-2) unstable; urgency=low + + * Applied fixes from Branden Robinson : + - Make dadadodo check the COLUMNS environment variable for the terminal + width before falling back to the hard-coded default of 72. + - Clean up manpage and document new -w, -columns option. + + -- Decklin Foster Sun, 3 Oct 2004 22:29:18 -0400 + +dadadodo (1.04-1) unstable; urgency=low + + * New upstream release + * Added patch by Brenton Stone to add -w option. (Closes: #239295) + * Bumped Standards-Version to 3.6.1 + + -- Decklin Foster Sat, 2 Oct 2004 11:47:50 -0400 + +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.04.orig/debian/control +++ dadadodo-1.04/debian/control @@ -0,0 +1,14 @@ +Source: dadadodo +Section: text +Priority: optional +Maintainer: Decklin Foster +Standards-Version: 3.8.0 + +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.04.orig/debian/local/README.Debian +++ dadadodo-1.04/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.04.orig/debian/local/dadadodo.1 +++ dadadodo-1.04/debian/local/dadadodo.1 @@ -0,0 +1,70 @@ +.TH dadadodo 1 +.SH "NAME" +dadadodo \- exterminate all rational thought +.SH "SYNOPSIS" +.B dadadodo +[ +.I options +] [ +.I input\-files +] +.SH "DESCRIPTION" +.B dadadodo +is a program that analyses texts for Markov chains of word probabilities +and then generates random sentences based on those probabilities. +Sometimes these sentences are nonsense, but sometimes they cut right +through to the heart of the matter and reveal hidden meanings. +.SH "OPTIONS" +.B dadadodo +accepts the following options: +.TP +.B \-c, \-count \fIn\fP +Generate \fIn\fP sentences. +.TP +.B \-h, \-help +Show summary of options and exit. +.TP +.B \-html +Output HTML instead of plain text. +.TP +.B \-l, \-load \fIfile\fP +Load compiled data from \fIfile\fP (\(oq\-\(cq for standard input). +.TP +.B \-o, \-output \fIfile\fP +Save compiled data in \fIfile\fP (\(oq\-\(cq for standard output). +.TP +.B \-p, \-pause \fIs\fP +Delay \fIs\fP seconds between paragraphs. +.TP +.B \-w, \-columns \fIcolumns\fP +Format output for a device +.I columns +character cells in width. +If not specified, the value of the environment variable +.B COLUMNS +is used to determine the width. +If that variable is not defined, a width of 72 is assumed. +.SH "NOTES" +Non\-option 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. +However, loading a saved file is far faster than re\-parsing the text files +each time. +.SH "ENVIRONMENT" +.TP +.B COLUMNS +Determines the width (in character cells) of the output if the +.B \-w, \-columns +option is not used. If not set, a width of 72 is assumed. +.SH "SEE ALSO" +.BR dadadodo 's +upstream website is +.IR "http://www.jwz.org/dadadodo/" . +.SH AUTHOR +.B dadadodo +was written by Jamie Zawinski. +.PP +This manual page was written by Sudhakar Chandrasekharan +, based on the program's usage message. --- dadadodo-1.04.orig/debian/patches/02_width.dpatch +++ dadadodo-1.04/debian/patches/02_width.dpatch @@ -0,0 +1,104 @@ +#!/bin/sh -e +## 10_width by Brenton Stone +## +## DP: No description + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ + +--- dadadodo-1.04/dadadodo.c~ 2004-10-03 18:52:26.000000000 -0500 ++++ dadadodo-1.04/dadadodo.c 2004-10-03 19:14:20.000000000 -0500 +@@ -779,6 +779,7 @@ Options include:\n\ + -o or -output file to save compiled data in (- for stdout)\n\ + -l or -load file of compiled data to load (- for stdin)\n\ + -c or -count how many sentences to generate (0 = inf)\n\ ++ -w or -columns how many columns wide the output should be\n\ + -p or -pause delay between paragraphs\n\ + -html output HTML instead of plain-text.\n\ + \n\ +@@ -803,6 +804,8 @@ main (int argc, char **argv) + int n_input = 0; + int count = -1; + int pause = 1; ++ int columns; ++ char *columns_str = NULL; + int html_p = 0; + const char ** input = (const char **) malloc (argc * sizeof(*input)); + char *output = 0; +@@ -838,6 +841,15 @@ main (int argc, char **argv) + } + count = atoi(argv[++i]); + } ++ else if (!strcmp(sw, "-w") || !strcmp(sw, "-columns")) ++ { ++ if (i+1 >= argc) ++ { ++ usage(argv[0]); ++ exit(1); ++ } ++ columns_str = argv[++i]; ++ } + else if (!strcmp(sw, "-p") || !strcmp(sw, "-pause")) + { + if (i+1 >= argc) +@@ -869,6 +881,25 @@ main (int argc, char **argv) + } + } + ++ /* ++ * Set the column width of the output. Prefer the command-line option if ++ * it is present. Fall back to the COLUMNS environment variable. If ++ * that is not available either, use 72 as the default. ++ */ ++ if (columns_str == NULL) ++ { ++ columns_str = getenv("COLUMNS"); ++ } ++ ++ if (columns_str != NULL) ++ { ++ columns = atoi(columns_str); ++ } ++ else ++ { ++ columns = 72; ++ } ++ + if (n_input == 0 && !output && !load) + { + usage(argv[0]); +@@ -1087,7 +1118,7 @@ main (int argc, char **argv) + int words = 0; + int n = 0; + int indent = 0; +- int fill_column = 72; ++ int fill_column = columns; + int sidebar_p = 0; + int sidebar_words = 0; + int number_p = 0; +@@ -1107,7 +1138,7 @@ main (int argc, char **argv) + if (RAND(3) == 0) + indent = RAND(4) * 4; + +- fill_column = 72; ++ fill_column = columns; + if (indent && (RAND(2) == 0)) + fill_column -= indent; + --- dadadodo-1.04.orig/debian/patches/01_setlocale.dpatch +++ dadadodo-1.04/debian/patches/01_setlocale.dpatch @@ -0,0 +1,45 @@ +#! /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 + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ + +--- dadadodo-1.04.orig/dadadodo.c 21 Feb 1998 19:55:58 -0000 ++++ dadadodo-1.04/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.04.orig/debian/patches/00list +++ dadadodo-1.04/debian/patches/00list @@ -0,0 +1,2 @@ +01_setlocale +02_width