From: Dennis Schafroth Date: Fri, 18 Feb 2011 12:48:18 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz X-Git-Tag: v4.1.4~5 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=17fe7bc7f9aba476c245d128e17f551f83dd5fdd;hp=095bd74d0cc1cfd3bd4123da0a5fbeafbd1462ce Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz --- diff --git a/NEWS b/NEWS index 86e4e39..ff42413 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,20 @@ +--- 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. diff --git a/configure.ac b/configure.ac index 02c118f..d6cd276 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ 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]) diff --git a/debian/changelog b/debian/changelog index 7bc857c..b3d30a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yaz (4.1.3-1indexdata) unstable; urgency=low + + * Upstream. + + -- Adam Dickmeiss Thu, 27 Jan 2011 13:56:54 +0100 + yaz (4.1.2-1indexdata) unstable; urgency=low * Upstream. diff --git a/doc/entities.ent b/doc/entities.ent index c5afda8..5f310e9 100644 --- a/doc/entities.ent +++ b/doc/entities.ent @@ -26,4 +26,4 @@ "> "> - + diff --git a/src/Makefile.am b/src/Makefile.am index 365e2f0..5aeb22c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,7 @@ YAZCOMP_I = $(YAZCOMP) -d $(srcdir)/ill.tcl -i yaz -I$(top_srcdir)/include 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_ diff --git a/src/seshigh.c b/src/seshigh.c index 5d2df23..e739d3a 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2505,6 +2505,7 @@ static Z_Records *pack_records(association *a, char *setname, Odr_int start, } if (freq.record == 0) /* no error and no record ? */ { + *pres = Z_PresentStatus_partial_4; *next = 0; /* signal end-of-set and stop */ break; } diff --git a/test/.gitignore b/test/.gitignore index 90d4151..cc7ce27 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -34,6 +34,7 @@ test_oid test_file_glob test_log_thread test_mutex +test_libstemmer *.log *.o *~ diff --git a/test/Makefile.am b/test/Makefile.am index 1974a30..5e92f72 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -7,7 +7,7 @@ check_PROGRAMS = test_xmalloc test_iconv test_nmem test_matchstr test_wrbuf \ 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 @@ -48,8 +48,9 @@ dist-hook: 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 @@ -84,3 +85,4 @@ test_json_SOURCES = test_json.c 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 diff --git a/test/test_libstemmer.c b/test/test_libstemmer.c new file mode 100644 index 0000000..a2ea678 --- /dev/null +++ b/test/test_libstemmer.c @@ -0,0 +1,83 @@ +/* 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 +#include + +#include + +#if YAZ_HAVE_ICU +#include + +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 + */ + diff --git a/yaz-config.in b/yaz-config.in index 0fc5208..9553d94 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -19,6 +19,7 @@ ICU_CPPFLAGS="@ICU_CPPFLAGS@" SSL_LIBS="@SSL_LIBS@" LIBS="@LIBS@" VERSION=@VERSION@ +YAZVERSION=$VERSION VERSION_SHA1=@VERSION_SHA1@ usage() diff --git a/yaz.spec b/yaz.spec index a5205c4..e0c1052 100644 --- a/yaz.spec +++ b/yaz.spec @@ -1,7 +1,18 @@ -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 @@ -9,12 +20,30 @@ Vendor: Index Data ApS 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 URL: http://www.indexdata.com/yaz