Sync from SUSE:SLFO:Main snowball revision 4ed3f7d75200cfcc1fd07e99c56b4035

This commit is contained in:
Adrian Schröter 2024-05-04 00:43:27 +02:00
commit 60437aada4
8 changed files with 340 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

20
build-options.diff Normal file
View File

@ -0,0 +1,20 @@
Description: Honor build flags passed as command line arguments
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: not-needed
Last-Update: 2019-10-17
Index: snowball-2.2.0/GNUmakefile
===================================================================
--- snowball-2.2.0.orig/GNUmakefile
+++ snowball-2.2.0/GNUmakefile
@@ -170,8 +170,8 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.
JAVA_CLASSES = $(JAVA_SOURCES:.java=.class)
JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class)
-CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
-CPPFLAGS=
+override_CFLAGS += -O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
+ovveride_CPPFLAGS +=
INCLUDES=-Iinclude

6
libstemmer.ver Normal file
View File

@ -0,0 +1,6 @@
{
global:
sb_*;
local:
*;
};

20
python-dist.diff Normal file
View File

@ -0,0 +1,20 @@
Description: preserve the Python source directory instead of deleting it
Author: Dmitry Shachnev <mitya57@debian.org>
Forwarded: not-needed
Last-Update: 2020-07-18
Index: snowball-2.1.0/GNUmakefile
===================================================================
--- snowball-2.1.0.orig/GNUmakefile
+++ snowball-2.1.0/GNUmakefile
@@ -464,9 +464,7 @@ dist_libstemmer_python: $(PYTHON_SOURCES
cp -a $(PYTHON_SOURCES) $${dest}/src/$(python_runtime_dir) && \
cp -a $(PYTHON_SAMPLE_SOURCES) $${dest}/src/$(python_sample_dir) && \
cp -a $(PYTHON_RUNTIME_SOURCES) $${dest}/src/$(python_runtime_dir) && \
- cp -a $(COMMON_FILES) $(PYTHON_PACKAGE_FILES) $${dest} && \
- (cd $${dest} && $(python) setup.py sdist bdist_wheel && cp dist/*.tar.gz dist/*.whl ..) && \
- rm -rf $${dest}
+ cp -a $(COMMON_FILES) $(PYTHON_PACKAGE_FILES) $${dest}
dist_libstemmer_js: $(JS_SOURCES)
destname=jsstemmer-$(SNOWBALL_VERSION); \

122
shared-library.diff Normal file
View File

@ -0,0 +1,122 @@
Description: Build libstemmer as a shared library.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: http://news.gmane.org/find-root.php?message_id=%3c20110821220427.GC1738%40bach.rivera.co.za%3e
Last-Update: 2019-10-17
Index: snowball-2.2.0/GNUmakefile
===================================================================
--- snowball-2.2.0.orig/GNUmakefile
+++ snowball-2.2.0/GNUmakefile
@@ -175,7 +175,7 @@ ovveride_CPPFLAGS +=
INCLUDES=-Iinclude
-all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
+all: snowball$(EXEEXT) libstemmer.so stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt
libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt
@@ -183,7 +183,7 @@ algorithms.mk: libstemmer/mkalgorithms.p
clean:
rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \
$(LIBSTEMMER_OBJECTS) $(LIBSTEMMER_UTF8_OBJECTS) $(STEMWORDS_OBJECTS) snowball$(EXEEXT) \
- libstemmer.a stemwords$(EXEEXT) \
+ $(wildcard libstemmer.so*) libstemmer.a stemwords$(EXEEXT) \
libstemmer/modules.h \
libstemmer/modules_utf8.h \
$(C_LIB_SOURCES) $(C_LIB_HEADERS) $(C_LIB_OBJECTS) \
@@ -198,7 +198,7 @@ clean:
libstemmer/mkinc.mak libstemmer/mkinc_utf8.mak \
libstemmer/libstemmer.c libstemmer/libstemmer_utf8.c \
algorithms.mk
- rm -rf dist
+ rm -rf dist .shared
-rmdir $(c_src_dir)
-rmdir $(python_output_dir)
-rmdir $(js_output_dir)
@@ -222,14 +222,19 @@ libstemmer/modules_utf8.h libstemmer/mki
libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS)
-libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
- $(AR) -cru $@ $^
+libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
+ $(CC) -shared $(LDFLAGS) \
+ -Wl,--version-script=${RPM_SOURCE_DIR}/libstemmer.ver,-soname,libstemmer.so.1d \
+ -o $@.1d.0.0 ${^:%=.shared/%}
+ ln -s $@.1d.0.0 $@.1d
+ ln -s $@.1d.0.0 $@
+ $(AR) -crs ${@:.so=.a} $^
examples/%.o: examples/%.c
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
-stemwords$(EXEEXT): $(STEMWORDS_OBJECTS) libstemmer.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+stemwords$(EXEEXT): $(STEMWORDS_OBJECTS) libstemmer.so
+ $(CC) $(CFLAGS) $(LDFLAGS) -g -o $@ $(STEMWORDS_OBJECTS) -L. -lstemmer
tests/%.o: tests/%.c
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
@@ -275,7 +280,6 @@ $(c_src_dir)/stem_ISO_8859_2_%.c $(c_src
./snowball charsets/ISO-8859-2.sbl $< -o $${o} -eprefix $${l}_ISO_8859_2_ -r ../runtime
$(c_src_dir)/stem_%.o: $(c_src_dir)/stem_%.c $(c_src_dir)/stem_%.h
- $(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
$(java_src_dir)/%Stemmer.java: algorithms/%.sbl snowball$(EXEEXT)
@mkdir -p $(java_src_dir)
@@ -520,13 +524,14 @@ check_koi8r: $(KOI8_R_algorithms:%=check
# a sibling to this one.
STEMMING_DATA ?= ../snowball-data
STEMMING_DATA_ABS := $(abspath $(STEMMING_DATA))
+STEMWORDS=LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./stemwords$(EXEEXT)
check_utf8_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
@echo "Checking output of `echo $<|sed 's!.*/!!'` stemmer with UTF-8"
@if test -f '$</voc.txt.gz' ; then \
- gzip -dc '$</voc.txt.gz'|./stemwords$(EXEEXT) -c UTF_8 -l `echo $<|sed 's!.*/!!'` -o tmp.txt; \
+ gzip -dc '$</voc.txt.gz'|$(STEMWORDS) -c UTF_8 -l `echo $<|sed 's!.*/!!'` -o tmp.txt; \
else \
- ./stemwords$(EXEEXT) -c UTF_8 -l `echo $<|sed 's!.*/!!'` -i $</voc.txt -o tmp.txt; \
+ $(STEMWORD) -c UTF_8 -l `echo $<|sed 's!.*/!!'` -i $</voc.txt -o tmp.txt; \
fi
@if test -f '$</output.txt.gz' ; then \
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
@@ -538,7 +543,7 @@ check_utf8_%: $(STEMMING_DATA)/% stemwor
check_iso_8859_1_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
@echo "Checking output of `echo $<|sed 's!.*/!!'` stemmer with ISO_8859_1"
@$(ICONV) -f UTF-8 -t ISO-8859-1 '$</voc.txt' |\
- ./stemwords -c ISO_8859_1 -l `echo $<|sed 's!.*/!!'` -o tmp.txt
+ $(STEMWORDS) -c ISO_8859_1 -l `echo $<|sed 's!.*/!!'` -o tmp.txt
@$(ICONV) -f UTF-8 -t ISO-8859-1 '$</output.txt' |\
$(DIFF) -u - tmp.txt
@rm tmp.txt
@@ -546,7 +551,7 @@ check_iso_8859_1_%: $(STEMMING_DATA)/% s
check_iso_8859_2_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
@echo "Checking output of `echo $<|sed 's!.*/!!'` stemmer with ISO_8859_2"
@$(ICONV) -f UTF-8 -t ISO-8859-2 '$</voc.txt' |\
- ./stemwords -c ISO_8859_2 -l `echo $<|sed 's!.*/!!'` -o tmp.txt
+ $(STEMWORDS) -c ISO_8859_2 -l `echo $<|sed 's!.*/!!'` -o tmp.txt
@$(ICONV) -f UTF-8 -t ISO-8859-2 '$</output.txt' |\
$(DIFF) -u - tmp.txt
@rm tmp.txt
@@ -554,7 +559,7 @@ check_iso_8859_2_%: $(STEMMING_DATA)/% s
check_koi8r_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
@echo "Checking output of `echo $<|sed 's!.*/!!'` stemmer with KOI8R"
@$(ICONV) -f UTF-8 -t KOI8-R '$</voc.txt' |\
- ./stemwords -c KOI8_R -l `echo $<|sed 's!.*/!!'` -o tmp.txt
+ $(STEMWORDS) -c KOI8_R -l `echo $<|sed 's!.*/!!'` -o tmp.txt
@$(ICONV) -f UTF-8 -t KOI8-R '$</output.txt' |\
$(DIFF) -u - tmp.txt
@rm tmp.txt
@@ -739,4 +744,9 @@ ada/bin/generate:
ada/bin/stemwords: $(ADA_SOURCES)
cd ada && $(gprbuild) -Pstemwords -p
+%.o: %.c
+ @mkdir -p $(shell dirname ${@:%=.shared/%})
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -fPIC -o ${@:%=.shared/%} $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
.SUFFIXES: .class .java

BIN
snowball-2.2.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

23
snowball.changes Normal file
View File

@ -0,0 +1,23 @@
-------------------------------------------------------------------
Tue Oct 10 08:53:44 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Update to version 2.2.0:
+ New code generator: Ada generator.
+ Javascript: Fix generated code to use integer division rather
than floating point division.
+ Python:
- Python 2 is no longer actively supported.
- Fix code generated for division. Previously the Python code
we generated used integer division but rounded negative
fractions towards negative infinity rather than zero under
Python 2, and under Python 3 used floating point division.
+ For more information, see shipped NEWS file.
- Rebase build-options.diff and shared-library.diff.
- Bump libstemmer.so.0d to libstemmer.so.1d: we have no guarantee
that upstreams static-only-library maintains any kind of ABI.
-------------------------------------------------------------------
Tue May 11 13:32:34 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
- Initial package, version 2.1.0, based on work by darix and dabian

123
snowball.spec Normal file
View File

@ -0,0 +1,123 @@
#
# spec file for package snowball
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define library_name libstemmer1d
Name: snowball
Version: 2.2.0
Release: 0
Summary: Snowball compiler and stemming algorithms
License: BSD-3-Clause
URL: https://snowballstem.org
Source: https://github.com/snowballstem/snowball/archive/v%{version}.tar.gz#/snowball-%{version}.tar.gz
Source1: libstemmer.ver
Patch0: build-options.diff
Patch1: shared-library.diff
Patch2: python-dist.diff
Provides: libstemmer-tools = %{version}-%{release}
%description
Snowball is a small string processing language for creating stemming algorithms
for use in Information Retrieval, plus a collection of stemming algorithms
implemented using it.
Snowball was originally designed and built by Martin Porter. Martin retired
from development in 2014 and Snowball is now maintained as a community project.
Martin originally chose the name Snowball as a tribute to SNOBOL, the excellent
string handling language from the 1960s. It now also serves as a metaphor for
how the project grows by gathering contributions over time.
The Snowball compiler translates a Snowball program into source code in another
language - currently ISO C, C#, Go, Java, Javascript, Object Pascal, Python and
Rust are supported.
%package -n %{library_name}
Summary: Shared library for libstemmer
%description -n %{library_name}
Snowball is a small string processing language for creating stemming algorithms
for use in Information Retrieval, plus a collection of stemming algorithms
implemented using it.
Snowball was originally designed and built by Martin Porter. Martin retired
from development in 2014 and Snowball is now maintained as a community project.
Martin originally chose the name Snowball as a tribute to SNOBOL, the excellent
string handling language from the 1960s. It now also serves as a metaphor for
how the project grows by gathering contributions over time.
The Snowball compiler translates a Snowball program into source code in another
language - currently ISO C, C#, Go, Java, Javascript, Object Pascal, Python and
Rust are supported.
This package holds the shared library for libstemmer.
%package devel
Summary: Development files libstemmer
Requires: %{library_name} = %{version}
Provides: libstemmer-devel = %{version}-%{release}
%description devel
Snowball is a small string processing language for creating stemming algorithms
for use in Information Retrieval, plus a collection of stemming algorithms
implemented using it.
Snowball was originally designed and built by Martin Porter. Martin retired
from development in 2014 and Snowball is now maintained as a community project.
Martin originally chose the name Snowball as a tribute to SNOBOL, the excellent
string handling language from the 1960s. It now also serves as a metaphor for
how the project grows by gathering contributions over time.
The Snowball compiler translates a Snowball program into source code in another
language - currently ISO C, C#, Go, Java, Javascript, Object Pascal, Python and
Rust are supported.
This package holds the development files for libstemmer.
%prep
%autosetup -p1
%build
%make_build CFLAGS="%{optflags}"
%install
install -D -m 0755 -d %{buildroot}%{_libdir}
cp -a libstemmer.so* %{buildroot}%{_libdir}
install -D -m 0644 include/libstemmer.h %{buildroot}%{_includedir}/libstemmer.h
install -D -m 0755 stemwords %{buildroot}%{_bindir}/stemwords
%post -n %{library_name} -p /sbin/ldconfig
%postun -n %{library_name} -p /sbin/ldconfig
%files
%license COPYING
%doc AUTHORS CONTRIBUTING.rst NEWS
%doc doc/libstemmer_c_README
%{_bindir}/stemwords
%files -n %{library_name}
%license COPYING
%{_libdir}/libstemmer.so.*
%files devel
%license COPYING
%doc AUTHORS CONTRIBUTING.rst NEWS
%doc doc/libstemmer_c_README
%{_includedir}/libstemmer.h
%{_libdir}/libstemmer.so
%changelog