rpms/mingw32-enchant/F-11 compile-resources, NONE, 1.1 enchant-1.5.0-abi12160.searchdirs.patch, NONE, 1.1 enchant-1.5.0-abi12173.leaks.patch, NONE, 1.1 enchant-1.5.0-abi12174.fixbadmatch.patch, NONE, 1.1 enchant-mingw-compile-fix.patch, NONE, 1.1 mingw32-enchant.spec, NONE, 1.1 sources, 1.1, 1.2

epienbro epienbro at fedoraproject.org
Tue Aug 11 16:30:35 UTC 2009


Author: epienbro

Update of /cvs/pkgs/rpms/mingw32-enchant/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29927/F-11

Modified Files:
	sources 
Added Files:
	compile-resources enchant-1.5.0-abi12160.searchdirs.patch 
	enchant-1.5.0-abi12173.leaks.patch 
	enchant-1.5.0-abi12174.fixbadmatch.patch 
	enchant-mingw-compile-fix.patch mingw32-enchant.spec 
Log Message:
Initial import



--- NEW FILE compile-resources ---
#!/bin/sh

# Script to compile a resource file for a DLL if there is a .rc file
# for it. The resource source file is supposed to contain a version
# info section, that uses the string BUILDNUMBER as the least
# significant part of the version numbers. This script replaces that
# string with a "build number" before compiling the binary resource
# file. The build number is kept between builds in a "stamp" file, and
# incremented each time. (If there is no stamp file, build number 0 is
# used.) The intention is that only the "official" maintainer of a DLL
# keeps such a stamp file, and thus the DLLs he releases have
# increasing version number resources, which can be used by an
# installer program to decide whether to replace an existing DLL with
# the same name.

# This is just my (tml at iki.fi) idea, if somebody comes up with a
# better way to generate version number resources, don't hesitate to
# suggest.

# The command line arguments are:
# $1: the name of the .rc file to check
# $2: the name of the resource object file to produce, if the rc file exists

# Check if we have a resource file for this DLL.
rcfile=$1
resfile=$2
if [ -f $rcfile ]; then
    # Check if we have a build number stamp file.
    basename=`basename $rcfile .rc`
    if [ -f $basename-build.stamp ]; then
	read number <$basename-build.stamp
	buildnumber=$[number]
	echo Build number $buildnumber
	rm -rf $basename-build.stamp
    else
	echo Using zero as build number
        buildnumber=0
    fi

    m4 -DBUILDNUMBER=$buildnumber <$rcfile >$$.rc &&
	${WINDRES-windres} $$.rc $resfile &&
	rm $$.rc
else
    # Return failure
    exit 1
fi

enchant-1.5.0-abi12160.searchdirs.patch:
 enchant.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- NEW FILE enchant-1.5.0-abi12160.searchdirs.patch ---
diff -ru enchant-1.5.0.orig/src/enchant.c enchant-1.5.0/src/enchant.c
--- enchant-1.5.0.orig/src/enchant.c	2009-06-22 11:53:16.000000000 +0100
+++ enchant-1.5.0/src/enchant.c	2009-06-22 11:53:39.000000000 +0100
@@ -232,6 +232,9 @@
 	if (module_dir)
 		module_dirs = enchant_slist_append_unique_string (module_dirs, module_dir);
 
+#if defined(ENCHANT_GLOBAL_MODULE_DIR)
+	module_dirs = enchant_slist_append_unique_string (module_dirs, g_strdup (ENCHANT_GLOBAL_MODULE_DIR));
+#else
 	/* Dynamically locate library and search for modules relative to it. */
 	prefix = enchant_get_prefix_dir();
 	if(prefix)
@@ -240,9 +243,6 @@
 			g_free(prefix);
 			module_dirs = enchant_slist_append_unique_string (module_dirs, module_dir);
 		}
-
-#if defined(ENCHANT_GLOBAL_MODULE_DIR)
-	module_dirs = enchant_slist_append_unique_string (module_dirs, g_strdup (ENCHANT_GLOBAL_MODULE_DIR));
 #endif
 
 	return module_dirs;

enchant-1.5.0-abi12173.leaks.patch:
 src/enchant.c          |    6 +++++-
 tests/enchant-ispell.c |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

--- NEW FILE enchant-1.5.0-abi12173.leaks.patch ---
diff -ru enchant-1.4.2.orig/src/enchant.c enchant-1.4.2/src/enchant.c
--- enchant-1.4.2.orig/src/enchant.c	2009-06-29 17:47:11.000000000 +0100
+++ enchant-1.4.2/src/enchant.c	2009-06-29 20:46:17.000000000 +0100
@@ -1543,11 +1544,13 @@
 	EnchantDict *dict;
 	EnchantProvider *owner;
 	EnchantSession *session;
+	EnchantDictPrivateData *enchant_dict_private_data;
 	
 	g_return_if_fail (data);
 	
 	dict = (EnchantDict *) data;
-	session = ((EnchantDictPrivateData*)dict->enchant_private_data)->session;
+	enchant_dict_private_data = (EnchantDictPrivateData*)dict->enchant_private_data;
+	session = enchant_dict_private_data->session;
 	owner = session->provider;
 	
 	if (owner && owner->dispose_dict) 
@@ -1555,6 +1558,8 @@
 	else if(session->is_pwl)
 		g_free (dict);
 
+	g_free(enchant_dict_private_data);
+
 	enchant_session_destroy (session);
 }
 
diff -ru enchant-1.4.2.orig/tests/enchant-ispell.c enchant-1.4.2/tests/enchant-ispell.c
--- enchant-1.4.2.orig/tests/enchant-ispell.c	2009-06-29 17:47:11.000000000 +0100
+++ enchant-1.4.2/tests/enchant-ispell.c	2009-06-29 20:45:29.000000000 +0100
@@ -431,6 +431,8 @@
 					do_mode_a (out, dict, word, pos, lineCount);
 				else if (mode == MODE_L)
 					do_mode_l (out, dict, word, lineCount);
+
+				g_string_free(word, TRUE);
 			}
 			if (token_ptr)
 				g_slist_free (token_ptr);
@@ -446,8 +448,6 @@
 	enchant_broker_free_dict (broker, dict);
 	enchant_broker_free (broker);
 
-	if (word)
-		g_string_free (word, TRUE);
 	g_string_free (str, TRUE);
 
 	return 0;

enchant-1.5.0-abi12174.fixbadmatch.patch:
 myspell_checker.cpp |   32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

--- NEW FILE enchant-1.5.0-abi12174.fixbadmatch.patch ---
diff -ru enchant-1.4.2.orig/src/myspell/myspell_checker.cpp enchant-1.4.2/src/myspell/myspell_checker.cpp
--- enchant-1.4.2.orig/src/myspell/myspell_checker.cpp	2009-06-29 17:04:41.000000000 +0100
+++ enchant-1.4.2/src/myspell/myspell_checker.cpp	2009-06-29 17:25:40.000000000 +0100
@@ -341,6 +341,27 @@
     return g_file_test(aff.c_str(), G_FILE_TEST_EXISTS) != 0;
 }
 
+static bool is_plausible_dict_for_tag(const char *dir_entry, const char *tag)
+{
+    const char *dic_suffix = ".dic";
+    size_t dic_suffix_len = strlen(dic_suffix);
+    size_t dir_entry_len = strlen(dir_entry);
+    size_t tag_len = strlen(tag);
+
+    if (dir_entry_len - dic_suffix_len < tag_len)
+        return false;
+    if (strcmp(dir_entry+dir_entry_len-dic_suffix_len, dic_suffix) != 0)
+        return false;
+    if (strncmp (dir_entry, tag, tag_len) != 0)
+        return false;
+    //e.g. requested dict for "fi",
+    //reject "fil_PH.dic"
+    //allow "fi-FOO.dic", "fi_FOO.dic", "fi.dic", etc.
+    if (!ispunct(dir_entry[tag_len]))
+        return false;
+    return true;
+}
+
 static char *
 myspell_request_dictionary (EnchantBroker * broker, const char * tag) 
 {
@@ -364,14 +385,13 @@
 		if (dir) {
 			const char *dir_entry;
 			while ((dir_entry = g_dir_read_name (dir)) != NULL) {
-				if (strncmp (dir_entry, tag, strlen(tag)) == 0 &&
-				    strstr (dir_entry, ".dic") != NULL) {
+				if (is_plausible_dict_for_tag(dir_entry, tag)) {
 					char *dict = g_build_filename (dirs[i].c_str(), 
 								       dir_entry, NULL);
-                    if(s_hasCorrespondingAffFile(dict)){
-			                    g_dir_close (dir);
-					    return dict;
-                    }
+					if(s_hasCorrespondingAffFile(dict)){
+						g_dir_close (dir);
+						return dict;
+					}
 				}
 			}
 

enchant-mingw-compile-fix.patch:
 myspell_checker.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

--- NEW FILE enchant-mingw-compile-fix.patch ---
--- src/myspell/myspell_checker.cpp.orig	2009-05-23 11:44:14.000000000 +0200
+++ src/myspell/myspell_checker.cpp	2009-08-08 11:53:11.648688871 +0200
@@ -38,6 +38,12 @@
 #include "enchant.h"
 #include "enchant-provider.h"
 
+#ifdef WIN32
+/* The above #include caused a macro to be defined which
+ * causes a compile error later on. Work around this */
+#undef near
+#endif
+
 /* built against hunspell 1.2.2 on 2008-04-12 */
 
 #ifdef HUNSPELL_STATIC


--- NEW FILE mingw32-enchant.spec ---
%global __strip %{_mingw32_strip}
%global __objdump %{_mingw32_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{_mingw32_findrequires}
%global __find_provides %{_mingw32_findprovides}

Summary:       MinGW Windows Enchanting Spell Checking Library
Name:          mingw32-enchant
Version:       1.5.0
Release:       2%{?dist}
Group:         System Environment/Libraries
License:       LGPLv2+
Source0:       http://www.abisource.com/downloads/enchant/%{version}/enchant-%{version}.tar.gz
Source1:       compile-resources
URL:           http://www.abisource.com/
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

BuildRequires: mingw32-filesystem
BuildRequires: mingw32-gcc
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-binutils
BuildRequires: mingw32-glib2 >= 2.6.0
BuildRequires: mingw32-hunspell
BuildRequires: m4
BuildArch:     noarch

Requires:      pkgconfig

Patch0:        enchant-mingw-compile-fix.patch

Patch10:       enchant-1.5.0-abi12160.searchdirs.patch
Patch11:       enchant-1.5.0-abi12173.leaks.patch
Patch12:       enchant-1.5.0-abi12174.fixbadmatch.patch


%description
A library that wraps other spell checking backends.

This is the MinGW build of enchant


%package static
Summary:        Static version of the MinGW Windows enchant library
Requires:       %{name} = %{version}-%{release}
Group:          Development/Libraries

%description static
Static version of the MinGW Windows enchant spell checking library.


%prep
%setup -qn "enchant-%{version}"

# There's a file missing from the tarball
# http://www.abisource.com/viewvc/enchant/trunk/compile-resource?revision=21303
cp %{SOURCE1} compile-resource
chmod 755 compile-resource

# Fix for a conflict between Hunspell and windef.h
# http://www.abisource.com/viewvc?view=rev&revision=26532
%patch0 -p0 -b .near

#http://bugzilla.abisource.com/show_bug.cgi?id=12160
%patch10 -p1 -b .searchdirs
#http://bugzilla.abisource.com/show_bug.cgi?id=12173
%patch11 -p1 -b .leaks
#http://bugzilla.abisource.com/show_bug.cgi?id=12174
%patch12 -p1 -b .fixbadmatch


%build
%{_mingw32_configure}   \
    --disable-ispell    \
    --disable-hspell    \
    --disable-aspell    \
    --enable-static     \
    --enable-shared
make
# When using make -j4 (which is the case with Koji) the following compile error occurs:
# /bin/sh ../libtool --tag=CC   --mode=link i686-pc-mingw32-gcc  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -mms-bitfields -no-undefined -export-dynamic -avoid-version   -o libenchant.la -rpath /usr/i686-pc-mingw32/sys-root/mingw/lib prefix.lo enchant.lo pwl.lo -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lgmodule-2.0 -lglib-2.0 -lintl   enchant-win32res.lo 
# libtool: link: `enchant-win32res.lo' is not a valid libtool object
#
# I haven't been able to find the exact cause yet so 'make %{?_smp_mflags}' has been disabled for now


%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# Drop the man-pages
rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/man


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING.LIB README
%{_mingw32_bindir}/enchant-lsmod.exe
%{_mingw32_bindir}/enchant.exe
%{_mingw32_bindir}/libenchant.dll
%{_mingw32_includedir}/enchant/
%dir %{_mingw32_libdir}/enchant/
%{_mingw32_libdir}/enchant/libenchant_myspell.dll
%{_mingw32_libdir}/enchant/libenchant_myspell.dll.a
%{_mingw32_libdir}/enchant/libenchant_myspell.la
%{_mingw32_libdir}/libenchant.dll.a
%{_mingw32_libdir}/libenchant.la
%{_mingw32_libdir}/pkgconfig/enchant.pc
%{_mingw32_datadir}/enchant/

%files static
%defattr(-,root,root,-)
%{_mingw32_libdir}/libenchant.a
%{_mingw32_libdir}/enchant/libenchant_myspell.a


%clean
rm -rf $RPM_BUILD_ROOT


%changelog
* Sun Aug  9 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.5.0-2
- Dropped BR: autoconf libtool
- Added BR: m4
- Use 'rm -rf $RPM_BUILDROOT' in the %%clean phase
- Fixed a 'strange-permission' rpmlint warning
- Moved the file %%{_mingw32_libdir}/enchant/libenchant_myspell.a to
  the -static subpackage
- Use a more verbose %%files list
- Added a Requires: pkgconfig to the main package
- Added patches from the native enchant package
- Dropped another patch which isn't necessary anymore

* Sat Aug  8 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.5.0-1
- Update to version 1.5.0
- Drop upstreamed patch
- Don't use 'make %%{?_smp_mflags}' as this causes a compile failure in Koji

* Mon May 11 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.4.2-6
- Ported the native package to have MinGW support
- Dropped the epoch as this is a new package
- Fixed %%defattr line

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:1.4.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jul 26 2008 Michael Schwendt <mschwendt at fedoraproject.org> 1:1.4.2-4
- Rebuild for ABI-incompatible hunspell-1.2.4.2-2.fc10

* Thu Jul 10 2008 Marc Maurer <uwog at abisource.com> 1:1.4.2-3
- Fix 426712: don't build static libs (patch from Michael Schwendt)

* Wed May 21 2008 Marc Maurer <uwog at abisource.com> 1:1.4.2-2
- Rebuild

* Wed May 21 2008 Marc Maurer <uwog at abisource.com> 1:1.4.2-1
- New upstream release
- Add voikko support in an enchant-voikko package
- Bump glib-devel BR to 2.6.0

* Fri Feb 08 2008 Caolan McNamara <caolanm at redhat.com> 1:1.3.0-4.fc9
- minor cockup

* Sat Jan 26 2008 Caolan McNamara <caolanm at redhat.com> 1:1.3.0-3.fc9
- Resolves: rhbz#426402 use system hunspell not internal one and 
  split out aspell backend.
- See: rhbz#430354 hspell backend disabled until pic issue fixed

* Wed Dec 19 2007 Caolan McNamara <caolanm at redhat.com> 1:1.3.0-2.fc9
- tell enchant where the myspell dictionaries are

* Thu Oct 12 2006 Marc Maurer <uwog at abisource.com> 1:1.3.0-1.fc6
- Update to 1.3.0

* Mon Sep 11 2006 Marc Maurer <uwog at abisource.com> 1:1.2.5-3.fc6
- Rebuild for FC6

* Mon Apr 10 2006 Marc Maurer <uwog at abisource.com> 1:1.2.5-2.fc6
- Rebuild

* Mon Apr 10 2006 Marc Maurer <uwog at abisource.com> 1:1.2.5-1.fc6
- Package the data dir as well (bug 188516)
- New upstream version
- Add hspell requirement/support

* Tue Feb 14 2006 Marc Maurer <uwog at abisource.com> 1:1.2.2-2.fc5
- Rebuild for Fedora Extras 5

* Sun Feb 05 2006 Marc Maurer <uwog at abisource.com> 1:1.2.2-1.fc5
- Update to 1.2.2

* Mon Jan 30 2006 Marc Maurer <uwog at abisource.com> 1:1.2.1-1.fc5
- Update to 1.2.1
- Drop glib Require

* Sat Oct 22 2005 Marc Maurer <uwog at abisource.com> 1:1.2.0-1.fc5
- Update to 1.2.0

* Wed Oct  5 2005 Marc Maurer <uwog at abisource.com> 1:1.1.6-4.fc5
- Add dist flag to the release number

* Mon Apr  4 2005 Michael Schwendt <mschwendt[AT]users.sf.net> 1:1.1.6-3
- make in %%build
- disable bad buildroot rpaths in libs, don't use %%makeinstall
- require %%{epoch} of main package in -devel package (Fridrich Strba)

* Thu Mar 31 2005 Michael Schwendt <mschwendt[AT]users.sf.net> 1:1.1.6-2
- add dep glib2-devel for pkgconfig in -devel package
- include %%{_libdir}/enchant dir in main package
- make -devel package require exact VR of main package
- use -p /sbin/ldconfig in scriptlets

* Mon Mar 28 2005 Marc Maurer <uwog at abisource.com> 1:1.1.6-1
- update to 1.1.6
- drop the manpage patch (RH#145010#)
- fix version numbers in the spec changelog

* Wed Mar  2 2005 Caolan McNamara <caolanm at redhat.com> 1:1.1.5-3
- rebuild with gcc4

* Fri Jan 14 2005 Caolan McNamara <caolanm at redhat.com> 1:1.1.5-2
- RH#145010# misformatted manpage

* Mon Dec 20 2004 Caolan McNamara <caolanm at redhat.com> 1:1.1.5-1
- initial fedora import

* Sun Aug 24 2003 Rui Miguel Seabra <rms at 1407.org>
- update spec to current stat of affairs
- building from source rpm is now aware of --with and --without flags:
- --without aspell --without ispell --without myspell --with uspell

* Wed Jul 16 2003 Rui Miguel Seabra <rms at 1407.org>
- take advantage of environment rpm macros

* Sun Jul 13 2003 Dom Lachowicz <cinamod at hotmail.com>
- Initial version


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-enchant/F-11/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	10 Aug 2009 05:37:37 -0000	1.1
+++ sources	11 Aug 2009 16:30:35 -0000	1.2
@@ -0,0 +1 @@
+7dfaed14e142b4a0004b770c9568ed02  enchant-1.5.0.tar.gz




More information about the fedora-extras-commits mailing list