--- polygen-1.0.6.ds2.orig/debian/polygen.manpages +++ polygen-1.0.6.ds2/debian/polygen.manpages @@ -0,0 +1 @@ +polygen.1 --- polygen-1.0.6.ds2.orig/debian/changelog +++ polygen-1.0.6.ds2/debian/changelog @@ -0,0 +1,190 @@ +polygen (1.0.6.ds2-8) unstable; urgency=low + + * rebuild against OCaml 3.11.1 + * bump Standards-Version to 3.8.2 (no changes needed) + * bump debhelper compatibility level to 5 (minimum non-deprecated) + + -- Stefano Zacchiroli Sun, 05 Jul 2009 17:20:13 +0200 + +polygen (1.0.6.ds2-7) unstable; urgency=low + + [ Stefano Zacchiroli ] + * rebuild against OCaml 3.11 + - add build-dep on dh-ocaml (ships the CDBS rules file) + * bump Standards-version to 3.8.0 (no changes needed) + * debian/rules: use ocaml.mk as a CDBS "rules" snippet + * debian/control: add missing ${misc:Depends} substvars + * debian/copyright: refer to version-ful common license file + * debian/*postinst: do not ignore script exit code + + [ Stephane Glondu ] + * Switching packaging to git + + -- Stefano Zacchiroli Thu, 05 Mar 2009 20:27:28 +0100 + +polygen (1.0.6.ds2-6) unstable; urgency=low + + * Compiled with OCaml 3.10.2. + * Added myself to Uploaders. + + -- Ralf Treinen Mon, 19 May 2008 22:47:33 +0200 + +polygen (1.0.6.ds2-5) unstable; urgency=low + + [ Stephane Glondu ] + * rm polygen binary upon clean, fix FTBFS if built twice in a row + (Closes: #424323) + + -- Stefano Zacchiroli Fri, 21 Mar 2008 16:48:38 +0100 + +polygen (1.0.6.ds2-4) unstable; urgency=medium + + * rebuild with ocaml 3.10.1, bump urgency for the transition + * set Maintainer to d-o-m, me and Enrico as Uploaders + * add Homepage field to debian/control + * fix vcs-svn field to point just above the debian/ dir + * bump standards-version (no changes needed) + + -- Stefano Zacchiroli Sun, 02 Mar 2008 12:25:12 +0100 + +polygen (1.0.6.ds2-3) unstable; urgency=low + + * rebuild against OCaml 3.10 + * debian/control + - adding me as an Uploader + - bump Standards-Version to 3.7.2, no changes needed + - cdbs, debhelper & co should be build-dep, not -indep + * debian/watch + - add watch file + * debian/rules + - use the ocaml.mk CDBS class instead of manually fiddling with 'ocamlc + -where' and $(OCAMLABI) + + -- Stefano Zacchiroli Mon, 10 Sep 2007 09:15:49 +0200 + +polygen (1.0.6.ds2-2) unstable; urgency=low + + * Fixed a bashism in the makefile. Closes: bug#396902. + * Remove compiled grammar in debian/rules clean. Closes: bug#397960. + + -- Enrico Zini Thu, 16 Nov 2006 15:27:22 +0100 + +polygen (1.0.6.ds2-1) unstable; urgency=low + + * Try to find grammars according to locales + * Split grammar search into a separate polyrun script packaged in + polygen-data + * Package Debian grammars in eng/debian + + -- Enrico Zini Sun, 1 Oct 2006 14:20:31 +0200 + +polygen (1.0.6.ds1-4) unstable; urgency=low + + * Recompiled with new ocaml. Closes: #370217. + + -- Enrico Zini Wed, 7 Jun 2006 22:16:36 +0200 + +polygen (1.0.6.ds1-3) unstable; urgency=low + + * Recompiled with ocaml 3.09.0-4, which broke dependencies once again but is + supposed to solve all dependency problems. Closes: #348247. + + -- Enrico Zini Mon, 16 Jan 2006 21:52:49 +0100 + +polygen (1.0.6.ds1-2) unstable; urgency=low + + * Added new patch 05-8bit-strings.diff to make polygen accept UTF-8 + strings. + + -- Enrico Zini Sat, 31 Dec 2005 11:41:01 +0800 + +polygen (1.0.6.ds1-1) unstable; urgency=low + + * Repackaged upstream .zip files, and added .ds1 to the version to mark this + Debian change to the upstream version. + * Updated build-deps to work with the new Ocaml, thanks to Julien Cristau. + Closes: #338049. + * New grammars from upstream. + * Fixed typo in description. Closes: #306908. + + -- Enrico Zini Mon, 21 Nov 2005 21:06:32 +0100 + +polygen (1.0.6-9) unstable; urgency=high + + * Directly install the .grm.o files built at build time, and remove the need + for postinst and postrm. It removes the annoying delays at install time, + and really closes: #325468. + * Urgency set to high since we close a security bug (hopefully for real this + time). + * Need a postinst to compensate for previously existing broken postrm from + previous polygens + + -- Enrico Zini Wed, 31 Aug 2005 13:34:20 +0200 + +polygen (1.0.6-8) unstable; urgency=high + + * Added a patch to honor umask when creating .grm.o files. + Closes: #325468. + * Urgency set to high since we close a security bug. + * Bumped Standards-version. + + -- Enrico Zini Mon, 29 Aug 2005 16:51:08 +0200 + +polygen (1.0.6-7) unstable; urgency=high + + * Make the polygen-data manpage build script executable before using it. + diff doesn't preserve permissions, so the +x bit is not kept while + packaging; that's a mismatch between how dpkg-buildpackage works and how + one would expect it to work. Closes: #306113. + * Urgency is high because of the ongoing ocaml transition. + + -- Enrico Zini Sun, 24 Apr 2005 13:43:11 +0200 + +polygen (1.0.6-6) unstable; urgency=low + + * Autogenerate polygen-data manpage. Closes: #301454. + + -- Enrico Zini Fri, 22 Apr 2005 02:29:30 +0200 + +polygen (1.0.6-5) unstable; urgency=low + + * Finally added README.Debian + * Changed Ocaml dependencies. Closes: #300848. + + -- Enrico Zini Wed, 23 Mar 2005 23:21:24 +0100 + +polygen (1.0.6-4) unstable; urgency=low + + * Recommend polygen-data. Closes: #288695. + * Fixed package description + + -- Enrico Zini Sun, 23 Jan 2005 15:47:19 +0800 + +polygen (1.0.6-3) unstable; urgency=low + + * Removed bashism in postinst + * Added postrm to get rid of precompiled grammar objects. Closes: #284903. + * Depend on ocaml-base-nox | ocaml-base. Closes: #284913. + + -- Enrico Zini Tue, 14 Dec 2004 00:39:11 +0800 + +polygen (1.0.6-2) unstable; urgency=low + + * Updated build-dependencies to include cdbs and unzip + + -- Enrico Zini Thu, 25 Nov 2004 23:27:19 +0100 + +polygen (1.0.6-1) unstable; urgency=low + + * Initial release. Closes: #271804 + * Added 3 patches: + 01-dont-regenerate-existing-ofiles.diff + Don't try to regenerate precompiled grammars if they exist already + 02-search-for-grammars.diff + Search for grammars in various obvious places if the file given as a + parameter is not found + 03-makefile.diff + Fix the build system to correctly generate a bytecode arch-independent + executable + + -- Enrico Zini Tue, 23 Nov 2004 23:05:37 +0100 --- polygen-1.0.6.ds2.orig/debian/install-grammars +++ polygen-1.0.6.ds2/debian/install-grammars @@ -0,0 +1,22 @@ +#!/bin/sh -eu + +SRCDIR=$1 +DSTDIR=$2 + +INSTALLDIR="install -o root -g root -m 755 -d" +INSTALLFILE="install -o root -g root -m 644" + +# Create destination directories +$INSTALLDIR $DSTDIR ;\ +find $SRCDIR -type d -printf "%P\n" | while read DIR +do + $INSTALLDIR "$DSTDIR/$DIR" +done + +# Scan source files and install them +find $SRCDIR -type f -name "*.grm*" -printf "%P\n" | while read FILE +do + $INSTALLFILE "$SRCDIR/$FILE" "$DSTDIR/$FILE" +done + +exit 0 --- polygen-1.0.6.ds2.orig/debian/compat +++ polygen-1.0.6.ds2/debian/compat @@ -0,0 +1 @@ +5 --- polygen-1.0.6.ds2.orig/debian/make_polygen-data_manpage +++ polygen-1.0.6.ds2/debian/make_polygen-data_manpage @@ -0,0 +1,112 @@ +#!/usr/bin/perl -w + +# Generate the polygen-data manpage, scanning the grammar files whose name is +# supplied on stdin. +# +# Copyright: (C) 2005 Enrico Zini +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# On Debian systems, the complete text of the GNU General Public License can be +# found in /usr/share/common-licenses/GPL file. + +use strict; +use warnings; +use File::Basename; + +our $POLYGEN = ($ENV{POLYGEN} or "polygen"); + +sub extract_metadata ($) +{ + my ($file) = @_; + my %res; + + # Read the grammar + open(IN, "$POLYGEN -info '$file'|") or die "Cannot run $POLYGEN -info '$file': $!"; + my $lastfield; + while () + { + chop; + if (/^([^:]+):\s*(.+?)\s*$/) + { + $res{$1} = $2; + $lastfield = $1; + } elsif (/^\s*$/) { + } else { + if (defined $lastfield) + { + $res{$lastfield} .= "\n".$_; + } else { + die "UNPARSED in $file: $_\n"; + } + } + } + close(IN); + + return \%res; +} + +print q{ +.TH POLYGEN-DATA 6 +.SH NAME +polygen-data \- assorted polygen grammars +.SH SYNOPSIS +.B polygen \fIgrammar\fP +.SH "DESCRIPTION" +All of these grammars output all sort of strange and out\-of\-control things. +No personal, racial, societal slurs are intended. For amusement only. +.P +You can find out more information about a grammar with the command +.B polygen -info \fIgrammar\fP +}; + +my %langnames = ( + fra => "French", + ita => "Italian", + eng => "English" +); + +my %langs; + +while (my $file = <>) +{ + chop($file); + + my ($name, $path) = fileparse($file); + + $path =~ s/(.+\/)?(.+)\/$/$2/; + + my $md = extract_metadata($file); + $md->{filename} = $name; + + push(@{$langs{$path}}, $md); + +} + +for my $lang ('eng', 'ita', 'fra') +{ + print ".SS ", $langnames{$lang}, " grammars\n"; + + for my $md (@{$langs{$lang}}) + { + print ".IP ", $md->{filename}, "\n"; + print $md->{title}, "\n"; + } +} + +print q{ +.SH "SEE ALSO" +polygen(1) +.SH AUTHORS +Polygen has been written by Manta. +.P +These grammars have been written by various contributors. Run \fBpolygen +-info\fP \fIgrammar\fP to see informations about their authors. +}; --- polygen-1.0.6.ds2.orig/debian/README.Debian +++ polygen-1.0.6.ds2/debian/README.Debian @@ -0,0 +1,40 @@ +README for the Polygen Debian package +===================================== + +Polygen is... + + ...the tool everybody was so anxiously expecting. + - Daily Telegraph + + The solution to all occultism problems. + - Harold Tribune + + ...the finest product ever designed for alpinism. + - The Sun + + The ultimate solution to all problems. No way to miss it. + - GirlPower + + +Polygen is fun. + +It's even more fun if you start creating your own grammars. + +If you want to play, you can have a look at the existing grammars in +/usr/share/polygen, and keep /usr/share/doc/polygen/HOWTO-Refman.en.html as a +reference. + +If you happen to create some nice grammars, don't forget to send them to me! +You can do it nicely with reportbug: + + reportbug -kA mygrammar.grm polygen + +I'll take care of forwarding your grammars to the upstream authors, and they +will include them in the next polygen-data and in the wonderful website +www.polygen.org + + +Enjoy your Polygen, Trombygen, Polliflex, Sporkysnell, Polpycess! + +--- +Enrico Zini --- polygen-1.0.6.ds2.orig/debian/polygen-data.manpages +++ polygen-1.0.6.ds2/debian/polygen-data.manpages @@ -0,0 +1,2 @@ +polygen-data.6 +debian/polyrun.1 --- polygen-1.0.6.ds2.orig/debian/rules +++ polygen-1.0.6.ds2/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/rules/ocaml.mk + +POLYGEN_BASE=. +DEB_BUILDDIR=$(POLYGEN_BASE)/src +POLYGEN=$(DEB_BUILDDIR)/polygen +export POLYGEN + +# set $(NATIVE) to true if this arch has an optimising compiler +#NATIVE := $(shell test -x /usr/bin/ocamlopt.opt && echo true || echo false) +# Forcing native to false to have a Architecture: all package, since polygen +# doesn't have special optimization requirements +NATIVE := false + +# No toplevel makefile: we'll add a -C to the make invocation +#DEB_MAKE_BUILD_TARGET+="-Csrc" + +# If we have the optimising compiler, build natively with debugging because +# we can strip it later. if we don't, disable debugging because stripping +# the non-native binaries removes the bytecode and leaves you with the +# interpreter, and a somewhat useless binary... =) + +DEB_MAKE_BUILD_TARGET+="NATIVE=$(NATIVE)" +DEB_STRIP_EXCLUDE+=polygen + +#ifeq ($(NATIVE), true) +#DEB_MAKE_BUILD_TARGET+="MLC=ocamlopt" +#else +#DEB_MAKE_BUILD_TARGET+="MLC=ocamlc" +#DEB_MAKE_BUILD_TARGET+="MLCOPTS=-unsafe" +#DEB_MAKE_BUILD_TARGET+="MLLDOPTS=unix.cma" +#DEB_STRIP_EXCLUDE+=polygen +#endif + +# Hook in the build system the creation of the manpage +# Invoking polygen to extract the metadata from the grammars will also generate +# the .grm.o files, that we can later install. +build/polygen:: + $(POLYGEN) debian/man.grm > polygen.1 + chmod 0755 debian/make_polygen-data_manpage + find $(POLYGEN_BASE)/grm/ -name \*.grm | debian/make_polygen-data_manpage > polygen-data.6 + +install/polygen:: + install -o root -g root -m 755 $(POLYGEN) debian/$(cdbs_curpkg)/usr/bin/ + install -o root -g root -m 755 -d debian/$(cdbs_curpkg)/usr/share/doc/polygen + install -o root -g root -m 644 $(POLYGEN_BASE)/eng/HOWTO-Refman.html debian/$(cdbs_curpkg)/usr/share/doc/polygen/HOWTO-Refman.en.html + install -o root -g root -m 644 $(POLYGEN_BASE)/ita/HOWTO-Refman.html debian/$(cdbs_curpkg)/usr/share/doc/polygen/HOWTO-Refman.it.html + install -o root -g root -m 644 $(POLYGEN_BASE)/README debian/$(cdbs_curpkg)/usr/share/doc/polygen/README + install -o root -g root -m 644 $(POLYGEN_BASE)/Credits debian/$(cdbs_curpkg)/usr/share/doc/polygen/Credits + +install/polygen-data:: + # grammar data files + install -o root -g root -m 755 debian/polyrun debian/$(cdbs_curpkg)/usr/bin/ + chmod 0755 debian/install-grammars + debian/install-grammars $(POLYGEN_BASE)/grm/ita debian/$(cdbs_curpkg)/usr/share/polygen/ita + debian/install-grammars $(POLYGEN_BASE)/grm/eng debian/$(cdbs_curpkg)/usr/share/polygen/eng + debian/install-grammars $(POLYGEN_BASE)/grm/fra debian/$(cdbs_curpkg)/usr/share/polygen/fra + +clean:: + rm -f debian/man.grm.o polygen.1 polygen-data.6 debian/polyfind.1 src/polygen + find $(POLYGEN_BASE)/grm/ -name \*.grm.o -exec rm "{}" ";" --- polygen-1.0.6.ds2.orig/debian/NEWS +++ polygen-1.0.6.ds2/debian/NEWS @@ -0,0 +1,18 @@ +polygen (1.0.6.ds2-1) unstable; urgency=low + + In order to keep the polygen binary as close as possible to the one upstream + distributes, the Debian-specific extension that would have polygen look for + grammar candidates in /usr/share/polygen has been moved to a wrapper script + called polyrun. + + As a consequence, for most polygen invocations you should now use polyrun + instead of polygen. + + To compensate you from the trouble of this change, this upload of polygen + finally ships in /usr/share/polygen/eng/debian the grammars from + http://people.debian.org/~enrico/polygen-debian. + + I extend you my apologies by way of "polyrun sorry", which you are invited + to run as many time as you like, to your full satisfaction :) + + -- Enrico Zini Mon, 2 Oct 2006 14:57:41 +0200 --- polygen-1.0.6.ds2.orig/debian/copyright +++ polygen-1.0.6.ds2/debian/copyright @@ -0,0 +1,26 @@ +PolyGen was packaged for Debian by Enrico Zini +on Wed Sep 15 13:43:37 CEST 2004 + +It was downloaded from: + http://polygen.org/web/Download.424.0.html + +Upstream author: Alvise Spanò + +Copyright (C) 2002-03 Alvise Spanò + +The grammar files are copyright of their respective authors, as indicated +inside the grammar file. + +License: + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +On Debian systems, the complete text of the GNU General Public License can be +found in /usr/share/common-licenses/GPL-2 file. --- polygen-1.0.6.ds2.orig/debian/man.grm +++ polygen-1.0.6.ds2/debian/man.grm @@ -0,0 +1,71 @@ +I ::= "title: Polygen manpage\n" + ^ "author: Enrico Zini <enirco@debian.org>\n" + ^ "language: english\n" + ^ "status: embryonic\n" + ^ "topic: polygen\n" + ^ "comment: The generated manpage is still incomplete.\n" + ^ "created: 15/09/2004" +; + +S ::= ".TH POLYGEN 1 \"September 15, 2004\"\n" + ^ ".SH NAME\n" + ^ Name "\n" + ^ ".SH SYNOPSIS\n" + ^ ".B polygen\n" + ^ ".RI [options]\nsources\n" + ^ ".SH DESCRIPTION\n" + ^ Description "\n" + ^ ".SH OPTIONS\n" + ^ "Please run \\fBpolygen\\fP without parameters for an explanation on how to run \\fBpolygen\\fP.\n" + ^ ".SH SEE ALSO\n" + ^ "polygen-data(6),\n" + ^ "http://www.pdos.lcs.mit.edu/scigen/\n" + ^ ".SH AUTHOR\n" + ^ Author +; + +Name ::= Polygen "-" ShortDesc + ; + +Polygen ::= "Polygen" + ; + +ShortDesc ::= Polygen "is a" Whatis "for" Whatitdoes Howitdoes + ; + +Whatis ::= Attribute ( "program" | "tool" | "system" | "gadget" ) + ; + +Attribute ::= ( _ | "powerful" | ^"n advanced" | ^"n innovative" ) + ; + +Whatitdoes ::= ( "generating" | "creating" | "bursting out" | "computing" ) + Random + ( "sentences" | "wisdom" | "nonsense" ) + ; + +Random ::= ( "random" | "deep" | "enlightening" | "zen" | "casual" | "accidental" | "aleatory" | "automatic" | "capricious" | "causeless" | "chancy" | "circumstantial" | "cool" | "cursory" | "destinal" | "desultory" | "dicey" | "erratic" | "extemporaneous" | "flippant" | "fluky" | "flunky" | "fortuitous" | "frivolous" | "gratuitous" | "iffy" | "improvised" | "incidental" | "serendipitous" | "spontaneous" | "stochastic" | "superfluous" | "thoughtless" | "unconscious" ) + ; + +Howitdoes ::= "according to a grammar definition, that is following custom syntactical and lexical rules." + ; + +Description ::= ShortDesc "\n.PP\n" + ^ "Formally, it is an interpreter of a language itself designed to define languages, where to interpret means executing a source program in real time and eventually outputting its result." + ^ "\n.PP\n" + ^ "Here a source program is a grammar definition, the execution consists in the exploration of such grammar by selecting a random path and the result is the sentence built on the way." + ^ "\n.PP\n" + ^ "Though PolyGen is quite a seriuos piece of software then, what else would be more noble for it than being used as a parody tool for linguistical habits, stereotypes and trends of this foolish era?" + ^ "\n.PP\n" + ^ "Principles of parody are focusing a ridiculous topic and eventually abstracting its rules and schemes (here in terms of a grammar definition) by which reproducing it through the variatio device." + ^ "\n.PP\n" + ^ "And randomization is perfect at this purpose thanks to its purely asemantic behaviour =:)" + ; + +Author ::= "Manta" + ^ "\n.PP\n" + ^ "This manpage has been generated after instructions given by Enrico Zini ." + ; + + + --- polygen-1.0.6.ds2.orig/debian/watch +++ polygen-1.0.6.ds2/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.polygen.org/gs/dist/polygen-(.*)-\d+-src.zip --- polygen-1.0.6.ds2.orig/debian/polygen.dirs +++ polygen-1.0.6.ds2/debian/polygen.dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc --- polygen-1.0.6.ds2.orig/debian/polygen-data.links +++ polygen-1.0.6.ds2/debian/polygen-data.links @@ -0,0 +1,2 @@ +usr/bin/polyrun usr/bin/polyfind +usr/share/man/man1/polyrun.1 usr/share/man/man1/polyfind.1 --- polygen-1.0.6.ds2.orig/debian/polygen-data.dirs +++ polygen-1.0.6.ds2/debian/polygen-data.dirs @@ -0,0 +1 @@ +usr/bin --- polygen-1.0.6.ds2.orig/debian/polyrun +++ polygen-1.0.6.ds2/debian/polyrun @@ -0,0 +1,86 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use File::Find; +use File::Basename; + + +my $GRMDIR='/usr/share/polygen'; + +my %langmap = ( + it => "ita", + en => "eng", + fr => "fra" +); + +# Get the preferred polygen language directory from the current locale +sub getlang () +{ + my $lang = $ENV{LC_MESSAGES}; + $lang = $ENV{LANG} if not $lang; + $lang =~ s/_.+$//; + return "eng" if not exists $langmap{$lang}; + return $langmap{$lang}; +} + +# Looks for the best absolute path for the given grammar +sub grmfind ($) +{ + my $name = shift; + my @cand = ( $name, "$name.grm" ); + my $l = getlang(); + if (defined $l) + { + push @cand, "$GRMDIR/$l/$name"; + push @cand, "$GRMDIR/$l/$name.grm"; + } + + # First try the parameter by itself + for my $pn (@cand) + { + return $pn if -e $pn; + } + + my @dirs; + find({wanted => sub { + push @dirs, $File::Find::name if -d $File::Find::name; + }, + no_chdir => 1, + }, '/usr/share/polygen'); + + for my $d (@dirs) + { + return "$d/$name" if -e "$d/$name"; + return "$d/$name.grm" if -e "$d/$name.grm"; + } + return undef; +} + +my $scriptname = basename($0); + +if ($scriptname eq 'polyfind') +{ + if (@ARGV) { + print grmfind($ARGV[0]), "\n"; + } else { + print STDERR "Usage: $scriptname grammar"; + } +} +else +{ + if (@ARGV) { + my $grm = grmfind($ARGV[$#ARGV]); + if (not defined $grm) + { + print STDERR $ARGV[$#ARGV], ": grammar not found\n"; + exit 1; + } + exec 'polygen', $grm + + } else { + exec 'polygen'; + } +} + +exit 0; --- polygen-1.0.6.ds2.orig/debian/control +++ polygen-1.0.6.ds2/debian/control @@ -0,0 +1,66 @@ +Source: polygen +Section: games +Priority: optional +Maintainer: Debian OCaml Maintainers +Uploaders: + Enrico Zini , + Stefano Zacchiroli , + Ralf Treinen +Build-Depends: + debhelper (>= 5.0.0), + dh-ocaml, + ocaml-nox, + cdbs +Standards-Version: 3.8.2 +Homepage: http://polygen.org/web/index.html +Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/polygen.git +Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/polygen.git + +Package: polygen +Architecture: all +Depends: + ${shlibs:Depends}, + ocaml-base-nox-${F:OCamlABI}, + ${misc:Depends} +Recommends: polygen-data +Description: generator of random sentences from grammar definitions + PolyGen is a program for generating random sentences according to a grammar + definition, that is following custom syntactical and lexical rules. + . + Formally, it is an interpreter of a language itself designed to define + languages, where to interpret means executing a source program in real time + and eventually outputting its result. + . + Here a source program is a grammar definition, the execution consists in the + exploration of such grammar by selecting a random path and the result is the + sentence built on the way. + . + Though PolyGen is quite a serious piece of software then, what else would be + more noble for it than being used as a parody tool for linguistical habits, + stereotypes and trends of this foolish era? + . + Principles of parody are focusing a ridiculous topic and eventually + abstracting its rules and schemes (here in terms of a grammar definition) by + which reproducing it through the variatio device. And randomization is + perfect at this purpose thanks to its purely asemantic behaviour =:) + + +Package: polygen-data +Architecture: all +Depends: + polygen, + perl-modules, + ${misc:Depends} +Description: grammar definitions for PolyGen + PolyGen is a program for generating random sentences according to a grammar + definition, that is following custom syntactical and lexical rules. + . + Formally, it is an interpreter of a language itself designed to define + languages, where to interpret means executing a source program in real time + and eventually outputting its result. + . + Here a source program is a grammar definition, the execution consists in the + exploration of such grammar by selecting a random path and the result is the + sentence built on the way. + . + This package contains various grammar files suited for polygen. --- polygen-1.0.6.ds2.orig/debian/polyrun.1 +++ polygen-1.0.6.ds2/debian/polyrun.1 @@ -0,0 +1,32 @@ +.TH POLYRUN 1 "October 2, 2006" +.SH NAME +polyrun, polyfind \- Find polygen grammars and run polygen +.SH SYNOPSIS +.B polyrun +.RI [options] +grammar +.br +.B polyfind +.RI grammar +.SH DESCRIPTION +\fBpolyrun\fP runs \fBpolygen\fP expanding the given grammar name into its full path, +so that \fBpolygen\fP can find it. +.P +Grammars (which can be specified with partial paths, such as \fIdebian/flame\fP) +are searched in the current directory first, then in a subdirectory of +\fI/usr/share/polygen\fP according to the current locale settings, then +recursively under \fI/usr/share/polygen\fP and all its subdirectories. +Grammars can be specified with or without the \fI.grm\fP extension. +.P +\fBpolyfind\fP just looks for the full pathname of the given grammar and prints +it on standard output. +.SH OPTIONS +\fBpolyrun\fP is a wrapper to \fBpolygen\fP, and the options are passed to \fBpolygen\fP as-is. +.P +\fBpolyfind\fP only takes the grammar name as argument. +.SH SEE ALSO +polygen(1), +polygen-data(6) +.SH AUTHOR +\fBpolyrun\fP/\fBpolyfind\fP and this manpage are written and maintained by +enrico@enricozini.org. --- polygen-1.0.6.ds2.orig/debian/polygen-data.postinst +++ polygen-1.0.6.ds2/debian/polygen-data.postinst @@ -0,0 +1,13 @@ +#!/bin/sh +set -e +#set +C # turn off noclobber +if [ ! -e /usr/share/polygen/ita/polygen.grm.o ] +then + echo -n "Generating grammar objects..." + # Set the right umask + umask 0022 + find /usr/share/polygen/ -type f -iname '*.grm' ! -iname '*.grm.o' -exec polygen "{}" \; > /dev/null + echo "done." +fi + +#DEBHELPER# --- polygen-1.0.6.ds2.orig/debian/patches/01-dont-regenerate-existing-ofiles.diff +++ polygen-1.0.6.ds2/debian/patches/01-dont-regenerate-existing-ofiles.diff @@ -0,0 +1,21 @@ +--- polygen-1.0.6/src/main.ml 2004-06-25 11:58:00.000000000 +0200 ++++ polygen-1.0.6/src/main.ml 2004-11-23 19:44:14.000000000 +0100 +@@ -150,10 +176,14 @@ + done; + + (* store compiled grammar *) +- try +- msg "storing compiled grammar..."; +- store_obj source decls +- with Failure s -> msg s ++ if (Sys.file_exists(source^".o") = false) ++ then ++ begin ++ try ++ msg "storing compiled grammar..."; ++ store_obj source decls ++ with Failure s -> msg s ++ end + ;; + + --- polygen-1.0.6.ds2.orig/debian/patches/05-8bit-strings.diff +++ polygen-1.0.6.ds2/debian/patches/05-8bit-strings.diff @@ -0,0 +1,16 @@ +--- polygen-1.0.6/src/lexer.mll 2005-11-21 20:21:00.000000000 +0100 ++++ polygen-1.0.6/src/lexer.mll 2005-12-11 23:44:49.000000000 +0100 +@@ -24,12 +24,7 @@ + let c = String.make 1 (char_of_int (int_of_string s)) + in + c ^ (quote lexbuf) } +- +- | ['a'-'z' 'A'-'Z' '0'-'9' '!' '£' '$' '%' '&' '/' '(' ')' '=' '?' '^' '\'' +- '[' ']' '*' '+' '@' '#' '<' '>' ',' '.' '-' ';' ':' '_' '{' '}' '`' '~' +- '|' ' '] { let s = Lexing.lexeme lexbuf in s ^ (quote lexbuf) } +- +- | _ { raise (Failure ("illegal character '" ^ (String.escaped (Lexing.lexeme lexbuf)) ^ "' within quote")) } ++ | _ { let s = Lexing.lexeme lexbuf in s ^ (quote lexbuf) } + + and comment = parse + "*)" { token lexbuf } --- polygen-1.0.6.ds2.orig/debian/patches/04-create-mode.diff +++ polygen-1.0.6.ds2/debian/patches/04-create-mode.diff @@ -0,0 +1,16 @@ +--- polygen-1.0.6/src/io.ml 2004-06-25 10:38:35.000000000 +0200 ++++ polygen-1.0.6/src/io.ml 2005-08-29 16:28:09.822686120 +0200 +@@ -57,12 +57,11 @@ + let file = source ^ __obj in + try + let tmp = Printf.sprintf "%s.%d" file (Unix.getpid ()) in +- let oc = open_out_gen [Open_wronly; Open_binary; Open_creat; Open_trunc] 0o600 tmp in ++ let oc = open_out_gen [Open_wronly; Open_binary; Open_creat; Open_trunc] 0o666 tmp in + let obj = make_obj data + in + Marshal.to_channel oc obj []; + close_out oc; +- Unix.chmod tmp 0o666; + Unix.rename tmp file + + with Unix.Unix_error (e, _, _) -> --- polygen-1.0.6.ds2.orig/debian/patches/03-makefile.diff +++ polygen-1.0.6.ds2/debian/patches/03-makefile.diff @@ -0,0 +1,80 @@ +--- src/makefile 2005-11-21 21:33:38.000000000 +0100 ++++ src/makefile 2006-11-16 15:43:01.568333250 +0100 +@@ -10,27 +10,37 @@ + VERSION := $(shell cat parser.mli +- @cat <_parser.mli >>parser.mli +- @rm -f _parser.mli ++ # workaround for ocamlyacc "open" lack ++ (echo "open Absyn" ; echo ; cat parser.mli) > _parser.mli ++ @mv _parser.mli parser.mli + + ver.ml: ver.ml.template + sed -e "s/%VERSION%/$(VERSION)/" -e "s/%DATE%/$(DATE)/" ver.ml.template >ver.ml