[Dict-common-dev] dictionaries-common: myspell policy
Rene Engelhard
rene@debian.org
Mon, 9 Jun 2003 14:04:35 +0200
--TRYliJ5NKNqkz5bu
Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62"
Content-Disposition: inline
--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi Agust=EDn,
as promised already here is the patch (against 0.9.51).
Included in the diff is the addition of me to the document at the
beginning and to Uploaders: to be able to to something for the myspell
parts directly if they need some rework/fixing. [1]
If you wonder: I have tried to get the maximal lenth/line <=3D 80 to
be able to edit the file on a plain console; this increased the diff
somewhat...
I also replaced some occurances of the long forms thorugh IDWP; or
&IDWP;s.
The other changes I did are mentioned in the diff itself (changelog).
If you want me to, I could upload 0.10 if the patch is OK for you...
(I included the changelog so far in the diff; tis version built fine; debs
and the changes are lying on my HD...)
Regards,
Ren=E9
[1] This then may include being member in the alioth project and having
CVS access...
=2E
P.S.: I just subscribed to dict-common-*. Would it make sense to make
that List the Maintainer and you, Rafael and me Uploaders:?
--
.''`. Ren=E9 Engelhard -- Debian GNU/Linux Developer
: :' : http://www.debian.org | http://people.debian.org/~rene/
`. `' rene@debian.org | GnuPG-Key ID: 248AEB73
`- Fingerprint: 41FA F208 28D4 7CA5 19BB 7AD9 F859 90B0 248A EB73
--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="dictcommon.patch"
Content-Transfer-Encoding: quoted-printable
diff -urN dictionaries-common-0.9.51/debian/changelog dictionaries-common-0=
=2E10/debian/changelog
--- dictionaries-common-0.9.51/debian/changelog 2003-06-04 11:11:43.0000000=
00 +0200
+++ dictionaries-common-0.10/debian/changelog 2003-06-09 04:10:17.000000000=
+0200
@@ -1,3 +1,17 @@
+dictionaries-common (0.10) unstable; urgency=3Dlow
+
+ * debian/control:
+ -- add myself to Uploaders:
+ -- add dh_perl call for scripts/system/* and add ${perl:Depends}
+ -- remove dh_shlibdeps since we have no binaries here..
+ * policy/dsdt-policy.xml.in
+ -- add myspell stuff
+ * scripts/system/*:
+ -- add myspell stuff (update-ooo-dictlist)
+ * Standards-Version: 3.5.10 (no changes needed)
+
+ -- Rene Engelhard <rene@debian.org> Fri, 6 Jun 2003 04:40:55 +0200
+
dictionaries-common (0.9.51) unstable; urgency=3Dlow
=20
* scripts/ispell-autobuildhash:
diff -urN dictionaries-common-0.9.51/debian/control dictionaries-common-0.1=
0/debian/control
--- dictionaries-common-0.9.51/debian/control 2003-04-30 15:48:41.000000000=
+0200
+++ dictionaries-common-0.10/debian/control 2003-06-09 04:09:55.000000000 +=
0200
@@ -2,13 +2,13 @@
Section: text
Priority: standard
Maintainer: Agustin Martin Domingo <agmartin@debian.org>
-Uploaders: Rafael Laboissiere <rafael@debian.org>
+Uploaders: Rafael Laboissiere <rafael@debian.org>, Rene Engelhard <rene@de=
bian.org>
Build-Depends-Indep: docbook-xml, docbook-dsssl, jade, links, debhelper (>=
=3D 4.1.16), slice, autoconf
-Standards-Version: 3.5.7
+Standards-Version: 3.5.10
=20
Package: dictionaries-common
Architecture: all
-Depends: debconf (>=3D 0.2.9)
+Depends: ${perl:Depends}, debconf (>=3D 0.2.9)
Conflicts: ispell (<=3D 3.1.20.0-1), miscfiles (<< 1.3-2.1), iamerican (<=
=3D 3.1.20.0-1), ibrazilian (<< 2.4-5.1), ibritish (<=3D 3.1.20.0-1), ibulg=
arian (<=3D 2.0-2), icatalan (<=3D 0.1-4), iczech (<=3D 20020628-1) , idani=
sh (<< 1.4.22-2.1), idutch (<=3D 1:0.1e-20), iesperanto (<< 2.1.2000.02.25-=
6), ifaroese (<=3D 0.1.16-2), ifinnish (<< 0.7-3.4), ifinnish-large (<< 0.7=
-3.4), ifinnish-small (<< 0.7-3.4), ifrench (<=3D 1.4-13), ifrench-gut (<=
=3D 1:1.0-9), igerman, ihungarian (<=3D 0.84-1), iitalian (<< 2.20-1.2), in=
german (<< 20010414-2), inorwegian (<< 2.0-6.1), ipolish (<< 20011004-2.1),=
iportuguese (<< 19980611-8), irussian (<=3D 0.99f0-1), ispanish (<< 1.7-5)=
, ispell-ga, iswedish (<=3D 1.4.2), wbritish (<=3D 3.1.20.0-1), wbulgarian =
(<=3D 2.0-2), wcatalan (<=3D 0.1-4), wdanish (<< 1.4.22-2.1), wdutch (<=3D =
1:0.1e-20), wenglish (<=3D 2.0-2), wfaroese (<=3D 0.1.16-2), wfinnish (<< 0=
=2E7-3.4), wfrench (<=3D 1.0-11), wgerman, witalian (<=3D 1.6), wnorwegian =
(<< 2.0-6.1), wngerman (<< 20010414-2), wpolish (<< 20011004-2.1), wspanish=
(<=3D 1.0.11.1), wswedish (<=3D 1.4.2)
Suggests: ispell, emacsen-common, jed-common
Description: Common utilities for spelling dictionary tools
diff -urN dictionaries-common-0.9.51/debian/copyright dictionaries-common-0=
=2E10/debian/copyright
--- dictionaries-common-0.9.51/debian/copyright 2002-04-02 22:13:19.0000000=
00 +0200
+++ dictionaries-common-0.10/debian/copyright 2003-06-06 06:05:14.000000000=
+0200
@@ -2,6 +2,7 @@
=20
Copyright (C) 1999,2000,2001,2002 Rafael Laboissiere <rafael@debian.org>
Copyright (C) 2001,2002 Agust=EDn Mart=EDn Domingo <agmartin@debian.org>
+Copyright (C) 2003 Ren=E9 Engelhard <rene@debian.org>
=20
dictionaries-common is released under the terms of the GNU GPL, version 2,
or at your option, any later version. (see /usr/share/common-licenses/GPL).
diff -urN dictionaries-common-0.9.51/debian/dictionaries-common.substvars d=
ictionaries-common-0.10/debian/dictionaries-common.substvars
--- dictionaries-common-0.9.51/debian/dictionaries-common.substvars 1970-01=
-01 01:00:00.000000000 +0100
+++ dictionaries-common-0.10/debian/dictionaries-common.substvars 2003-06-0=
9 04:09:05.000000000 +0200
@@ -0,0 +1 @@
+misc:Depends=3Ddebconf (>=3D 0.5)
diff -urN dictionaries-common-0.9.51/debian/rules dictionaries-common-0.10/=
debian/rules
--- dictionaries-common-0.9.51/debian/rules 2003-03-20 13:17:14.000000000 +=
0100
+++ dictionaries-common-0.10/debian/rules 2003-06-09 04:10:06.000000000 +02=
00
@@ -58,7 +58,7 @@
dh_compress
dh_installdebconf
dh_installdeb
- dh_shlibdeps
+ dh_perl scripts/system/*
dh_gencontrol
dh_md5sums
dh_builddeb
diff -urN dictionaries-common-0.9.51/Makefile.in dictionaries-common-0.10/M=
akefile.in
--- dictionaries-common-0.9.51/Makefile.in 2003-06-03 12:02:40.000000000 +0=
200
+++ dictionaries-common-0.10/Makefile.in 2003-06-06 22:46:21.000000000 +0200
@@ -56,10 +56,13 @@
ispell_system_scripts :=3D $(addsuffix -ispell,$(base_system_scripts))=20
aspell_system_scripts :=3D $(addsuffix -aspell, update-dictcommon)
wordlist_system_scripts :=3D $(addsuffix -wordlist,$(base_system_scripts))
+myspell_system_scripts :=3D update-ooo-dictlist
+
system_scripts :=3D $(addprefix scripts/system/,\
$(ispell_system_scripts) \
$(aspell_system_scripts) \
- $(wordlist_system_scripts))
+ $(wordlist_system_scripts) \
+ $(myspell_system_scripts))
system_other_scripts :=3D $(addprefix scripts/system/, ispell-autobuildhas=
h)
=20
user_scripts :=3D $(addprefix scripts/system/, \
@@ -115,6 +118,11 @@
slice -oUNDEF+W+IW-I-A:$@ $<
=20
=20
+# ugly hack
+scripts/system/update-ooo-dictlist:
+ cp scripts/system/update-ooo-dictlist.in \
+ scripts/system/update-ooo-dictlist
+
#########################################################################
# Installation
=20
diff -urN dictionaries-common-0.9.51/policy/dsdt-policy.xml.in dictionaries=
-common-0.10/policy/dsdt-policy.xml.in
--- dictionaries-common-0.9.51/policy/dsdt-policy.xml.in 2003-03-13 16:19:1=
6.000000000 +0100
+++ dictionaries-common-0.10/policy/dsdt-policy.xml.in 2003-06-08 23:27:53.=
000000000 +0200
@@ -26,6 +26,9 @@
<!ENTITY RTSM "<filename>region-to-spelling.map</filename>">
<!ENTITY IDWP "ispell dictionary or wordlist package">
<!ENTITY IADWP "ispell or aspell dictionary or wordlist package">
+<!ENTITY IAMDWP "ispell or aspell or myspell dictionary or wordlist packag=
e">
+<!ENTITY MDP "myspell dictionary package">
+<!ENTITY IMDWP "ispell or myspell dictionary or wordlist package">
=20
<!ENTITY old-wlist-name "w<replaceable><language></replaceable>">
<!ENTITY new-design SYSTEM "../NEW-DESIGN">
@@ -90,6 +93,20 @@
<address><email>agmartin@debian.org</email></address>
</affiliation> =20
</author>
+ <author>
+ <firstname>
+ René
+ </firstname>
+ <surname>
+ Engelhard
+ </surname>
+ <affiliation>
+ <orgname>
+ The Debian Project
+ </orgname>
+ <address><email>rene@debian.org</email></address>
+ </affiliation>
+ </author>
<releaseinfo>
Release @RELEASE@ (@DATE@)
</releaseinfo>
@@ -102,7 +119,7 @@
</year>
<holder>
Rafael Laboissière, David Coe, & Agustín
- Martín Domingo=20
+ Martín Domingo, René Engelhard
</holder>
</copyright>
<legalnotice><!-- [[should be legalnotice, but that doesn't print]] -->
@@ -135,25 +152,25 @@
<para>
This document is intended for Debian maintainers whose packages
relate in some manner to the ispell program,
- ispell dictionaries, and/or wordlists (application-independent
- dictionaries).
+ ispell dictionaries, myspell dictionaries and/or wordlists
+ (application-independent dictionaries).
It concerns therefore the ispell package itself, the
- language-specific ispell dictionaries, the language-specific=20
- wordlists, some
+ language-specific ispell dictionaries, the language-specific myspell
+ dictionaries, the language-specific wordlists, some
editors like (X)Emacs and jed, some of the mail and news user
agents (MUAs, NUAs), and other tools that give the user a=20
choice of dictionaries for spell checking.
</para>
- <para>
+<!-- <para>
From now on the convention=20
IDWP =3D "&IDWP;" will be used for
- that packages when a short generic reference to them is desired.=20
- </para>
+ that packages when a short generic reference to them is desired.
+ </para> -->
<para>
The main goal of this Policy is to establish the basic requirements
for the said packages in a Debian system, allowing a high degree of
integration among them. This should yield a coherent behavior of all
- ispell dictionary and wordlist-related packages, both at
+ ispell/myspell dictionary and wordlist-related packages, both at
installation and usage time.
</para>
<para>
@@ -173,16 +190,6 @@
>http://savannah.gnu.org/download/aspell/manual/user/manual.html</uli=
nk>
</para></listitem>
</itemizedlist>
- <para>
- This document also does not affect myspell dictionaries. For the
- Spellcheck packaging guide for OpenOffice.org please look at
- <itemizedlist>
- <listitem><para>
- <ulink
- url=3D"http://cvs.debian.org/guides/spellcheck-packaging/?cvsroot=
=3Ddebian-openoffice">http://cvs.debian.org/guides/spellcheck-packaging/?cv=
sroot=3Ddebian-openoffice</ulink>
- </para></listitem>
- </itemizedlist>
- </para>
<sect2 renderas=3D"sect3"> <title> Advantages For Debian Users </title>
<!-- ***************************************************************=
******* -->
<itemizedlist>
@@ -247,27 +254,32 @@
<itemizedlist>
<listitem>
<para>
- If you maintain an ispell dictionary or wordlist package you must=20
- install package dictionaries-common. This package will conflict with
- all old style ispell dictionaries and wordlists packages. Since from
- this policy on ispell hash files should be 128 character per string
- it will also conflict with older ispell packages. If you use
- debhelper and want to use the debhelper like scripts you must also
- install package dictionaries-common-dev.=20
+ If you maintain an &IDWP; you must install the package
+ dictionaries-common. This package will conflict with all old
+ style &IDWP;s. Since from this policy on ispell hash files should
+ be 128 character per string it will also conflict with older ispell
+ packages. If you use debhelper and want to use the debhelper like
+ scripts you must also install package dictionaries-common-dev.=20
</para>
</listitem>
<listitem>
<para>
- There is no need to change the name of your package.=20
- For ispell dictionary and wordlist packages=20
- <emphasis>You have however to take care with one thing</emphasis>;
- since all such=20
- packages conforming to this policy will replace the old packages and
- pre-depend on the package dictionaries-common, you need to notify the
- dictionaries-common maintainer which one will be the last version
- of your package(s) not using the new policy. That versioned
- conflict will be added to the dictionaries-common package and
- after that your new policy compliant package can be used.
+ There is no need to change the name of your package for &IDWP;s.=20
+ <emphasis>You however have to take care with one thing</emphasis>;
+ since all such packages conforming to this policy will replace the
+ old packages and pre-depend on the package dictionaries-common, you
+ need to notify the dictionaries-common maintainer which one will
+ be the last version of your package(s) not using the new policy.=20
+ That versioned conflict will be added to the dictionaries-common
+ package and after that your new policy compliant package can be
+ used.
+ </para>
+ <para>
+ For &MDP;s however you have to rename your existing package
+ if it followed the old "OpenOffice.org Spellcheck Packages
+ Packaging Guide". You have to rename
+ openoffice.org-spellcheck-<langcode> to
+ myspell-<langcode>
</para>
</listitem>
<listitem>
@@ -286,7 +298,8 @@
<listitem>
<para>
Be sure that you are installing the correct files and symlinks
- in <filename>/usr/lib/ispell/</filename>
+ in <filename>/usr/lib/ispell/</filename>,
+ <filename>/usr/share/myspell/</filename>
or <filename>/usr/share/dict/</filename>. (see <xref
linkend=3D"installdir"/>).
</para>
@@ -298,7 +311,8 @@
<listitem>
<para>
First of all you need to have an
- <filename>info-{ispell,wordlist}</filename> file conforming to
+ <filename>info-{ispell,wordlist}</filename> or
+ for myspell just an ooentry file conforming to
the specified in <xref linkend=3D"infofile"/>.=20
</para>
<para>
@@ -309,8 +323,10 @@
You will need to install the dictionaries-common-dev package
first in order to have the new debhelper scripts
available. Unless you need extra features in your maintainer
- scripts or extra templates you are done. Otherwise, take a look
- at <xref linkend=3D"config"/> or <xref linkend=3D"templates"/>
+ scripts or extra templates you are done. Otherwise, take a
+ look at <xref linkend=3D"config"/> or
+ <xref linkend=3D"templates"/>. There is no script like that
+ necessary for &MDP;
</para>
</listitem>
<listitem>
@@ -410,8 +426,8 @@
A package dictionaries-common-dev, to which this Policy belongs, is =
also
provided. This is a package for maintainers of &IDWP;s. It contains =
the
Policy document itself, as well as =20
- debhelper-like scripts to simplify the debianization of ispell=20
- dictionary and wordlist packages (IDWP) for maintainers using debhel=
per.
+ debhelper-like scripts to simplify the debianization of &IDWP;s for
+ maintainers using debhelper.
It also (via this policy document) may provide suggestions or
patches for other related packages.
</para>
@@ -469,12 +485,13 @@
<para>=20
Emacsen, jed and mutt add-on support will be fully auto-generated by the
<command>update-default-(ispell|wordlist</command>) script. Also, links
- in <filename>/usr/lib/ispell</filename> corresponding to the Emacsen-Name:
- field will be automatically generated.=20
+ in <filename>/usr/lib/ispell</filename> corresponding to the
+ Emacsen-Name: field will be automatically generated.=20
</para>
<para>
Do not add emacs or jed startup files to your package. That will surely
- interfere with the autogenerated system and be the major source for probl=
ems.
+ interfere with the autogenerated system and be the major source for
+ problems.
</para>
</sect2>
</sect1>
@@ -483,12 +500,14 @@
<!-- *****************************************************************=
**** -->
<!-- * -->
<sect2 id=3D"naming" renderas=3D"sect3">
- <title> Naming of Language-specific ispell dictionary and wordlist P=
ackages</title>
+ <title> Naming of Language-specific ispell dictionary, myspell
+ dictionary and wordlist Packages</title>
<!-- ***************************************************************=
******* -->
<para>
Language-specific ispell dictionary packages and wordlists must be
named the classical way, =20
- like <quote>ifrench</quote>, <quote>wfrench</quote>, <quote>iswedish</quo=
te>, etc. =20
+ like <quote>ifrench</quote>, <quote>wfrench</quote>,
+ <quote>iswedish</quote>, etc. =20
Use of non-English language names is discouraged; for example
<quote>ingerman</quote> should <emphasis>not</emphasis> be=20
named <quote>indeutsch</quote>. (This is based on existing=20
@@ -519,19 +538,29 @@
in the dictionaries-common package.
</para>
</note>
+ <para>
+ &MDP;s must be called myspell-<isocode> (<isocode> bei=
ng
+ the two-digit isocode of the country). Exceptions can be made for
+ confusing codes (e.g. for uk which is the 2-digit code for Ukraini=
an).
+ </para>
+ <para>
+ If there are more myspell languages for a language (e.g.
+ de_DE, de_CH, ..) then the packages can be called
+ myspell-<langcode>-<countrycode> too..
+ </para>
</sect2>
<!-- * -->
<sect2 id=3D"relationships" renderas=3D"sect3"><title>Relationships </=
title>
<!-- ***************************************************************=
***** -->
<para>
The package relationships declared in the
- <filename>debian/control</filename> files should be as follows:
+ <filename>debian/control</filename> files should be as follows
+ for &IDWP;s:
</para>=20
<itemizedlist>
<listitem>
<para>
- All ispell dictionary and wordlist packages (IDWP) have to
- <emphasis>depend</emphasis> on
+ All &IDWP;s have to <emphasis>depend</emphasis> on
<filename>dictionaries-common</filename> in their=20
<filename>debian/control</filename> files.
</para>
@@ -600,6 +629,39 @@
</para>
</listitem>
</itemizedlist>
+ <para>
+ For &MDP;s the relationships in <filename>debian/control</filename>
+ should be as follows:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ the &MDP;s should depend on dictionaries-common (>=3D 0.10)
+ because in that revision the myspell stuff was added.
+ </para>
+ <para>
+ the myspell-<isocode> package should
+ <emphasis>provide</emphasis> the virtual packages
+ myspell-dictionary and myspell-dictionary-<isocode>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the packages must declare a <emphasis>Suggests:</emphasis> on
+ openoffice.org (>=3D 1.0.3-3) and mozilla-spellchecker
+ if the latter is available in Debian.
+ Moreover should it Conflict: against openoffice.org (<=3D 1.0.3-2)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The myspell packages having an "old" version named
+ openoffice.org-spellcheck-* should declare the magic
+ Conflicts: / Provides: / Replaces: combination "against"
+ the old package.
+ </para>
+ </listitem>
+ </itemizedlist>
</sect2>
<!-- * -->
<sect2 id=3D"infofile" renderas=3D"sect3"><title>The info file</title>
@@ -629,7 +691,7 @@
Coding-System: iso-8859-1
</programlisting>
<para>=20
- adapted to the corresponding language and IDWP.
+ adapted to the corresponding language and &IDWP;.
</para>
<para>
Each field in this file must be contained in a single line. They may
@@ -763,6 +825,21 @@
Wordlist packages only need to set the <quote>Language</quote> and
<quote>Hash-Name</quote> fields. Other fields will silently be ignored. =
=20
</para>
+ <para>
+ &MDP;s should provide a info file too -- this very
+ different though. &MDP; should provide an entry named as the package
+ which contains the lines which should be added to OpenOffice.org's
+ dictionary.lst; it should be installed into
+ <filename>/usr/share/myspell/infos/ooo</filename>. For example
+ </para>
+ <programlisting>
+# German (Germany)
+de DE de_DE
+ </programlisting>
+ <para>
+ which is the entry for German in Germany... For the exact meaning
+ of the fields see dictionary.lst(5).
+ </para>
<caution>
<title>Note for debhelper users</title>
<para>
@@ -812,14 +889,18 @@
as standard is probably right.
</quote>
</para>
+ <para>
+ &MDP;s are <quote>Architecture: all</quote> and have
+ priority <quote>optional</quote>.
+ </para>
</sect2>
<!-- * -->
<sect2 id=3D"installdir" renderas=3D"sect3">
<title>Installation Directories and Symlinks</title>
<!-- ***************************************************************=
****** -->
<para>
- Ispell dictionary hashed files (<filename>.hash</filename>) and affix tab=
le
- files (<filename>.aff</filename>) must be placed in the directory
+ Ispell dictionary hashed files (<filename>.hash</filename>) and affix
+ table iles (<filename>.aff</filename>) must be placed in the directory
<filename>/usr/lib/ispell/</filename>. =20
Wordlist dictionary files must be placed in the directory
<filename>/usr/share/dict/</filename>.
@@ -838,6 +919,15 @@
This may be of some help to local users who do not know the
language names in English.
</para>
+ <para>
+ myspell dictionary files (<filename>*.dic</filename> and
+ <filename>*.aff</filename>) should be installed in
+ <filename>/usr/share/myspell/dicts</filename>.
+ </para>
+ <para>
+ If the files are called e.g. de_DE.{dic,aff} then there should be a
+ symlink de-DE.{dic,aff} -> de_DE.{dic,aff} and the other way round...
+ </para>
</sect2>
<!-- * -->
<sect2 id=3D"scripts" renderas=3D"sect3">
@@ -917,7 +1007,52 @@
in <filename>/usr/share/dict/</filename>, respectively,=20
taking into account the selections made via debconf (see
<xref linkend=3D"debconf"/>). =20
- </para>=20
+ </para>
+ <para>
+ &MDP;s must have the following maintainer scripts:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ postinst
+ </para>
+ <programlisting>
+#!/bin/sh
+
+set -e
+
+if [ "$1" =3D "configure" ]; then
+ if [ -x /usr/bin/openoffice ]; then
+ update-ooo-dictlist
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ postrm
+ </para>
+ <programlisting>
+#!/bin/sh
+
+set -e
+
+if [ "$1" =3D "remove" ]; then
+ if [ -x /usr/bin/openoffice ]; then
+ update-ooo-dictlist
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
+ </programlisting>
+ </listitem>
+ </itemizedlist>
</sect2>
</sect1>
<!-- *******************************************************************=
******* -->
diff -urN dictionaries-common-0.9.51/scripts/system/update-ooo-dictlist.in =
dictionaries-common-0.10/scripts/system/update-ooo-dictlist.in
--- dictionaries-common-0.9.51/scripts/system/update-ooo-dictlist.in 1970-0=
1-01 01:00:00.000000000 +0100
+++ dictionaries-common-0.10/scripts/system/update-ooo-dictlist.in 2003-06-=
09 03:25:13.000000000 +0200
@@ -0,0 +1,145 @@
+#!/usr/bin/perl
+
+# update-ooo-dictlist -- update OpenOffice.org's dictionary.lst
+# (c) 2003 Ren=E9 Engelhard <rene@debian.org>
+# Public Domain
+
+use File::Temp qw/ :POSIX /;
+
+sub print_comments() {
+ print DL_TMP "## List of All Dictionaries to be Loaded by OpenOffice.org=
\n";
+ print DL_TMP "## ---------------------------------------------------\n";
+ print DL_TMP "## Each Entry in the list have the following space delimit=
ed";
+ print DL_TMP " fields\n";
+ print DL_TMP "##\n";
+ print DL_TMP "## Field 1: Entry Type \"DICT\" - spellchecking dictionary=
\n";
+ print DL_TMP "## \"HYPH\" - hyphenation dictionary\n=
";
+ print DL_TMP "## \"THES\" - thesaurus files\n";
+ print DL_TMP "##\n";
+ print DL_TMP "## Field 2: Language code from Locale \"en\" or \"de\" or =
";
+ print DL_TMP "\"pt\" ...\n";
+ print DL_TMP "##\n";
+ print DL_TMP "## Field 3: Country Code from Locale \"US\" or \"GB\" or ";
+ print DL_TMP "\"PT\"\n";
+ print DL_TMP "##\n";
+ print DL_TMP "## Field 4: Root name of file(s) \"en_US\" or \"hyph_de\" =
";
+ print DL_TMP "or \"th_en_US\"\n";
+ print DL_TMP "## (do not add extensions to the name)\n";
+ print DL_TMP "##\n";
+}
+
+# put all entries not in the automatic section in the new dictionary.lst
+# file (manually added dictionaries by the user)
+sub write_manually_added() {
+ while(<DL_ORIG>) {
+ my $line =3D $_;
+ chop($line);
+ # if we find the start of the section; set the flag that we are
+ # in the automatic section, ignore the following lines ...
+ if ($line eq "## !!! BEGIN AUTOMATIC SECTION -- DO NOT CHANGE !!!") {
+ $we_are_in_auto=3D1;
+ next;
+ }
+ # ... until we find the end and set the flag back.
+ if ($line eq "## !!! END AUTOMATIC SECTION -- DO NOT CHANGE !!!" ) {
+ $we_are_in_auto=3D0;
+ next;
+ }
+ # we are in non-automatic section; copy the user added entries
+ # into the temporary file; but that only if the line is not a ##
+ # comment or no blank line
+ if ($we_are_in_auto eq 0 and not $line =3D~ /^\#\#/ or not $line =3D~/=
=2E/) {
+ print DL_TMP $_;
+ } else { next; }
+ }
+}
+
+# read all files in $entrydir and put their contents verbatim in
+# the new dictionary.lst
+sub write_automatic_section() {
+ print DL_TMP "## !!! BEGIN AUTOMATIC SECTION -- DO NOT CHANGE !!!\n";
+ foreach $file (glob "$entrydir/*") {
+ open(ENTRY,"$file");
+ while (<ENTRY>) {
+ print DL_TMP $_;
+ }
+ close(ENTRY);
+ }
+ print DL_TMP "## !!! END AUTOMATIC SECTION -- DO NOT CHANGE !!!\n";
+}
+
+sub empty_line() {
+ print DL_TMP "\n";
+}
+
+$dictlist_orig=3D"/home/rene/test";
+$dictlist_tmp=3Dtmpnam();
+print STDERR "Temp: $dictlist_tmp";
+$entrydir=3D"/home/rene/la";
+
+if ($ENV{"USER"} ne "root") {=20
+ print STDERR "This script needs root privileges...\n";
+ die;
+}
+
+if ( -e $dictlist_orig ) {
+ $we_have_old_file=3D1;
+=09
+ open(DL_ORIG, "$dictlist_orig") # open the existing file for reading...
+ or die("Opening $dictlist_orig failed.\n");
+}
+
+open(DL_TMP, ">$dictlist_tmp") # and the temporary one for writing...
+ or die("Opening temporary file failed.\n");
+
+print STDERR "Updating OpenOffice.org's dictionary list... ";
+print_comments();
+empty_line();
+write_automatic_section();
+empty_line();
+if ($we_have_old_file) {
+ $we_are_in_auto=3D0;
+ write_manually_added();
+}
+print STDERR "done.\n";
+
+# close both files...
+close(DL_ORIG);
+close(DL_TMP);
+# .. and replace the old file with the new one.
+if ($we_have_old_file) {
+ unlink($dictlist_orig);
+}
+
+# hmm. rename does not work...
+system("mv $dictlist_tmp $dictlist_orig");
+# make sure the file has the right permissions
+chown(0, 0, $dictlist_orig);
+chmod (0644, $dictlist_orig);
+
+__END__
+
+=3Dhead1 NAME
+
+update-ooo-dictlist - rebuild /etc/openoffice/dictionary.lst
+
+=3Dhead1 SYNOPSIS
+
+update-ooo-dictlist
+
+=3Dhead1 DESCRIPTION
+
+This script takes the info files from /usr/share/myspell/infos (which
+are installed by packages and SHOULDN'T be touched and the old
+/etc/openoffice/dictionary.lst if existing and builds a new
+file updating the information.
+
+=3Dhead1 SEE ALSO
+
+openoffice(1), dictionary.lst(5)
+
+=3Dhead1 AUTHOR
+
+Rene Engelhard
+
+=3Dcut
--+QahgC5+KEYLbs62--
--TRYliJ5NKNqkz5bu
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE+5HfT+FmQsCSK63MRAolTAJ4vL7SUtKyEv+CHXGu8ieJsnjb0VQCeKDG/
tLUfv3Oj4GAflqGMCnUCZBQ=
=tLGq
-----END PGP SIGNATURE-----
--TRYliJ5NKNqkz5bu--