Quick lick of paint before we really get started.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 30 May 2016 08:30:42 +0000 (09:30 +0100)
  * 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.

30 files changed:
.gitignore
.links
AnagGUI.java
Makefile.am
anag-gui.in
anag.c
anag.h
anagram.c
configure.ac [new file with mode: 0644]
configure.in [deleted file]
debian/anag-gui-java.install [new file with mode: 0644]
debian/anag-gui-java.postinst
debian/anag-gui-java.prerm
debian/anag-gui-java.sh [deleted file]
debian/anag-gui-tk.install [new file with mode: 0644]
debian/anag-gui-tk.postinst
debian/anag-gui-tk.prerm
debian/anag-gui.java [new file with mode: 0644]
debian/anag.install [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control
debian/rules
debian/source/format [new file with mode: 0644]
longest.c
mono.c
pcre.c
regexp.c
trackword.c
util.c
wildcard.c

index 75dd9a0..d1b63ac 100644 (file)
@@ -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 (file)
--- a/.links
+++ b/.links
@@ -1 +1,3 @@
 COPYING
+config/auto-version
+config/confsubst
index 7211c79..dde7b2f 100644 (file)
@@ -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.
  *
  * 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<String> v = new Vector<String>();
     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<String> v = new Vector<String>();
       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); }
index 06c94ad..6374697 100644 (file)
-## -*-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 ---------------------------------------------------
index 3f30753..45da707 100644 (file)
@@ -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 <Return> { tkButtonInvoke .b-anagram }
 
+###----- That's all, folks --------------------------------------------------
diff --git a/anag.c b/anag.c
index d4413bd..d27523b 100644 (file)
--- 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.
  *
  * 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 (file)
--- 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.
  *
  * 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.
index 521d727..d4eb5e7 100644 (file)
--- 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.
  *
  * 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 (file)
index 0000000..f1cac47
--- /dev/null
@@ -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 (file)
index 4be7667..0000000
+++ /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 (file)
index 0000000..98e8c6f
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin/anag-gui.java
+usr/share/java/
index f3e1dcf..096ede2 100644 (file)
@@ -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#
index dda2d3e..4827600 100644 (file)
@@ -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 (file)
index f964810..0000000
+++ /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 (file)
index 0000000..0f51073
--- /dev/null
@@ -0,0 +1 @@
+usr/bin/anag-gui.tk
index f55c72d..0c6318b 100644 (file)
@@ -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#
index 76cfdef..487646b 100644 (file)
@@ -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 (file)
index 0000000..e3c42b5
--- /dev/null
@@ -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 (file)
index 0000000..7ce6ad5
--- /dev/null
@@ -0,0 +1 @@
+usr/bin/anag
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
index 95f8c45..c6f97f4 100644 (file)
@@ -2,6 +2,8 @@ Source: anag
 Section: text
 Priority: extra
 Maintainer: Mark Wooding <mdw@distorted.org.uk>
+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,
index d8a2e82..7b5e3dd 100755 (executable)
@@ -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 (file)
index 0000000..d3827e7
--- /dev/null
@@ -0,0 +1 @@
+1.0
index 30371bc..1879e48 100644 (file)
--- 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.
  *
  * 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 (file)
--- 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.
  *
  * 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 (file)
--- 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.
  *
  * 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.
index 500c597..c930ea5 100644 (file)
--- 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.
  *
  * 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.
index 8d85745..b2e3074 100644 (file)
@@ -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.
  *
  * 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 (file)
--- 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.
  *
  * 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.
index 44c86a1..78b3168 100644 (file)
@@ -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.
  *
  * 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.