rpms/libtextcat/devel libtextcat-2.2-exportapi.patch, NONE, 1.1 libtextcat.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Caolan McNamara (caolanm) fedora-extras-commits at redhat.com
Fri Jul 6 18:40:01 UTC 2007


Author: caolanm

Update of /cvs/pkgs/rpms/libtextcat/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21370/devel

Modified Files:
	.cvsignore sources 
Added Files:
	libtextcat-2.2-exportapi.patch libtextcat.spec 
Log Message:


libtextcat-2.2-exportapi.patch:

--- NEW FILE libtextcat-2.2-exportapi.patch ---
diff -ruN libtextcat-2.2.orig/src/common.c libtextcat-2.2/src/common.c
--- libtextcat-2.2.orig/src/common.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/common.c	2007-06-27 17:45:16.000000000 +0100
@@ -45,7 +45,7 @@
 #endif
 #include <stdarg.h>
 #include <ctype.h>
-#include "common.h"
+#include "common_impl.h"
 
 extern void wgmem_error( const char *fmt, ... )
 {
diff -ruN libtextcat-2.2.orig/src/common_impl.h libtextcat-2.2/src/common_impl.h
--- libtextcat-2.2.orig/src/common_impl.h	1970-01-01 01:00:00.000000000 +0100
+++ libtextcat-2.2/src/common_impl.h	2007-06-27 17:45:16.000000000 +0100
@@ -0,0 +1,66 @@
+#ifndef _COMMON_IMPL_H_
+#define _COMMON_IMPL_H_
+/**
+ * common_impl.h -- a mixed bag of helper functions 
+ *
+ * Copyright (C) 2003 WiseGuys Internet B.V.
+ *
+ * THE BSD LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * 
+ * - Neither the name of the WiseGuys Internet B.V. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#ifndef HAVE_MALLOC
+#error "This library needs a GNU like malloc to compile. 'configure' says there isn't one."
+#endif
+#ifndef HAVE_REALLOC
+#error "This library needs a GNU like realloc to compile. 'configure' says there isn't one."
+#endif
+#ifndef HAVE_STRDUP
+#error "This library needs a GNU like strdup to compile. 'configure' says there isn't one."
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include "common.h"
+
+#define WGMIN(x,y)         ((x)<=(y)?(x):(y))
+#define WGMAX(x,y)         ((x)<=(y)?(y):(x))
+#define __STR__(x)         #x
+#define WGSTR(x)           __STR__(x)
+
+#endif
diff -ruN libtextcat-2.2.orig/src/createfp.c libtextcat-2.2/src/createfp.c
--- libtextcat-2.2.orig/src/createfp.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/createfp.c	2007-06-27 17:45:16.000000000 +0100
@@ -44,7 +44,7 @@
 #endif
 
 #include "fingerprint.h"
-#include "common.h"
+#include "common_impl.h"
 
 #define BLOCKSIZE 4096
 
diff -ruN libtextcat-2.2.orig/src/fingerprint.c libtextcat-2.2/src/fingerprint.c
--- libtextcat-2.2.orig/src/fingerprint.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/fingerprint.c	2007-06-27 17:45:16.000000000 +0100
@@ -76,7 +76,7 @@
 #endif
 #include <ctype.h>
 
-#include "common.h"
+#include "common_impl.h"
 #include "wg_mempool.h"
 #include "constants.h"
 
diff -ruN libtextcat-2.2.orig/src/Makefile.am libtextcat-2.2/src/Makefile.am
--- libtextcat-2.2.orig/src/Makefile.am	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/Makefile.am	2007-06-27 17:47:40.000000000 +0100
@@ -8,7 +8,11 @@
 AM_LDFLAGS =	-g
 
 noinst_HEADERS = \
-	common.h constants.h fingerprint.h textcat.h wg_mempool.h
+	common_impl.h wg_mempool.h
+
+libtextcat_includedir = $(includedir)/libtextcat
+libtextcat_include_HEADERS = \
+	common.h constants.h fingerprint.h textcat.h
 
 lib_LTLIBRARIES =	libtextcat.la
 libtextcat_la_SOURCES = \
diff -ruN libtextcat-2.2.orig/src/testtextcat.c libtextcat-2.2/src/testtextcat.c
--- libtextcat-2.2.orig/src/testtextcat.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/testtextcat.c	2007-06-27 17:45:16.000000000 +0100
@@ -47,7 +47,7 @@
 #endif
 
 #include "textcat.h"
-#include "common.h"
+#include "common_impl.h"
 
 #define BLOCKSIZE 4096
 
diff -ruN libtextcat-2.2.orig/src/textcat.c libtextcat-2.2/src/textcat.c
--- libtextcat-2.2.orig/src/textcat.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/textcat.c	2007-06-27 17:45:16.000000000 +0100
@@ -65,7 +65,7 @@
 #include <alloca.h>
 #endif
 
-#include "common.h"
+#include "common_impl.h"
 #include "fingerprint.h"
 #include "textcat.h"
 #include "constants.h"
diff -ruN libtextcat-2.2.orig/src/wg_mempool.c libtextcat-2.2/src/wg_mempool.c
--- libtextcat-2.2.orig/src/wg_mempool.c	2007-06-27 17:02:34.000000000 +0100
+++ libtextcat-2.2/src/wg_mempool.c	2007-06-27 17:45:16.000000000 +0100
@@ -41,7 +41,7 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-#include "common.h"
+#include "common_impl.h"
 
 typedef struct memblock_s {
 	char *pool;             
diff -ru libtextcat-2.2.orig/src/common.h libtextcat-2.2/src/common.h
--- libtextcat-2.2.orig/src/common.h	2003-05-22 14:02:29.000000000 +0100
+++ libtextcat-2.2/src/common.h	2007-06-28 09:10:42.000000000 +0100
@@ -1,7 +1,7 @@
 #ifndef _COMMON_H_
 #define _COMMON_H_
 /**
- * common.h -- a mixed bag of helper functions 
+ * common.h
  *
  * Copyright (C) 2003 WiseGuys Internet B.V.
  *
@@ -36,56 +36,24 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#ifndef HAVE_MALLOC
-#error "This library needs a GNU like malloc to compile. 'configure' says there isn't one."
-#endif
-#ifndef HAVE_REALLOC
-#error "This library needs a GNU like realloc to compile. 'configure' says there isn't one."
-#endif
-#ifndef HAVE_STRDUP
-#error "This library needs a GNU like strdup to compile. 'configure' says there isn't one."
-#endif
 #include <stdio.h>
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
-#else
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #include <time.h>
 
-#define WGMIN(x,y)         ((x)<=(y)?(x):(y))
-#define WGMAX(x,y)         ((x)<=(y)?(y):(x))
-#define __STR__(x)         #x
-#define WGSTR(x)           __STR__(x)
-
-#ifdef HAVE_INTTYPES_H
-typedef uint32_t	uint4;
-typedef uint16_t	uint2;
-typedef uint8_t		uchar;
-
-typedef int32_t		sint4;
-typedef int16_t		sint2;
-typedef int8_t		schar;
-
-typedef int8_t		boole;
-#else
-typedef unsigned long	uint4;
-typedef unsigned int	uint2;
-typedef unsigned char	uchar;
-
-typedef long		sint4;
-typedef int		sint2;
-typedef char		schar;
-
-typedef char		boole;
+#ifdef __cplusplus
+extern "C" {
 #endif
 
+typedef uint32_t        uint4;
+typedef uint16_t        uint2;
+typedef uint8_t         uchar;
+
+typedef int32_t         sint4;
+typedef int16_t         sint2;
+typedef int8_t          schar;
+
+typedef int8_t          boole;
+
 typedef struct wgtimer_s {
         struct timeval start;
         struct timeval stop;
@@ -108,6 +76,8 @@
 extern char *wg_strgmov( char *dest, const char *src, const char *destlimit );
 extern char *wg_trim( char *dest, const char *src );
 
+#ifdef __cplusplus
+}
+#endif
       
 #endif
-
diff -ru libtextcat-2.2.orig/src/fingerprint.h libtextcat-2.2/src/fingerprint.h
--- libtextcat-2.2.orig/src/fingerprint.h	2003-05-19 13:16:31.000000000 +0100
+++ libtextcat-2.2/src/fingerprint.h	2007-06-28 09:11:17.000000000 +0100
@@ -35,6 +35,10 @@
  */
 #include "common.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void *fp_Init(const char *name);
 extern void fp_Done( void *handle );
 extern int fp_Create( void *handle, const char *buffer, uint4 bufsize, uint4 maxngrams );
@@ -44,4 +48,8 @@
 extern const char *fp_Name( void *handle );
 extern void fp_Print( void *handle, FILE *fp );
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
--- libtextcat-2.2.orig/src/textcat.h	2007-06-28 09:19:26.000000000 +0100
+++ libtextcat-2.2/src/textcat.h	2007-06-28 09:20:19.000000000 +0100
@@ -37,6 +37,10 @@
  */
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define _TEXTCAT_RESULT_UNKOWN        "UNKNOWN"
 #define _TEXTCAT_RESULT_SHORT         "SHORT"
 
@@ -77,4 +81,9 @@
  * textcat_Version() - Returns a string describing the version of this classifier.
  */
 extern char *textcat_Version();
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif


--- NEW FILE libtextcat.spec ---
Summary: Text Categorization Library
Name: libtextcat
Version: 2.2
Release: 5%{?dist}
Group: System Environment/Libraries
License: BSD
Source: http://software.wise-guys.nl/download/%{name}-%{version}.tar.gz
URL: http://software.wise-guys.nl/libtextcat/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool
Patch0: libtextcat-2.2-exportapi.patch

%description
Libtextcat is a library with functions that implement the classification
technique described in Cavnar & Trenkle, "N-Gram-Based Text Categorization".
It was primarily developed for language guessing, a task on which it is known
to perform with near-perfect accuracy.

%package devel
Summary: Support files necessary to compile applications with libtextcat
Group: Development/Libraries
Requires: libtextcat = %{version}-%{release}

%description devel
Libraries, headers, and support files necessary to compile applications 
using libtextcat.

%prep
%setup -q
%patch0 -p1 -b .exportapi.patch

%build
autoreconf -f -i
%configure --disable-static
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc ChangeLog README LICENSE TODO               
%{_libdir}/lib*.so.*

%files devel
%defattr(-,root,root,-)
%{_bindir}/createfp
%{_libdir}/*.so
%{_includedir}/%{name}/

%clean
rm -r $RPM_BUILD_ROOT

%changelog
* Fri Jul 06 2007 Caolan McNamara <caolanm at redhat.com> 2.2-5
- BuildRequire

* Thu Jun 28 2007 Caolan McNamara <caolanm at redhat.com> 2.2-4
- extern "C" + BuildRequire

* Wed Jun 27 2007 Caolan McNamara <caolanm at redhat.com> 2.2-3
- export api

* Wed Jun 27 2007 Caolan McNamara <caolanm at redhat.com> 2.2-2
- missing necessary headersS

* Wed Jun 27 2007 Caolan McNamara <caolanm at redhat.com> 2.2-1
- Initial version


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/libtextcat/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	6 Jul 2007 18:05:44 -0000	1.1
+++ .cvsignore	6 Jul 2007 18:39:24 -0000	1.2
@@ -0,0 +1 @@
+libtextcat-2.2.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libtextcat/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	6 Jul 2007 18:05:44 -0000	1.1
+++ sources	6 Jul 2007 18:39:24 -0000	1.2
@@ -0,0 +1 @@
+128cfc86ed5953e57fe0f5ae98b62c2e  libtextcat-2.2.tar.gz




More information about the fedora-extras-commits mailing list