From ef36060e706b96e5e4a97528eaf5155fddddc918 Mon Sep 17 00:00:00 2001 From: lkx690 Date: Tue, 17 Dec 2019 10:50:34 +0800 Subject: [PATCH] modify spec file --- libstemmer.spec | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/libstemmer.spec b/libstemmer.spec index 8b13789..3bffc1f 100644 --- a/libstemmer.spec +++ b/libstemmer.spec @@ -1 +1,75 @@ +Name: libstemmer +Version: 0 +Release: 12 +Summary: C stemming algorithm library +URL: https://snowballstem.org/ +License: BSD +Source0: http://snowball.tartarus.org/dist/%{name}_c.tgz +Source1: Notice.txt +Source2: BSD.txt +BuildRequires: gcc + +%global _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. + +%description +%{_description} + + +%package devel +Summary: C stemming algorithm library developer files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains development files of libstemmer. + +%{_description} + + +%prep +%autosetup -p1 -n %{name}_c + +sed -i -r "s|(^%{name}.o:)|%{name}.so: \$\(snowball_sources:.c=.o\)\n\ +\t\$\(CC\) \$\(CFLAGS\) -shared \$\(LDFLAGS\) -Wl,-soname,%{name}.so.0 \ +-o \$\@.0.0.0 \$\^\n\1|" Makefile + +%build +%make_build CFLAGS="%{optflags} -fPIC -Iinclude" LDFLAGS="$RPM_LD_FLAGS" %{name}.so + +%install +install -pDm 755 %{name}.so.0.0.0 %{buildroot}%{_libdir}/%{name}.so.0.0.0 +ln -s %{name}.so.0.0.0 %{buildroot}%{_libdir}/%{name}.so.0 +ln -s %{name}.so.0.0.0 %{buildroot}%{_libdir}/%{name}.so +install -d -m 755 %{buildroot}%{_includedir} +install -pDm 644 include/* %{buildroot}%{_includedir}/ + +cp %{SOURCE1} %{SOURCE2} . + +%ldconfig_scriptlets + +%files +%license Notice.txt BSD.txt +%doc README +%{_libdir}/%{name}.so.* + +%files devel +%{_libdir}/%{name}.so +%{_includedir}/* + +%changelog +* Tue Dec 3 2019 mengxian - 0-12 +- Package init