diff --git a/1000-add-rules-to-make-libstemmer.so.patch b/1000-add-rules-to-make-libstemmer.so.patch new file mode 100644 index 0000000000000000000000000000000000000000..7d26e760b5fd3d9afbe85f312f77b673ea6efe31 --- /dev/null +++ b/1000-add-rules-to-make-libstemmer.so.patch @@ -0,0 +1,34 @@ +From a798502de7030ac22b5ccf41777ac6d1bd68e5ad Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Tue, 19 Apr 2022 11:18:48 +0800 +Subject: [PATCH] add rules to make libstemmer.so + +Signed-off-by: Chunmei Xu +--- + Makefile | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 1bfd99a..ea3c11c 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,10 +4,12 @@ EXEEXT=.exe + endif + CFLAGS=-O2 + CPPFLAGS=-Iinclude +-all: libstemmer.a stemwords$(EXEEXT) +-libstemmer.a: $(snowball_sources:.c=.o) ++all: libstemmer.o stemwords ++libstemmer.so: $(snowball_sources:.c=.o) ++ $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,libstemmer.so.0 -o $@.0.0.0 $^ ++libstemmer.o: $(snowball_sources:.c=.o) + $(AR) -cru $@ $^ +-stemwords$(EXEEXT): examples/stemwords.o libstemmer.a ++stemwords$(EXEEXT): examples/stemwords.o libstemmer.o + $(CC) $(CFLAGS) -o $@ $^ + clean: +- rm -f stemwords$(EXEEXT) libstemmer.a *.o src_c/*.o examples/*.o runtime/*.o libstemmer/*.o ++ rm -f stemwords$(EXEEXT) libstemmer.o *.o src_c/*.o examples/*.o runtime/*.o libstemmer/*.o +-- +2.34.1 + diff --git a/BSD.txt b/BSD.txt new file mode 100644 index 0000000000000000000000000000000000000000..febb7e3aa2a925b36147786f17c542b25c0236c1 --- /dev/null +++ b/BSD.txt @@ -0,0 +1,11 @@ +Copyright (c) 2001, Dr Martin Porter, and (for the Java developments) +Copyright (c) 2002, Richard Boulton +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. diff --git a/Notice.txt b/Notice.txt new file mode 100644 index 0000000000000000000000000000000000000000..b63ba9f2bf409e84a93a6b0f810168193e1bd0ec --- /dev/null +++ b/Notice.txt @@ -0,0 +1,19 @@ +Except where explicitly noted, all the software given out on this Snowball site is covered by the 3-clause BSD License: + +Copyright (c) 2001, Dr Martin Porter, +Copyright (c) 2002, Richard Boulton. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +Essentially, all this means is that you can do what you like with the code, except claim another Copyright for it, or claim that it is issued under a different license. The software is also issued without warranties, which means that if anyone suffers through its use, they cannot come back and sue you. You also have to alert anyone to whom you give the Snowball software to the fact that it is covered by the BSD license. + + +(from: https://snowballstem.org/license.html) diff --git a/libstemmer.spec b/libstemmer.spec new file mode 100644 index 0000000000000000000000000000000000000000..268152d56986349d2677278b16706a17a1262448 --- /dev/null +++ b/libstemmer.spec @@ -0,0 +1,85 @@ +%define anolis_release 1 +Name: libstemmer +Version: 2.2.0 +Release: %{anolis_release}%{?dist} +Summary: C stemming algorithm library +URL: https://snowballstem.org/ +# https://snowballstem.org/license.html +License: BSD +Source0: https://snowballstem.org/dist/libstemmer_c-%{version}.tar.gz +Source1: Notice.txt +Source2: BSD.txt +Patch1000: 1000-add-rules-to-make-libstemmer.so.patch + +BuildRequires: gcc +BuildRequires: make + +%description +Snowball stemming algorithms for use in Information Retrieval Snowball +provides access to efficient algorithms for calculating a "stemmed" +form of a word. This is a form with most of the common morphological +endings removed; hopefully representing a common linguistic base form. +This is most useful in building search engines and information +retrieval software; for example, a search with stemming enabled should +be able to find a document containing "cycling" given the query +"cycles". + +Snowball provides algorithms for several (mainly European) languages. +It also provides access to the classic Porter stemming algorithm for +English: although this has been superseded by an improved algorithm, +the original algorithm may be of interest to information retrieval +researchers wishing to reproduce results of earlier experiments. + + +%package devel +Summary: C stemming algorithm library developer files +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files of libstemmer. + +Snowball stemming algorithms for use in Information Retrieval Snowball +provides access to efficient algorithms for calculating a "stemmed" +form of a word. This is a form with most of the common morphological +endings removed; hopefully representing a common linguistic base form. +This is most useful in building search engines and information +retrieval software; for example, a search with stemming enabled should +be able to find a document containing "cycling" given the query +"cycles". + +Snowball provides algorithms for several (mainly European) languages. +It also provides access to the classic Porter stemming algorithm for +English: although this has been superseded by an improved algorithm, +the original algorithm may be of interest to information retrieval +researchers wishing to reproduce results of earlier experiments. + + +%prep +%autosetup -p1 -n %{name}_c-%{version} + +%build +make libstemmer.so %{?_smp_mflags} CFLAGS="%{optflags} -fPIC -Iinclude" LDFLAGS="$RPM_LD_FLAGS" + +%install +mkdir -p %{buildroot}%{_libdir} +mkdir -p %{buildroot}%{_includedir} +install -p -D -m 755 libstemmer.so.0.0.0 %{buildroot}%{_libdir}/ +ln -s libstemmer.so.0.0.0 %{buildroot}%{_libdir}/libstemmer.so.0 +ln -s libstemmer.so.0.0.0 %{buildroot}%{_libdir}/libstemmer.so +install -p -D -m 644 include/* %{buildroot}%{_includedir}/ + +cp %{SOURCE1} %{SOURCE2} . + +%ldconfig_scriptlets + +%files +%doc Notice.txt BSD.txt README +%{_libdir}/libstemmer.so.* + +%files devel +%{_libdir}/libstemmer.so +%{_includedir}/* + +%changelog +* Tue Apr 19 2022 Chunmei Xu - 2.2.0-1 +- init from upstream diff --git a/libstemmer_c-2.2.0.tar.gz b/libstemmer_c-2.2.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a2c7ba29d71155426fca6548ef243fc5f5de4259 Binary files /dev/null and b/libstemmer_c-2.2.0.tar.gz differ