[Dict-common-dev] Experimental support for pwli files

Rafael Laboissiere Rafael Laboissiere <laboissiere@mpipf-muenchen.mpg.de>
Sat, 8 Jun 2002 20:57:09 +0200


--jRHKVT23PllUwdXP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I just implemented the automatic generation of pwli files in
installdeb-ispell.  The patch to the debian/control and
scripts/debhelper/installdeb.in is attached below for your appreciation.

The dictionaries-common-dev package has now a dependency on libpspell4,
because installdeb-ispell calls the pspell-config script.  (BTW, a much
better place for this script would be the libspell-dev package, and not the
versioned library package.)

I also uploaded a modified ibrazilian package to the staging.  I just added
the line:

    Pspell-Ispell: pt-brazilian iso8859-1

to the debian/info-ispell file.  After installation, I have:

    $ cat /usr/share/pspell/pt-brazilian-ispell.pwli 
    /usr/lib/ispell/brasileiro.hash iso8859-1

Please, check my changes.  This has been a 30 minutes quick hack, and I am
sure that there are bugs and room for improvement.

-- 
Rafael

--jRHKVT23PllUwdXP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=pspell-patch

Index: debian/control
===================================================================
RCS file: /cvsroot/dict-common/dictionaries-common/debian/control,v
retrieving revision 1.48
diff -u -r1.48 control
--- debian/control	7 Jun 2002 11:14:54 -0000	1.48
+++ debian/control	8 Jun 2002 18:48:34 -0000
@@ -26,7 +26,7 @@
 
 Package: dictionaries-common-dev
 Architecture: all
-Depends: debhelper (>> 2.0.89), dictionaries-common (>> 0.3.6)
+Depends: debhelper (>> 2.0.89), dictionaries-common (>> 0.3.6), libpspell4
 Description: Common utilities and Policy for spelling dictionary tools
  WARNING: THIS PACKAGE IS ALPHA SOFTWARE!
  .
Index: scripts/debhelper/installdeb.in
===================================================================
RCS file: /cvsroot/dict-common/dictionaries-common/scripts/debhelper/installdeb.in,v
retrieving revision 1.4
diff -u -r1.4 installdeb.in
--- scripts/debhelper/installdeb.in	28 Nov 2001 20:27:02 -0000	1.4
+++ scripts/debhelper/installdeb.in	8 Jun 2002 18:48:34 -0000
@@ -39,15 +39,34 @@
   doit ("install", "-d", $lib_dir);
   doit ("install", "-m644", $infofile, "$lib_dir/$package");
 
+  # Install the Pspell .pwli files for each dictionary found in the
+  # info file.  This is only done for the ispell dictionary
+  # installation.
+  if ($class eq "ispell") {
+    my $pspell_dir = tmpdir ($package) . `pspell-config pkgdatadir`;
+    chomp $pspell_dir;
+    foreach my $d (keys %{$dicts}) {
+      if (exists $dicts->{$d}->{'pspell-ispell'}) {
+	my ($name, $charcod) = split (/\s+/, $dicts->{$d}->{"pspell-ispell"});
+	doit ("install", "-d", $pspell_dir)
+	  if (not -d $pspell_dir);
+	open (PWLI, "> $pspell_dir/$name-ispell.pwli");
+	print PWLI
+	  "/usr/lib/ispell/$dicts->{$d}->{'hash-name'}.hash $charcod\n";
+	close PWLI;
+      }
+    }
+  }
+
   # Generate the config file.  First, test if
   # debian/[package.]config exists and trigger an error if it is the
   # case.

--jRHKVT23PllUwdXP--