--- dds-1.1.3+ddd105.orig/debian/patches/ddd-dds.h +++ dds-1.1.3+ddd105/debian/patches/ddd-dds.h @@ -0,0 +1,13 @@ +Index: trunk/ddd/ddd.cpp +=================================================================== +--- trunk.orig/ddd/ddd.cpp 2007-01-19 01:41:17.098116680 +0100 ++++ trunk/ddd/ddd.cpp 2007-01-19 02:12:54.547660504 +0100 +@@ -65,7 +65,7 @@ + + // ----------------------------------------------------------------------------- + +-#include "dds11x.h" ++#include "dds.h" + #include "giblib.h" + #include "timer.h" + --- dds-1.1.3+ddd105.orig/debian/patches/python-keywords +++ dds-1.1.3+ddd105/debian/patches/python-keywords @@ -0,0 +1,29 @@ +Index: trunk/python/pydds.c +=================================================================== +--- trunk.orig/python/pydds.c 2007-01-19 00:56:59.997057440 +0100 ++++ trunk/python/pydds.c 2007-01-19 00:57:09.336637608 +0100 +@@ -207,11 +207,12 @@ deal_str(PyObject *self) + static PyObject* + deal_solve(PyObject *self, PyObject *args, PyObject *kwds) + { +- static char* nams[] = {"trump", "first", NULL}; +- int trump=4, first=1; ++ static char* nams[] = {"trump", "first", "target", "solutions", "mode", NULL}; ++ int trump=4, first=1, target=-1, solutions=1, mode=0; + int i, j; + +- if(!PyArg_ParseTupleAndKeywords(args, kwds, "|ii", nams, &trump, &first)) ++ if(!PyArg_ParseTupleAndKeywords(args, kwds, "|iiiii", nams, ++ &trump, &first, &target, &solutions, &mode)) + return 0; + deal_cell* me = (deal_cell*)self; + struct deal d; +@@ -225,7 +226,7 @@ deal_solve(PyObject *self, PyObject *arg + showdist(d.remainCards); + // printf(" 4"); fflush(0); + struct futureTricks futp; +- int status = SolveBoard(d, -1, 1, 0, &futp); ++ int status = SolveBoard(d, target, solutions, mode, &futp); + // printf(" 5 %d", status); fflush(0); + if (status!=1) { + char buf[80]; --- dds-1.1.3+ddd105.orig/debian/patches/ddd-dds112-fix +++ dds-1.1.3+ddd105/debian/patches/ddd-dds112-fix @@ -0,0 +1,14 @@ +Index: trunk/ddd/ddd.cpp +=================================================================== +--- trunk.orig/ddd/ddd.cpp 2007-02-19 16:14:35.417214872 +0100 ++++ trunk/ddd/ddd.cpp 2007-02-19 16:16:39.413364592 +0100 +@@ -373,9 +373,6 @@ void cleanSB() + if(bestMove) + free(bestMove); + bestMove = 0; +- if(heurTable) +- free(heurTable); +- heurTable = 0; + if(nodeCards) + free(nodeCards); + nodeCards = 0; --- dds-1.1.3+ddd105.orig/debian/patches/ddd-gibware-url +++ dds-1.1.3+ddd105/debian/patches/ddd-gibware-url @@ -0,0 +1,13 @@ +Index: trunk/ddd/readme.txt +=================================================================== +--- trunk.orig/ddd/readme.txt 2007-01-19 02:18:30.018661160 +0100 ++++ trunk/ddd/readme.txt 2007-01-19 02:18:35.813780168 +0100 +@@ -39,6 +39,8 @@ Two sample files are provided --- test.g + You can get the huge giblib file from the gibware site, + Note that it must be the text version, not the binary version. + ++http://www.cirl.uoregon.edu/ginsberg/gibresearch.html ++ + Compile and Link + ---------------- + --- dds-1.1.3+ddd105.orig/debian/patches/ifdef-win32 +++ dds-1.1.3+ddd105/debian/patches/ifdef-win32 @@ -0,0 +1,20 @@ +Index: trunk/dds.cpp +=================================================================== +--- trunk.orig/dds.cpp 2007-03-12 16:38:03.000000000 +0100 ++++ trunk/dds.cpp 2007-03-12 16:38:05.000000000 +0100 +@@ -68,6 +68,7 @@ int cancelStarted=FALSE; + int threshold=CANCELCHECK; + #endif + ++#if defined(_WIN32) + extern "C" BOOL APIENTRY DllMain(HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved) { +@@ -90,6 +91,7 @@ extern "C" BOOL APIENTRY DllMain(HMODULE + } + return 1; + } ++#endif + + + int STDCALL SolveBoard(struct deal dl, int target, --- dds-1.1.3+ddd105.orig/debian/patches/series +++ dds-1.1.3+ddd105/debian/patches/series @@ -0,0 +1,12 @@ +# dds patches +dds.h +ifdef-win32 + +# pydds patches +fix-pydds +python-keywords +sanitize-trydds.py + +# ddd patches +ddd-dds.h +ddd-gibware-url --- dds-1.1.3+ddd105.orig/debian/patches/sanitize-trydds.py +++ dds-1.1.3+ddd105/debian/patches/sanitize-trydds.py @@ -0,0 +1,48 @@ +Index: trunk/python/trydds.py +=================================================================== +--- trunk.orig/python/trydds.py 2007-01-19 01:02:23.212921160 +0100 ++++ trunk/python/trydds.py 2007-01-19 01:05:49.711528600 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python + + import sys + import pydds +@@ -10,10 +10,10 @@ timer = time.time + def dod(ds): + t = timer() + d = timer() +- # deal = [h.split(' ') for h in ds.split('|')] +- deal = [h.split('.') for h in ds.split()[1::2]] ++ deal = [h.split(' ') for h in ds.split('|')] ++ #deal = [h.split('.') for h in ds.split()[1::2]] + d = timer() - d +- print 'D', 8*'.','|'.join(' '.join(s) for s in deal) ++ #print 'D', 8*'.','|'.join(' '.join(s) for s in deal) + # sys.stdout.flush() + a = timer() + dd = pydds.deal(deal) +@@ -26,17 +26,17 @@ def dod(ds): + b = timer() - b + t = timer() - t + print 'T%d' % s[-1][0], +- print '%.2f %.2f %.2f %.2f' % (d, a, b, t) ++ #print '%.2f %.2f %.2f %.2f' % (d, a, b, t) + # print '|'.join(' '.join(s) for s in deal), + print s + return t + + +-# ds = 'AQ9 AQ9 8643 KQ8|T82 T6542 AKT A7|K653 K83 Q92 543|J74 J7 J75 JT962' +-ds='n AQ3.T653.KQ4.AJ5 e KJT4.AKQ8.JT86.8 s 862.974.A73.KQ72 w 975.J2.952.T9643' +-print ds +-dod(ds) +-sys.exit() ++#ds = 'AQ9 AQ9 8643 KQ8|T82 T6542 AKT A7|K653 K83 Q92 543|J74 J7 J75 JT962' ++##ds='n AQ3.T653.KQ4.AJ5 e KJT4.AKQ8.JT86.8 s 862.974.A73.KQ72 w 975.J2.952.T9643' ++#print ds ++#dod(ds) ++#sys.exit() + + def main(): + handsfile = open('t1') --- dds-1.1.3+ddd105.orig/debian/patches/dds.h +++ dds-1.1.3+ddd105/debian/patches/dds.h @@ -0,0 +1,25 @@ +Index: trunk/dds.cpp +=================================================================== +--- trunk.orig/dds.cpp 2007-02-23 21:10:40.111567936 +0100 ++++ trunk/dds.cpp 2007-02-23 21:11:26.180564384 +0100 +@@ -18,7 +18,7 @@ + /* Foundation, Inc, 51 Franklin Street, 5th Floor, Boston MA 02110-1301, USA. */ + + +-#include "dll.h" ++#include "dds.h" + + int handStore[4][4]; + int nodeTypeStore[4]; +Index: trunk/python/pydds.c +=================================================================== +--- trunk.orig/python/pydds.c 2007-02-23 21:11:35.047216448 +0100 ++++ trunk/python/pydds.c 2007-02-23 21:11:46.981402176 +0100 +@@ -1,6 +1,6 @@ + #include "Python.h" + #include "structmember.h" +-#include "dll.h" ++#include "dds.h" + + #include + #include --- dds-1.1.3+ddd105.orig/debian/patches/fix-pydds +++ dds-1.1.3+ddd105/debian/patches/fix-pydds @@ -0,0 +1,25 @@ +Index: trunk/dll.h +=================================================================== +--- trunk.orig/dll.h 2007-01-19 00:51:25.629888976 +0100 ++++ trunk/dll.h 2007-01-19 00:51:36.562227008 +0100 +@@ -338,7 +338,7 @@ extern FILE * fp2, *fp7, *fp11; + EXTERN_C DLLEXPORT int STDCALL SolveBoard(struct deal dl, + int target, int solutions, int mode, struct futureTricks *futp); + +-void InitStart(void); ++EXTERN_C void InitStart(void); + void InitGame(int gameNo, int moveTreeFlag, int first, int handRelFirst); + void InitSearch(struct pos * posPoint, int depth, + struct moveType startMoves[], int first, int mtd); +Index: trunk/python/pydds.c +=================================================================== +--- trunk.orig/python/pydds.c 2007-01-19 00:19:50.261028840 +0100 ++++ trunk/python/pydds.c 2007-01-19 00:45:21.132301032 +0100 +@@ -332,5 +332,7 @@ initpydds(void) + PyType_Ready(&deal_type); + + PyObject_SetAttrString(m, "deal", (PyObject*)&deal_type); ++ ++ InitStart(); + } + --- dds-1.1.3+ddd105.orig/debian/dds.docs +++ dds-1.1.3+ddd105/debian/dds.docs @@ -0,0 +1,2 @@ +ddd/readme.txt +ddd/giblib.txt --- dds-1.1.3+ddd105.orig/debian/README.Debian +++ dds-1.1.3+ddd105/debian/README.Debian @@ -0,0 +1,15 @@ +dds for Debian +-------------- + +This package is a composition of three zip files, the dds double dummy solver +library, the ddd double dummy driver (frontend), and the pydds python +extension. As there is already a ddd package in Debian (the gdb frontend) both +the ddd binary and the package were renamed to dds. + +There is no shared library yet as the API/ABI is likely to change again. + +pydds was patched to also accept target, solutions, and mode as parameters in +addition to trump and first. Users might want to read the API documentation in +the libdds-dev package. + + -- Christoph Berg Thu, 25 Jan 2007 13:09:48 +0100 --- dds-1.1.3+ddd105.orig/debian/dds.6 +++ dds-1.1.3+ddd105/debian/dds.6 @@ -0,0 +1,158 @@ +.TH DDS 6 +.SH NAME +dds \- double dummy solver frontend +.SH SYNOPSIS +.B dds +.I file +[ +.I options +] +.SH DESCRIPTION +This program is a command line interface for +Bo Haglund's Double Dummy Solver (DDS). +.PP +It has four useful stand-alone options: +.IP 1. +Option \fB\-playdd\fP, to play any deal double dummy. +.IP 2. +Option \fB\-giblib\fP. For any deal, to get maximum trick values +for all possible contracts and leaders +(these are the 20 trick values as for giblib). +.IP 3. +Option \fB\-tricks\fP. For specified deal, to get maximum trick values +for all possible contracts and leaders +(these are the 20 trick values as for giblib). +.IP 4. +Option \fB\-gen\fP. This is to generate deals, +without or with up to 20 possible trick values. +.SH OPTIONS +.BR \fIfile\fP +path for 'giblib' input file +.TP +Optional arguments [\fIoptions\fP] are one or more of: +.TP +.BR \-v +verbose where applicable +.TP +.BR \-target=\fId\fP +\-1-13 (default \-1). +Number of tricks to be won by the side to play, \-1 means that the program +shall find the maximum number. For equivalent cards only the highest is returned. +.TP +.BR \-sol=\fId\fP +solution 1/2/3 (default 3). +How many card solutions SolveBoard returns: + +target=1-13, solutions=1: Returns only one of the cards. Its returned score is +the same as target when target or higher tricks can be won. Otherwise, score +\-1 is returned if target cannot be reached, or score 0 if no tricks can be +won. + +target=\-1, solutions=1: Returns only one of the optimum cards and its score. + +target=0, solutions=1: Returns only one of the cards legal to play with score +set to 0. + +target=1-13, solutions=2: Return all cards meeting target. Their returned +scores are the same as target when target or higher tricks can be won. +Otherwise, only one card is returned with score \-1 if target cannot be +reached, or score 0 for all cards legal to play if no tricks can be won. + +target=\-1, solutions=2: Return all optimum cards with their scores. + +target=0, solutions=2: Return all cards legal to play with scores set to 0. + +target irrelevant, solutions=3: Return all cards that can be legally played +with their scores in descending order. +.TP +.BR \-mode=\fId\fP +0/1 (default 1). +DLL mode of operation. This mode does not affect the DLL if there are multiple +choices for cards to play. If there is just one card to play, or multiple cards +that are all equivalent, this mode determines whether or not the DLL will +search to find the score. + +mode=0: Do not search to find the score if the hand to play has only one card, +including its equivalents, to play. Score is set to \-2 for this card, +indicating that there are no alternative cards. This mode is very fast. + +mode=1: Always search to find the score. Even when the hand to play has only +one card, with possible equivalents, to play. +.\" +.\"mode=2: As for mode=1, but the transposition table contents is reused from the +.\"preceding SolveBoard call. Requires that target is the same as for the +.\"preceding call and is not target=\-1. The parameter solutions must be set to 1, +.\"deal must be the same, except that deal.first for the second call is partner to +.\"deal.first in the first call. +.\"Example: +.\"1st call: SolveBoard(deal, 10, 1, 1, &fut1), deal.first=1, i.e. East leads. +.\"2nd call: SolveBoard(deal, 10, 1, 2, &fut2), deal.first=3, i.e. West leads. +.TP +.BR \-trumps=\fIt\fP +s/h/d/c/n, this overrides the file (default=n) +.TP +.BR \-leader=\fIl\fP +w/n/e/s, this overrides the file (default=w) +but used only when no cards have been played +.TP +.BR \-deal=\fId\fP +1/2/... deal number in giblib file. +Only one of \fB\-deal\fP or \fB\-name\fP should be specified. +.TP +.BR \-name=\fIstr\fP +deal with 'name=str' in giblib file. +Only one of \fB\-deal\fP or \fB\-name\fP should be specified. +.TP +.BR \-playdd +play deal choosing between DDS alternatives +.TP +.BR \-timeall +time all deals in file for sol=1/2/3, print stats +.TP +.BR \-timeg=\fIxcn\fP + \fIx\fP - hex digit, total tricks by n-s + \fIc\fP - contract s/h/d/c/n + \fIn\fP - number of deals + +time the first n deals in the giblib file, +having total tricks x at contract c, +for target=\-1 sol=1 mode=1 +and for the specified/default leader, +each deal is validated. +.TP +.BR \-giblib=\fId1\fP\-\fId2\fP[\-all] +validate all deals from d1 to d2 in giblib file +for target=\-1 sol=1 mode=1. +1. if \fB\-all\fP is given, this is done for all of +the 20 trick values even if some of them are '\-'. +2. if \fB\-all\fP is not given, this is done only for +those trick values which are not '\-'. +.TP +.BR \-tricks +like \fB\-giblib\fP, but for single deal specified +by \fB\-name\fP=str \fB\-deal\fP=d or option +.TP +Generate deals: +.TP +.BR \-gen=\fIn\fP +(required) n=number of deals to generate. +output is written to a file (see below) +.TP +.BR \-genseed=\fIs\fP +(default 0) seed for random generator +.TP +.BR \-gencards=\fIc\fP +(default=52) number of cards generated per deal, +must be multiple of 4 +.TP +.BR \-gentricks=\fIt\fP +0,1,...,20 (default 1), number of tricks values to set randomly +.TP +Generate output is written to a file: +gen\-\fIgenseed\fP\-\fIndeal\fP\-\fIgencards\fP\-\fIgentricks\fP.txt +.SH NOTES +The program was named ddd by its author. As there is already some other +ddd package in Debian (the gdb frontend) it was renamed to dds, the name +of the library used. +.SH "SEE ALSO" +dealer(6), deal(6). --- dds-1.1.3+ddd105.orig/debian/rules +++ dds-1.1.3+ddd105/debian/rules @@ -0,0 +1,55 @@ +#!/usr/bin/make -f +#export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make +D=$(CURDIR)/debian/dds + +build build-indep build-arch: build-stamp +build-stamp: $(QUILT_STAMPFN) + # libdds + $(MAKE) + # dds + $(MAKE) -C ddd + sed -ne '/^\/\* =/,/^\*\//p' ddd/giblib.h > ddd/giblib.txt + # pydds + -ln -s ../dds.h ../dds.cpp python + cd python && python setup.py build + touch $@ + +install: build-stamp + dh_testroot + dh_clean -k + # libdds + dh_install -a + # dds + install -D ddd/ddd debian/dds/usr/games/dds + # pydds + cd python && python setup.py install --root ../debian/python-pydds + +binary-indep: + +binary-arch: install + dh_installchangelogs -a release_notes.txt + dh_installdocs -a -A debian/README.Debian + dh_installman -a + dh_installexamples -a + dh_strip -a + dh_compress -a + dh_pycentral -p'python-pydds' + dh_fixperms -a + dh_shlibdeps -a + dh_installdeb -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch + +clean: unpatch + dh_testdir + -$(MAKE) clean + -$(MAKE) -C ddd clean + rm -rf python/build + dh_clean build-stamp ddd/giblib.txt python/dds.h python/dds.cpp + +.PHONY: build build-indep build-arch clean binary binary-indep binary-arch install configure patch unpatch --- dds-1.1.3+ddd105.orig/debian/compat +++ dds-1.1.3+ddd105/debian/compat @@ -0,0 +1 @@ +4 --- dds-1.1.3+ddd105.orig/debian/changelog +++ dds-1.1.3+ddd105/debian/changelog @@ -0,0 +1,28 @@ +dds (1.1.3+ddd105-1) unstable; urgency=low + + * New dds upstream version. + + -- Christoph Berg Mon, 12 Mar 2007 16:49:36 +0100 + +dds (1.1.2+ddd105-1) unstable; urgency=low + + * New ddd upstream version. + * Move python module to subdir. + * Note python module license (dual GPL v2+/CC Attribution 2.5, we apply + GPL). + + -- Christoph Berg Fri, 23 Feb 2007 17:13:32 +0100 + +dds (1.1.2-1) unstable; urgency=low + + * New upstream version. + * Fix ddd.cpp for updated API. + * Add missing Sections in control. + + -- Christoph Berg Mon, 19 Feb 2007 15:34:36 +0100 + +dds (1.1-1) unstable; urgency=low + + * Initial release (Closes: #407721). + + -- Christoph Berg Thu, 25 Jan 2007 15:20:48 +0100 --- dds-1.1.3+ddd105.orig/debian/watch +++ dds-1.1.3+ddd105/debian/watch @@ -0,0 +1,3 @@ +version=3 +http://web.telia.com/~u88910365/dds(.*)-src.zip +http://web.telia.com/~u88910365/ddd(.*).zip --- dds-1.1.3+ddd105.orig/debian/libdds-dev.docs +++ dds-1.1.3+ddd105/debian/libdds-dev.docs @@ -0,0 +1,4 @@ +DDS* +DLL* +mode2.txt +readme.txt --- dds-1.1.3+ddd105.orig/debian/copyright +++ dds-1.1.3+ddd105/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Christoph Berg on +Thu, 25 Jan 2007 12:50:45 +0100. + +The orig.tar.gz tarball is composed of the zip files for the dds library and +the ddd frontend, both downloaded from http://web.telia.com/~u88910365/. The +python module was fetched from http://www.aleax.it/Bridge/. + +Authors: +dds: Bo Haglund , Bob Richardson +pydds: Alex Martelli +ddd: P.M.Cronje + +Copyright: +dds: + Copyright (C) 2006-2007 by Bo Haglund + Cleanups and porting to Linux and MacOSX (C) 2006 by Alex Martelli + + 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. + +ddd: + Copyright 2003-2006 P.M.Cronje + + This file is part of the Double Dummer Driver (DDD). + + DDD 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. + + DDD 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. + +python-pydds: + Copyright 2006 by Alex Martelli (aleaxit@gmail.com) + + This work is licensed under the Creative Commons Attribution 2.5 + License (see http://creativecommons.org/licenses/by/2.5/). + + The code, being a derivative work of Bo Haglund's DDS 1.0 which is + licensed under GPL, is of necessity also licensed under the GPL. + +On Debian systems, the complete text of the GNU General Public License can be +found in the file /usr/share/common-licenses/GPL. --- dds-1.1.3+ddd105.orig/debian/pycompat +++ dds-1.1.3+ddd105/debian/pycompat @@ -0,0 +1 @@ +2 --- dds-1.1.3+ddd105.orig/debian/libdds-dev.install +++ dds-1.1.3+ddd105/debian/libdds-dev.install @@ -0,0 +1,2 @@ +libdds.a /usr/lib +dds.h /usr/include --- dds-1.1.3+ddd105.orig/debian/control +++ dds-1.1.3+ddd105/debian/control @@ -0,0 +1,48 @@ +Source: dds +Section: games +Priority: extra +Maintainer: Christoph Berg +Build-Depends: debhelper (>> 4), quilt (>= 0.40-1), + python-dev (>= 2.3), python, python-central (>= 0.5) +Standards-Version: 3.7.2 +XS-Python-Version: current + +Package: dds +Architecture: any +Depends: ${shlibs:Depends} +Description: bridge double dummy solver - frontend + dds is a double dummy solver. This package contains the driver frontend + (originally named ddd). + . + A double dummy solver computes the optimal line of play for a bridge deal, + with all hands open (both sides dummy). + . + http://web.telia.com/~u88910365/ + +Package: libdds-dev +Section: libdevel +Architecture: any +Depends: ${shlibs:Depends} +Description: bridge double dummy solver - library + dds is a double dummy solver. This package contains the static library and the + documentation. + . + A double dummy solver computes the optimal line of play for a bridge deal, + with all hands open (both sides dummy). + . + http://web.telia.com/~u88910365/ + +Package: python-pydds +Section: python +Architecture: any +Depends: ${shlibs:Depends}, ${python:Depends} +Provides: ${python:Provides} +XB-Python-Version: ${python:Versions} +Description: bridge double dummy solver - python extension + dds is a double dummy solver. This package contains pydds, the python + extension. + . + A double dummy solver computes the optimal line of play for a bridge deal, + with all hands open (both sides dummy). + . + http://web.telia.com/~u88910365/ http://www.aleax.it/Bridge/ --- dds-1.1.3+ddd105.orig/debian/dds.examples +++ dds-1.1.3+ddd105/debian/dds.examples @@ -0,0 +1 @@ +ddd/*.gib --- dds-1.1.3+ddd105.orig/debian/dds.manpages +++ dds-1.1.3+ddd105/debian/dds.manpages @@ -0,0 +1 @@ +debian/dds.6 --- dds-1.1.3+ddd105.orig/debian/python-pydds.examples +++ dds-1.1.3+ddd105/debian/python-pydds.examples @@ -0,0 +1,2 @@ +python/trydds.py +python/t1