From 0279756ef8eb60878927c9e325a9ad25a4b0f150 Mon Sep 17 00:00:00 2001 Message-Id: <0279756ef8eb60878927c9e325a9ad25a4b0f150.1714184917.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] Quick lick of paint before we really get started. Organization: Straylight/Edgeware From: Mark Wooding * Replace the build scripts, `configure.ac' and `Makefile.am', to conform with current ideology. * Replace `debian/rules' with one based on dh(1), and include necessary extra files. * Fixup whitespace, and remove old `$Id:' markers. * Add commentary to `anag-gui.in' in current style. * Rename GUI scripts to `*.VARIANT'. * Fix warnings in Java. --- .gitignore | 14 +-- .links | 2 + AnagGUI.java | 38 ++++---- Makefile.am | 161 ++++++++++++++++++++++++---------- anag-gui.in | 49 +++++++++-- anag.c | 14 ++- anag.h | 8 +- anagram.c | 8 +- configure.ac | 86 ++++++++++++++++++ configure.in | 79 ----------------- debian/anag-gui-java.install | 2 + debian/anag-gui-java.postinst | 2 +- debian/anag-gui-java.prerm | 4 +- debian/anag-gui-java.sh | 3 - debian/anag-gui-tk.install | 1 + debian/anag-gui-tk.postinst | 2 +- debian/anag-gui-tk.prerm | 2 +- debian/anag-gui.java | 2 + debian/anag.install | 1 + debian/compat | 1 + debian/control | 6 +- debian/rules | 69 ++------------- debian/source/format | 1 + longest.c | 8 +- mono.c | 8 +- pcre.c | 8 +- regexp.c | 8 +- trackword.c | 8 +- util.c | 8 +- wildcard.c | 8 +- 30 files changed, 322 insertions(+), 289 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.in create mode 100644 debian/anag-gui-java.install delete mode 100644 debian/anag-gui-java.sh create mode 100644 debian/anag-gui-tk.install create mode 100644 debian/anag-gui.java create mode 100644 debian/anag.install create mode 100644 debian/compat create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore index 75dd9a0..d1b63ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,7 @@ +COPYING Makefile.in -configure aclocal.m4 -build -stamp-h.in -config.h.in -deb-build -COPYING -install-sh -missing -mkinstalldirs autom4te.cache -depcomp +configure +config/ +debian/*.log diff --git a/.links b/.links index 5ecd9c6..5a93e8f 100644 --- a/.links +++ b/.links @@ -1 +1,3 @@ COPYING +config/auto-version +config/confsubst diff --git a/AnagGUI.java b/AnagGUI.java index 7211c79..dde7b2f 100644 --- a/AnagGUI.java +++ b/AnagGUI.java @@ -1,13 +1,11 @@ /* -*-java-*- - * - * $Id: AnagGUI.java,v 1.7 2004/04/08 01:36:18 mdw Exp $ * * Front-end GUI * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -61,19 +59,21 @@ class Whinge extends Frame { g.insets.top = 0; g.insets.bottom = 24; add(b, g); pack(); - show(); + setVisible(true); } }; class AnagPanel extends Panel { TextField word; java.awt.List list; - String file; Settings sb; + String anag = System.getProperty("anag.program", "anag"); + String file = System.getProperty("anag.dictionary", + "/usr/share/dict/words"); class Settings extends Frame { TextField name; - + public Settings() { super("AnagGUI settings"); Button b; @@ -113,7 +113,7 @@ class AnagPanel extends Panel { }); this.add(b, g); this.pack(); - this.show(); + this.setVisible(true); } }; @@ -127,7 +127,7 @@ class AnagPanel extends Panel { new BufferedReader(new InputStreamReader(p.getErrorStream())); String l; - Vector v = new Vector(); + Vector v = new Vector(); while ((l = fout.readLine()) != null) v.addElement(l); StringBuffer d = new StringBuffer(); @@ -149,10 +149,9 @@ class AnagPanel extends Panel { void run() { try { StringBuffer b = new StringBuffer(); - b.append("anag -file ") - .append(file) - .append(" ") - .append(word.getText()); + b.append(anag) + .append(" -file ").append(file) + .append(" ").append(word.getText()); Process p = Runtime.getRuntime().exec(b.toString()); listen(p); } catch (IOException e) { @@ -162,7 +161,7 @@ class AnagPanel extends Panel { void help() { try { - Process p = Runtime.getRuntime().exec("anag --help"); + Process p = Runtime.getRuntime().exec(anag + " --help"); listen(p); } catch (IOException e) { splat(e.toString()); @@ -171,9 +170,9 @@ class AnagPanel extends Panel { void getlist(String tag) { try { - Vector v = new Vector(); + Vector v = new Vector(); String[] vv; - v.addElement("anag"); + v.addElement(anag); v.addElement("-file"); v.addElement(file); v.addElement(tag); @@ -193,7 +192,6 @@ class AnagPanel extends Panel { GridBagConstraints g = new GridBagConstraints(); Button b; - file = System.getProperty("anag.dictionary", "/usr/dict/words"); sb = null; g.gridx = g.gridy = GridBagConstraints.RELATIVE; @@ -289,12 +287,12 @@ public class AnagGUI extends Applet { public static void main(String[] argv) { Frame f = new Frame("Anagram solver"); f.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { System.exit(0); } + public void windowClosing(WindowEvent e) { System.exit(0); } }); AnagPanel p = new AnagPanel(); f.add(p); f.pack(); - f.show(); + f.setVisible(true); } public AnagGUI() { super(); setLayout(new BorderLayout()); } public void init() { /*add(new AnagPanel());*/ main(null); } diff --git a/Makefile.am b/Makefile.am index 06c94ad..6374697 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,61 +1,128 @@ -## -*-makefile-*- -## -## $Id$ -## -## Makefile for Anag -## -## (c) 2001 Mark Wooding -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Anag: a simple wordgame helper. -## -## Anag 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. -## -## Anag 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. -## -## You should have received a copy of the GNU General Public License -## along with Anag; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -javadir = $(datadir)/java +### -*-makefile-*- +### +### Build script for `anag' +### +### (c) 2001, 2016 Mark Wooding +### -JAVAC = @JAVAC@ +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Anag: a simple wordgame helper. +### +### Anag 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. +### +### Anag 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. +### +### You should have received a copy of the GNU General Public License +### along with Anag; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +EXTRA_DIST = +CLEANFILES = +SUFFIXES = + +bin_PROGRAMS = +bin_SCRIPTS = + +###-------------------------------------------------------------------------- +### Making substitutions. + +confsubst = $(top_srcdir)/config/confsubst +V_SUBST = $(V_SUBST_$(V)) +V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY)) +V_SUBST_0 = @echo " SUBST $@"; +SUBST = $(V_SUBST)$(confsubst) +SUBSTITUTIONS = \ + PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ + DICTIONARY=$(DICTIONARY) \ + WISH=$(WISH) \ + ANAG=$(bindir)/anag + +EXTRA_DIST += config/confsubst + +###-------------------------------------------------------------------------- +### Main program. + +bin_PROGRAMS += anag +anag_SOURCES = anag.c anag.h util.c +anag_SOURCES += anagram.c +anag_SOURCES += longest.c +anag_SOURCES += mono.c +anag_SOURCES += pcre.c +anag_SOURCES += regexp.c +anag_SOURCES += trackword.c +anag_SOURCES += wildcard.c + +###-------------------------------------------------------------------------- +### Java frontend. -SUFFIXES = .java .class -.java.class:; $(JAVAC) -d . $< +JAVAC = @JAVAC@ +SUFFIXES += .java .class +CLEANFILES += *.class *.jar +V_JAVAC = $(V_JAVAC_$(V)) +V_JAVAC_ = $(V_JAVAC_$(AM_DEFAULT_VERBOSITY)) +V_JAVAC_0 = @echo " JAVAC $@"; +V_JAR = $(V_JAR_$(V)) +V_JAR_ = $(V_JAR_$(AM_DEFAULT_VERBOSITY)) +V_JAR_0 = @echo " JAR $@"; +.java.class:; $(V_JAVAC)$(JAVAC) -d . $(JAVACFLAGS) $< -bin_PROGRAMS = anag -bin_SCRIPTS = @TKPROGS@ -EXTRA_SCRIPTS = anag-gui -java_DATA = @JARFILES@ +javadir = $(datadir)/java -anag_SOURCES = \ - anag.c anag.h util.c \ - wildcard.c anagram.c mono.c trackword.c regexp.c pcre.c longest.c +if HAVE_JAVAC +java_DATA = anag.jar +endif +EXTRA_DIST += anag.manifest +EXTRA_DIST += AnagGUI.java anag.jar: AnagGUI.class - jar cfm anag.jar $(srcdir)/anag.manifest Anag*.class Whinge*.class + $(V_JAR)jar cfm $@ $(srcdir)/anag.manifest *.class + +###-------------------------------------------------------------------------- +### Tcl/Tk frontend. + +if HAVE_WISH +bin_SCRIPTS += anag-gui +endif + +EXTRA_DIST += anag-gui.in +CLEANFILES += anag-gui + +anag-gui: anag-gui.in Makefile + $(SUBST) $(srcdir)/anag-gui.in >$@.new $(SUBSTITUTIONS) && \ + chmod +x $@.new && mv $@.new $@ +###-------------------------------------------------------------------------- +### Distribution arrangements. + +## Version number tracking. +dist-hook: + echo $(VERSION) >$(distdir)/RELEASE + +EXTRA_DIST += config/auto-version + +## Zip file for DOSish platforms. doszip: distdir rm -f $(PACKAGE).zip zip -qlr $(PACKAGE).zip $(distdir) rm -rf $(distdir) -EXTRA_DIST = \ - AnagGUI.java anag-gui.in anag.manifest \ - debian/control debian/changelog debian/copyright debian/rules \ - debian/anag-gui-java.postinst debian/anag-gui-java.prerm \ - debian/anag-gui-tk.postinst debian/anag-gui-tk.prerm - -CLEANFILES = *.class *.jar +## Debian packaging. +EXTRA_DIST += debian/control debian/changelog debian/copyright +EXTRA_DIST += debian/rules debian/compat debian/source/format +EXTRA_DIST += debian/anag.install +EXTRA_DIST += debian/anag-gui-java.install +EXTRA_DIST += debian/anag-gui-java.postinst +EXTRA_DIST += debian/anag-gui-java.prerm +EXTRA_DIST += debian/anag-gui.java +EXTRA_DIST += debian/anag-gui-tk.install +EXTRA_DIST += debian/anag-gui-tk.postinst +EXTRA_DIST += debian/anag-gui-tk.prerm ##----- That's all, folks --------------------------------------------------- diff --git a/anag-gui.in b/anag-gui.in index 3f30753..45da707 100644 --- a/anag-gui.in +++ b/anag-gui.in @@ -1,6 +1,31 @@ -#! /usr/bin/wish - -# --- Configuration --- +#! @WISH@ +### -*-tcl-*- +### +### Graphical frontend for `anag' +### +### (c) 2002 Mark Wooding +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Anag: a simple wordgame helper. +### +### Anag 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. +### +### Anag 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. +### +### You should have received a copy of the GNU General Public License +### along with Anag; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +###-------------------------------------------------------------------------- +### Configuration. if {[info exists env(HOME)]} { set home $env(HOME) @@ -13,7 +38,7 @@ if {[info exists env(HOME)]} { } } set conffile [list "/etc/anagrc" \ - [file join $home "anagrc"]] + [file join $home "anagrc"]] if {[string compare "unix" $tcl_platform(platform)] == 0} { lappend conffile [file join $home ".anagrc"] } @@ -38,7 +63,8 @@ foreach f $conffile { break } -# --- Other setting up --- +###-------------------------------------------------------------------------- +### Other setting up. if {[string compare "windows" $tcl_platform(platform)] == 0} { set exetypes { @@ -49,7 +75,8 @@ if {[string compare "windows" $tcl_platform(platform)] == 0} { set exetypes {} } -# --- Handy subroutines --- +###-------------------------------------------------------------------------- +### Handy subroutines. proc wordlist {args} { set l {} @@ -67,7 +94,8 @@ proc report {msg} { -title "Error from [wm title .]" -message $msg } -# --- Options --- +###-------------------------------------------------------------------------- +### Options. proc conf-copyout {} { global C C_tags @@ -155,7 +183,8 @@ proc options {} { pack .opt.b -anchor e } -# --- Run the command --- +###-------------------------------------------------------------------------- +### Run the command. proc run-search {args} { run-search-v $args } proc run-search-v {v} { @@ -169,7 +198,8 @@ proc run-search-v {v} { foreach i $l { .list insert end $i } } -# --- Construct the main window --- +###-------------------------------------------------------------------------- +### Construct the main window. wm title . "Anagram solver" frame .f-entry @@ -227,3 +257,4 @@ menu .menu.file focus .e-word bind .e-word { tkButtonInvoke .b-anagram } +###----- That's all, folks -------------------------------------------------- diff --git a/anag.c b/anag.c index d4413bd..d27523b 100644 --- a/anag.c +++ b/anag.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * Main driver for anag * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -143,9 +141,9 @@ static const struct opt opttab[] = { #ifdef HAVE_PCRE { "pcre", 1, 0, O_PCRE }, #endif - { "length", 1, 0, O_LENGTH }, - { "longest", 0, 0, O_LONGEST }, - { "shortest", 0, 0, O_SHORTEST }, + { "length", 1, 0, O_LENGTH }, + { "longest", 0, 0, O_LONGEST }, + { "shortest", 0, 0, O_SHORTEST }, /* --- End marker --- */ diff --git a/anag.h b/anag.h index f9eb5a3..e16a3ae 100644 --- a/anag.h +++ b/anag.h @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * External definitions for Anag * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/anagram.c b/anagram.c index 521d727..d4eb5e7 100644 --- a/anagram.c +++ b/anagram.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * Matches anagrams and subgrams * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..f1cac47 --- /dev/null +++ b/configure.ac @@ -0,0 +1,86 @@ +dnl -*-autoconf-*- +dnl +dnl Configuration script for `anag' +dnl +dnl (c) 2016 Mark Wooding +dnl + +dnl----- Licensing notice --------------------------------------------------- +dnl +dnl This file is part of Anag: a simple wordgame helper. +dnl +dnl Anag is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl Anag is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with Anag; if not, write to the Free Software Foundation, +dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +dnl-------------------------------------------------------------------------- +dnl Initialization. + +mdw_AUTO_VERSION +AC_INIT([anag], AUTO_VERSION, [mdw@distorted.org.uk]) +AC_CONFIG_SRCDIR([anag.c]) +AC_CONFIG_AUX_DIR([config]) +AM_INIT_AUTOMAKE([foreign]) +mdw_SILENT_RULES + +AC_PROG_CC +AX_CFLAGS_WARN_ALL + +dnl-------------------------------------------------------------------------- +dnl C programming environment. + +AC_CHECK_FUNCS([regcomp]) + +AC_SEARCH_LIBS([pcre_fullinfo], [pcre], + [AC_DEFINE([HAVE_PCRE], [1], [Define if you have libpcre available.])]) + +dnl-------------------------------------------------------------------------- +dnl Java. + +AC_CHECK_PROGS([JAVAC], [javac jikes], [none]) +if test "$JAVAC" = "none"; then AC_MSG_WARN([No Java compiler found]); fi +AM_CONDITIONAL([HAVE_JAVAC], [test "$JAVAC" != "none"]) + +dnl-------------------------------------------------------------------------- +dnl Tcl/Tk. + +AC_PATH_PROGS([WISH], [wish wish8 wish8.5 wish8.4], [none]) +if test "$WISH" = "none"; then AC_MSG_WARN([No Tcl/Tk interpreter found]); fi +AM_CONDITIONAL([HAVE_WISH], [test "$WISH" != "none"]) + +dnl-------------------------------------------------------------------------- +dnl Other configuration. + +AC_ARG_WITH(dictionary, +[ --with-dictionary=DICT set default word list to be DICT], +[DICTIONARY=$withval], +[AC_CACHE_CHECK([dictionary], [mdw_cv_dictionary], + [for mdw_cv_dictionary in \ + /usr/share/dict/words \ + /usr/dict/words; do + if test -r "$mdw_cv_dictionary"; then break; fi + done]) + DICTIONARY=$mdw_cv_dictionary]) + +AC_DEFINE_UNQUOTED([DICTIONARY], ["$DICTIONARY"], + [Define this to be your default wordlist location.]) +AC_SUBST([DICTIONARY]) + +dnl-------------------------------------------------------------------------- +dnl Produce output. + +AC_CONFIG_HEADER([config/config.h]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + +dnl----- That's all, folks -------------------------------------------------- diff --git a/configure.in b/configure.in deleted file mode 100644 index 4be7667..0000000 --- a/configure.in +++ /dev/null @@ -1,79 +0,0 @@ -dnl -*-m4-*- -dnl -dnl $Id: configure.in,v 1.6 2004/04/08 01:36:19 mdw Exp $ -dnl -dnl Configuration script -dnl -dnl (c) 2001 Mark Wooding -dnl - -dnl ----- Licensing notice -------------------------------------------------- -dnl -dnl This file is part of Anag: a simple wordgame helper. -dnl -dnl Anag is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Anag is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Anag; if not, write to the Free Software Foundation, -dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_INIT(anag.c) -AM_INIT_AUTOMAKE(anag, 1.1.0) -AM_CONFIG_HEADER(config.h) -AC_PROG_CC -mdw_GCC_FLAGS - -AC_CHECK_PROGS([JAVAC], [javac jikes], [none]) -if test "$JAVAC" = "none"; then - AC_MSG_WARN([No Java compiler found]) - JARFILES="" -else - JARFILES="anag.jar" -fi -AC_SUBST([JARFILES]) - -AC_CHECK_PROGS([WISH], [wish wish8], [none]) -if test "$WISH" = "none"; then - AC_MSG_WARN([No Tcl/Tk interpreter found]) - TKPROGS="" -else - TKPROGS="anag-gui" -fi -AC_SUBST([TKPROGS]) - -EXTNODE="" -AC_CHECK_FUNCS([regcomp]) -mdw_CHECK_MANYLIBS([pcre_fullinfo], [pcre], - [AC_DEFINE([HAVE_PCRE], [1], - [Define if you have libpcre lying around somewhere.])]) - -AC_ARG_WITH(dictionary, -[ --with-dictionary=DICT set default word list to be DICT], -[DICTIONARY=$withval], -[AC_CACHE_CHECK([dictionary], [mdw_cv_dictionary], - [for mdw_cv_dictionary in \ - /usr/share/dict/words \ - /usr/dict/words; do - test -r "$i" && break - done]) - DICTIONARY=$mdw_cv_dictionary]) -AC_DEFINE_UNQUOTED([DICTIONARY], ["$DICTIONARY"], - [Define this to be your default wordlist location.]) -AC_SUBST([DICTIONARY]) - -mdw_DEFINE_PATHS([ - ANAG=mdw_PATH([${bindir}])/mdw_PROG([anag]) -]) - -AC_SUBST([ANAG]) -AC_OUTPUT(Makefile anag-gui) - -dnl ----- That's all, folks ------------------------------------------------- diff --git a/debian/anag-gui-java.install b/debian/anag-gui-java.install new file mode 100644 index 0000000..98e8c6f --- /dev/null +++ b/debian/anag-gui-java.install @@ -0,0 +1,2 @@ +usr/bin/anag-gui.java +usr/share/java/ diff --git a/debian/anag-gui-java.postinst b/debian/anag-gui-java.postinst index f3e1dcf..096ede2 100644 --- a/debian/anag-gui-java.postinst +++ b/debian/anag-gui-java.postinst @@ -1,5 +1,5 @@ #! /bin/sh set -e update-alternatives --install \ - /usr/bin/anag-gui anag-gui /usr/bin/anag-gui-java 10 + /usr/bin/anag-gui anag-gui /usr/bin/anag-gui.java 10 #DEBHELPER# diff --git a/debian/anag-gui-java.prerm b/debian/anag-gui-java.prerm index dda2d3e..4827600 100644 --- a/debian/anag-gui-java.prerm +++ b/debian/anag-gui-java.prerm @@ -1,4 +1,4 @@ #! /bin/sh set -e -update-alternatives --remove anag-gui /usr/bin/anag-gui-java -#DEBHELPER# \ No newline at end of file +update-alternatives --remove anag-gui /usr/bin/anag-gui.java +#DEBHELPER# diff --git a/debian/anag-gui-java.sh b/debian/anag-gui-java.sh deleted file mode 100644 index f964810..0000000 --- a/debian/anag-gui-java.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -set -e -/usr/bin/java -jar /usr/share/anag-gui-java/anag.jar "$@" diff --git a/debian/anag-gui-tk.install b/debian/anag-gui-tk.install new file mode 100644 index 0000000..0f51073 --- /dev/null +++ b/debian/anag-gui-tk.install @@ -0,0 +1 @@ +usr/bin/anag-gui.tk diff --git a/debian/anag-gui-tk.postinst b/debian/anag-gui-tk.postinst index f55c72d..0c6318b 100644 --- a/debian/anag-gui-tk.postinst +++ b/debian/anag-gui-tk.postinst @@ -1,5 +1,5 @@ #! /bin/sh set -e update-alternatives --install \ - /usr/bin/anag-gui anag-gui /usr/bin/anag-gui-tk 20 + /usr/bin/anag-gui anag-gui /usr/bin/anag-gui.tk 20 #DEBHELPER# diff --git a/debian/anag-gui-tk.prerm b/debian/anag-gui-tk.prerm index 76cfdef..487646b 100644 --- a/debian/anag-gui-tk.prerm +++ b/debian/anag-gui-tk.prerm @@ -1,4 +1,4 @@ #! /bin/sh set -e -update-alternatives --remove anag-gui /usr/bin/anag-gui-tk +update-alternatives --remove anag-gui /usr/bin/anag-gui.tk #DEBHELPER# diff --git a/debian/anag-gui.java b/debian/anag-gui.java new file mode 100644 index 0000000..e3c42b5 --- /dev/null +++ b/debian/anag-gui.java @@ -0,0 +1,2 @@ +#! /bin/sh -e +/usr/bin/java -jar /usr/share/java/anag.jar "$@" diff --git a/debian/anag.install b/debian/anag.install new file mode 100644 index 0000000..7ce6ad5 --- /dev/null +++ b/debian/anag.install @@ -0,0 +1 @@ +usr/bin/anag diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control index 95f8c45..c6f97f4 100644 --- a/debian/control +++ b/debian/control @@ -2,6 +2,8 @@ Source: anag Section: text Priority: extra Maintainer: Mark Wooding +Build-Depends: debhelper (>= 9), libpcre3-dev +Build-Depends-Indep: java5-sdk, tk (>= 8.3) Standards-Version: 3.1.1 Package: anag @@ -19,7 +21,7 @@ Description: A simple wordgame tool Package: anag-gui-tk Architecture: all -Depends: anag, wish +Depends: anag, tk (>= 8.3) Provides: anag-gui Description: A simple wordgame tool Anag can solve simple wordgame puzzles, such as anagrams, crosswords, @@ -30,7 +32,7 @@ Description: A simple wordgame tool Package: anag-gui-java Architecture: all -Depends: anag, java-virtual-machine +Depends: anag, java5-runtime Provides: anag-gui Description: A simple wordgame tool Anag can solve simple wordgame puzzles, such as anagrams, crosswords, diff --git a/debian/rules b/debian/rules index d8a2e82..7b5e3dd 100755 --- a/debian/rules +++ b/debian/rules @@ -1,65 +1,12 @@ #! /usr/bin/make -f +%:; dh $@ --parallel -Bdebian/build -export DH_COMPAT = 4 - -build: - rm -rf build deb-build - mkdir deb-build - cd deb-build; ../configure \ - --prefix=/usr \ +override_dh_auto_configure: + dh_auto_configure -- \ --with-dictionary=/usr/share/dict/words - make -C deb-build - touch build - -clean: - dh_clean - rm -rf deb-build build - -install: build - dh_clean - make -C deb-build install DESTDIR=`pwd`/debian/anag - mkdir -p debian/anag-gui-java/usr/share/anag-gui-java - mv debian/anag/usr/share/java/anag.jar \ - debian/anag-gui-java/usr/share/anag-gui-java - rmdir debian/anag/usr/share/java - mkdir -p debian/anag-gui-java/usr/bin - cp debian/anag-gui-java.sh debian/anag-gui-java/usr/bin/anag-gui-java - mkdir -p debian/anag-gui-tk/usr/bin - mv debian/anag/usr/bin/anag-gui \ - debian/anag-gui-tk/usr/bin/anag-gui-tk - -binary-indep: - dh_testdir -i - dh_testroot -i - dh_compress -i - dh_installdocs -i - dh_gencontrol -i - dh_fixperms -i - dh_installdeb -i - dh_md5sums -i - dh_builddeb -i - -binary-arch: - dh_testdir -a - dh_testroot -a - dh_compress -a - dh_installdocs -a - dh_strip -a - dh_shlibdeps -a - dh_gencontrol -a - dh_fixperms -a - dh_installdeb -a - dh_md5sums -a - dh_builddeb -a - -binary: install binary-indep binary-arch - -source: - rm -rf deb-build/*.tar.gz deb-build/=deb= - make -C deb-build dist - mkdir deb-build/=deb= - cd deb-build/=deb=; tar xvfz ../*.tar.gz - d=`pwd`; cd ..; dpkg-source -i -b $$d/deb-build/=deb=/* - rm -rf deb-build/=deb= -.PHONY: binary binary-arch binary-indep clean install source +override_dh_auto_install: + dh_auto_install + cd debian/tmp/usr/bin/ && \ + if [ -f anag-gui ]; then mv anag-gui anag-gui.tk; fi + install -m755 debian/anag-gui.java debian/tmp/usr/bin/ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/longest.c b/longest.c index 30371bc..1879e48 100644 --- a/longest.c +++ b/longest.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * Remember the longest word seen so far * * (c) 2005 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/mono.c b/mono.c index 4522240..2e5d8ea 100644 --- a/mono.c +++ b/mono.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id: mono.c,v 1.2 2004/04/08 01:36:19 mdw Exp $ * * Monoalphabetic matcher * * (c) 2003 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/pcre.c b/pcre.c index 19fd85b..f15e37a 100644 --- a/pcre.c +++ b/pcre.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id: pcre.c,v 1.2 2004/04/08 01:36:19 mdw Exp $ * * Matches Perl-compatible regular expressions * * (c) 2002 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/regexp.c b/regexp.c index 500c597..c930ea5 100644 --- a/regexp.c +++ b/regexp.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id: regexp.c,v 1.2 2004/04/08 01:36:19 mdw Exp $ * * Matches regular expressions * * (c) 2002 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/trackword.c b/trackword.c index 8d85745..b2e3074 100644 --- a/trackword.c +++ b/trackword.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id: trackword.c,v 1.4 2004/04/08 01:36:19 mdw Exp $ * * Matches trackwords * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/util.c b/util.c index 2adb4a9..97f498e 100644 --- a/util.c +++ b/util.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * Various useful utilities, stolen from mLib * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/wildcard.c b/wildcard.c index 44c86a1..78b3168 100644 --- a/wildcard.c +++ b/wildcard.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id: wildcard.c,v 1.2 2004/04/08 01:36:19 mdw Exp $ * * Matches wildcard patterns * * (c) 2001 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Anag: a simple wordgame helper. * @@ -15,12 +13,12 @@ * 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. - * + * * Anag 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. - * + * * You should have received a copy of the GNU General Public License * along with Anag; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- [mdw]