+--- 4.1.3 2011/01/27
+
+Update yaz.spec to operate on both SLES11 / Centos 5.5.
+
+RPM: Release includes 'indexdata' name. Use indexdata in release name so
+this package can be distinguished from other vendors.
+
+yaz-config: Use exec_prefix, libdir, includedir . Use these variables
+as determined by configure
+
+yaz-config: set YAZ_VERSION env. php_yaz relies on it.
+
+GFS: Z_PresentStatus_partial_4 for missing record. If bend_fetch handler
+returns no error and no record, the present request is considered
+partial (only a subset of the records could be returned by backend), and
+so it is appropriate to set Present Status to partial-4.
+
--- 4.1.2 2010/11/02
Move yaz-config man pages to section 1.
dnl This file is part of the YAZ toolkit.
dnl Copyright (C) 1995-2011 Index Data
AC_PREREQ([2.60])
-AC_INIT([yaz],[4.1.2],[yaz-help@indexdata.dk])
+AC_INIT([yaz],[4.1.3],[yaz-help@indexdata.dk])
AC_CONFIG_HEADERS(include/config.h)
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
+yaz (4.1.3-1indexdata) unstable; urgency=low
+
+ * Upstream.
+
+ -- Adam Dickmeiss <adam@indexdata.dk> Thu, 27 Jan 2011 13:56:54 +0100
+
yaz (4.1.2-1indexdata) unstable; urgency=low
* Upstream.
<!ENTITY gfs-synopsis-app "application">
<!ENTITY reference-tools-cql-map "<xref linkend='cql.to.rpn'/>">
<!ENTITY reference-tools-ccl-qualifiers "<xref linkend='ccl.qualifiers'/>">
-<!ENTITY copyright-year "1995-2010">
+<!ENTITY copyright-year "1995-2011">
AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS)
libyaz_la_LIBADD = $(SSL_LIBS) $(TCPD_LIBS)
libyaz_server_la_LIBADD = libyaz.la
-libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS) -I../libstemmer_c/include
+libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS) -I$(top_srcdir)/libstemmer_c/include
libyaz_icu_la_LIBADD = libyaz.la $(ICU_LIBS)
AM_YFLAGS=-p cql_
}
if (freq.record == 0) /* no error and no record ? */
{
+ *pres = Z_PresentStatus_partial_4;
*next = 0; /* signal end-of-set and stop */
break;
}
test_file_glob
test_log_thread
test_mutex
+test_libstemmer
*.log
*.o
*~
test_comstack test_filepath test_record_conv test_retrieval test_tpath \
test_timing test_query_charset test_oid test_icu test_match_glob \
test_rpn2cql test_rpn2solr test_json test_xml_include test_file_glob \
- test_shared_ptr
+ test_shared_ptr test_libstemmer
check_SCRIPTS = tstmarc.sh tstmarccol.sh tstcql2xcql.sh tstcql2pqf.sh tsticu.sh
test_odrcodec.c test_odrcodec.h: tstodr.asn $(YAZCOMP)
cd $(srcdir); $(YAZCOMP) tstodr.asn
-LDADD = ../src/libyaz.la
+LDADD = ../src/libyaz.la
test_icu_LDADD = ../src/libyaz_icu.la ../src/libyaz.la $(ICU_LIBS)
+test_libstemmer_LDADD = ../src/libyaz_icu.la ../src/libyaz.la $(ICU_LIBS)
CONFIG_CLEAN_FILES=*.log
test_xml_include_SOURCES = test_xml_include.c
test_file_glob_SOURCES = test_file_glob.c
test_shared_ptr_SOURCES = test_shared_ptr.c
+test_libstemmer_SOURCES = test_libstemmer.c
--- /dev/null
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2011 Index Data
+ * See the file LICENSE for details.
+ */
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <yaz/test.h>
+
+#if YAZ_HAVE_ICU
+#include <yaz/stemmer.h>
+
+int test_stemmer_stem(yaz_stemmer_p stemmer, const char* to_stem, const char *expected)
+{
+ struct icu_buf_utf16 *src = icu_buf_utf16_create(0);
+ struct icu_buf_utf16 *dst = icu_buf_utf16_create(0);
+ struct icu_buf_utf8 *dst8 = icu_buf_utf8_create(0);
+
+ UErrorCode status;
+ const char *result;
+ icu_utf16_from_utf8_cstr(src, to_stem, &status);
+ yaz_stemmer_stem(stemmer, dst, src, &status);
+ /* Assume fail */
+ int rc = 0;
+ if (status == U_ZERO_ERROR) {
+ icu_utf16_to_utf8(dst8, dst, &status);
+ result = icu_buf_utf8_to_cstr(dst8);
+ rc = strcmp(result, expected) == 0;
+ }
+ icu_buf_utf8_destroy(dst8);
+ icu_buf_utf16_destroy(src);
+ icu_buf_utf16_destroy(dst);
+ return rc;
+}
+
+
+static void tst(void)
+{
+ UErrorCode status;
+ //== U_ZERO_ERROR;
+ yaz_stemmer_p stemmer = yaz_stemmer_create("en", "porter", &status);
+ YAZ_CHECK(stemmer);
+
+ /* fail */
+ YAZ_CHECK(test_stemmer_stem(stemmer, "beer", "water") == 0 );
+
+ /* Same */
+ YAZ_CHECK(test_stemmer_stem(stemmer, "adadwwr", "adadwwr"));
+
+ /* Remove S */
+ YAZ_CHECK(test_stemmer_stem(stemmer, "beers", "beer"));
+ YAZ_CHECK(test_stemmer_stem(stemmer, "persons", "person"));
+
+ /* Remove s and ing */
+ YAZ_CHECK(test_stemmer_stem(stemmer, "runs", "run"));
+ YAZ_CHECK(test_stemmer_stem(stemmer, "running", "run"));
+
+ yaz_stemmer_destroy(stemmer);
+}
+#endif
+
+int main (int argc, char **argv)
+{
+ YAZ_CHECK_INIT(argc, argv);
+#if YAZ_HAVE_ICU
+ tst();
+#endif
+ YAZ_CHECK_TERM;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+
SSL_LIBS="@SSL_LIBS@"
LIBS="@LIBS@"
VERSION=@VERSION@
+YAZVERSION=$VERSION
VERSION_SHA1=@VERSION_SHA1@
usage()
-Summary: Z39.50 Programs
+# This file is part of the YAZ toolkit
+# Copyright (C) 1995-2011 Index Data
+#
+# spec file for YAZ
+
Name: yaz
-Version: 4.1.2
-Release: 1
+Summary: Z39.50 Programs
+Version: 4.1.3
+Release: 1indexdata
+
+# determine system
+%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
+%define is_suse %(test -e /etc/SuSE-release >/dev/null && echo 1 || echo 0)
+%define is_suse11 %(grep 'VERSION = 11' /etc/SuSE-release >/dev/null 2>&1 && echo 1 || echo 0)
+%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
Requires: libxslt, gnutls, readline, libyaz4 = %{version}
License: BSD
Group: Applications/Internet
Source: yaz-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: %{_prefix}
-%define TCPWRAPPER tcpd-devel
-%if "%{_vendor}" == "redhat"
-# Fedora requires tcp_wrappers-devel .
+
%define TCPWRAPPER tcp_wrappers
+
+%if %is_fedora
+%define TCPWRAPPER tcp_wrappers-devel
%endif
-BuildRequires: pkgconfig, libxml2-devel, libxslt-devel, gnutls-devel, readline-devel, libicu-devel, %{TCPWRAPPER}
+
+%if %is_suse
+%define TCPWRAPPER tcpd-devel
+%endif
+
+BuildRequires: %{TCPWRAPPER}
+
+%if %is_suse11
+BuildRequires: libgnutls-devel
+%else
+BuildRequires: gnutls-devel
+%endif
+
+BuildRequires: pkgconfig
+BuildRequires: libxml2-devel
+BuildRequires: libxslt-devel
+BuildRequires: readline-devel
+BuildRequires: libicu-devel
Packager: Adam Dickmeiss <adam@indexdata.dk>
URL: http://www.indexdata.com/yaz