diff --git a/sphinx-c99.patch b/sphinx-c99.patch deleted file mode 100644 index ffc7fb7..0000000 --- a/sphinx-c99.patch +++ /dev/null @@ -1,99 +0,0 @@ -Add missing return types to avoid build failures with C99 compilers. -Include to avoid implicit function declarations. -Avoid incompatible pointer types and a format string warning. - -Partially fixed via: - -commit da41e452c5acc99ffe40f48be32d9ca7e55c407c -Author: tomat -Date: Wed Jun 2 05:16:06 2010 +0000 - - fixed query buffer overrun and SIGPIPE in C API, mantis bug 489 \ 504 - - git-svn-id: svn://svn.sphinxsearch.com/sphinx/trunk@2316 406a0c4d-033a-0410- -8de8-e80135713968 - -Rest submitted upstream: - -diff --git a/api/libsphinxclient/sphinxclient.c b/api/libsphinxclient/sphinxclient.c -index 16f7913fa37b3bf3..0530fc2c65f1082c 100644 ---- a/api/libsphinxclient/sphinxclient.c -+++ b/api/libsphinxclient/sphinxclient.c -@@ -311,7 +311,7 @@ static void sphinx_free_results ( sphinx_client * client ) - } - - --static sock_close ( int sock ); -+static void sock_close ( int sock ); - - - #define safe_free(_ptr) \ -@@ -1436,7 +1436,7 @@ static int sock_set_blocking ( int sock ) - } - - --static sock_close ( int sock ) -+static void sock_close ( int sock ) - { - if ( sock<0 ) - return; -diff --git a/api/libsphinxclient/test.c b/api/libsphinxclient/test.c -index f779bb1ff638a179..670e379b4ad3c36f 100644 ---- a/api/libsphinxclient/test.c -+++ b/api/libsphinxclient/test.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #if _WIN32 - #include -@@ -218,7 +219,8 @@ void test_excerpt_spz ( sphinx_client * client ) - - void test_persist_work ( sphinx_client * client ) - { -- char * docs[] = { NULL }; -+ const char * docs[] = { NULL }; -+ char *docs0; - const char words[] = "that is"; - const char * index = "test1"; - const char filler[] = " no need to worry about "; -@@ -229,13 +231,14 @@ void test_persist_work ( sphinx_client * client ) - - // should be in sync with sphinxclient.c MAX_PACKET_LEN - i = 8*1024*1024 + 50; -- docs[0] = malloc ( i ); -- if ( !docs[0] ) -+ docs0 = malloc ( i ); -+ if ( !docs0 ) - die ( "malloc failed at test_persist_work" ); -+ docs[0] = docs0; - -- memcpy ( docs[0], words, sizeof(words)-1 ); -- doc = docs[0] + sizeof(words)-1; -- while ( ( doc + sizeof(filler) ) % s <-\n\n", name ); -+ printf ( "-> %s <-\n\n", name ); - } - - int main ( int argc, char ** argv ) diff --git a/sphinx-configure-c99.patch b/sphinx-configure-c99.patch deleted file mode 100644 index 2f7e65a..0000000 --- a/sphinx-configure-c99.patch +++ /dev/null @@ -1,148 +0,0 @@ -Generic C99 compatibility fixes for the configure script. These -changes are already part of autoconf upstream, so re-running -autoconf would fix these issues, too. - -diff --git a/api/libsphinxclient/configure b/api/libsphinxclient/configure -index ff655ed23b938e71..c502ef318fd28313 100755 ---- a/api/libsphinxclient/configure -+++ b/api/libsphinxclient/configure -@@ -2761,7 +2761,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ -- '' \ -+ '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ -@@ -4190,8 +4190,8 @@ main () - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) -- exit(2); -- exit (0); -+ return 2; -+ return 0; - } - _ACEOF - rm -f conftest$ac_exeext -@@ -8112,10 +8112,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -8129,7 +8125,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -8210,10 +8206,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -8227,7 +8219,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -11831,10 +11823,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -11848,7 +11836,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -11929,10 +11917,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -11946,7 +11930,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -17369,10 +17353,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -17386,7 +17366,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -17467,10 +17447,6 @@ else - # endif - #endif - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- - void fnord() { int i=42;} - int main () - { -@@ -17484,7 +17460,7 @@ int main () - /* dlclose (self); */ - } - -- exit (status); -+ return status; - } - EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 diff --git a/sphinx.spec b/sphinx.spec index c9dd0d7..4a6751a 100644 --- a/sphinx.spec +++ b/sphinx.spec @@ -11,27 +11,17 @@ %endif %endif -%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10 -%bcond_with java -%else -%bcond_without java -%endif - - Name: sphinx Version: 2.2.11 -Release: 34%{?dist} +Release: 20%{?dist} Summary: Free open-source SQL full-text search engine -# Automatically converted from old format: GPLv2+ - review is highly recommended. -License: GPL-2.0-or-later +License: GPLv2+ URL: http://sphinxsearch.com Source0: http://sphinxsearch.com/files/%{name}-%{version}-release.tar.gz Source1: searchd.service Patch0: %{name}-2.0.3-fix_static.patch Patch1: listen_local.patch -Patch2: sphinx-configure-c99.patch -Patch3: sphinx-c99.patch BuildRequires: make BuildRequires: gcc gcc-c++ @@ -45,6 +35,7 @@ Requires(preun): systemd Requires(postun): systemd # Users and groups +Requires(pre): shadow-utils %description @@ -66,8 +57,7 @@ available as a plug-gable MySQL storage engine. API is very lightweight so porting it to new language is known to take a few hours. As for the name, Sphinx is an acronym which is officially decoded as SQL -Phrase Index. -For the Sphinx documentation generator, see python-sphinx instead. +Phrase Index. Yes, I know about CMU's Sphinx project. %package -n libsphinxclient @@ -89,7 +79,6 @@ Pure C search-d client API library Sphinx search engine, http://sphinxsearch.com/ -%if %{with java} %package java Summary: Java API for Sphinx BuildRequires: java-devel @@ -101,7 +90,7 @@ Requires: jpackage-utils This package provides the Java API for Sphinx, the free, open-source full-text search engine, designed with indexing database content in mind. -%endif + %package php Summary: PHP API for Sphinx @@ -116,10 +105,8 @@ designed with indexing database content in mind. %prep %setup -qn %{name}-%{version}-release -%patch -P0 -p1 -b .fix_static -%patch -P1 -p1 -b .default_listen -%patch -P2 -p1 -%patch -P3 -p1 +%patch0 -p1 -b .fix_static +%patch1 -p1 -b .default_listen # Fix wrong-file-end-of-line-encoding for f in \ @@ -134,12 +121,6 @@ done # Fix file not UTF8 iconv -f iso8859-1 -t utf-8 doc/%{name}.txt > doc/%{name}.txt.conv && mv -f doc/%{name}.txt.conv doc/%{name}.txt -# Create a sysusers.d config file -cat >sphinx.sysusers.conf </dev/null || groupadd -r %{sphinx_group} +getent passwd %{sphinx_user} >/dev/null || \ +useradd -r -g %{sphinx_group} -d %{sphinx_home} -s /bin/bash \ +-c "Sphinx Search" %{sphinx_user} +exit 0 %post %systemd_post searchd.service @@ -283,70 +264,24 @@ chown -R %{sphinx_user}:root %{_localstatedir}/lib/%{name}/ %dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/run/%{name} %dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/lib/%{name} %{_mandir}/man1/* -%{_sysusersdir}/sphinx.conf %files -n libsphinxclient -%doc COPYING %{?with_java: api/java} api/ruby api/*.php api/*.py api/libsphinxclient/README +%doc COPYING api/java api/ruby api/*.php api/*.py api/libsphinxclient/README %{_libdir}/libsphinxclient-0*.so %files -n libsphinxclient-devel %{_libdir}/libsphinxclient.so %{_includedir}/* -%if %{with java} %files java %doc api/java/README COPYING %{_javadir}/* -%endif %files php %doc COPYING %{_datadir}/php/* %changelog -* Fri Jul 25 2025 Fedora Release Engineering - 2.2.11-34 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 2.2.11-33 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Sun Jan 19 2025 Fedora Release Engineering - 2.2.11-32 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jul 26 2024 Miroslav Suchý - 2.2.11-31 -- convert license to SPDX - -* Sat Jul 20 2024 Fedora Release Engineering - 2.2.11-30 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 2.2.11-29 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Tue Dec 19 2023 Florian Weimer - 2.2.11-28 -- Additional C compatibility fixes - -* Sat Jul 22 2023 Fedora Release Engineering - 2.2.11-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 2.2.11-26 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Tue Jan 10 2023 Florian Weimer - 2.2.11-25 -- C99 compatibility fixes - -* Tue Aug 16 2022 Michal Schorm - 2.2.11-24 -- Remove the Java binding - Resolves: #2104104, #2113735 - -* Sat Jul 23 2022 Fedora Release Engineering - 2.2.11-23 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Feb 05 2022 Jiri Vanek - 2.2.11-22 -- Rebuilt for java-17-openjdk as system jdk - -* Sat Jan 22 2022 Fedora Release Engineering - 2.2.11-21 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - * Fri Jul 23 2021 Fedora Release Engineering - 2.2.11-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild