diff --git a/listen_local.patch b/listen_local.patch deleted file mode 100644 index 46a1342..0000000 --- a/listen_local.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- sphinx-2.2.11-release-orig/sphinx.conf.in 2019-09-05 08:57:23.608395395 -0400 -+++ sphinx-2.2.11-release/sphinx.conf.in 2019-09-05 08:56:43.568117907 -0400 -@@ -810,8 +810,8 @@ - # listen = 192.168.0.1:9312 - # listen = 9312 - # listen = /var/run/searchd.sock -- listen = 9312 -- listen = 9306:mysql41 -+ listen = 127.0.0.1:9312 -+ listen = 127.0.0.1:9306:mysql41 - - # log file, searchd run info is logged here - # optional, default is 'searchd.log' ---- sphinx-2.2.11-release-orig/sphinx-min.conf.in 2019-09-05 08:59:14.851388059 -0400 -+++ sphinx-2.2.11-release/sphinx-min.conf.in 2019-09-05 08:59:44.248857589 -0400 -@@ -49,8 +49,8 @@ - - searchd - { -- listen = 9312 -- listen = 9306:mysql41 -+ listen = 127.0.0.1:9312 -+ listen = 127.0.0.1:9306:mysql41 - log = @CONFDIR@/log/searchd.log - query_log = @CONFDIR@/log/query.log - read_timeout = 5 diff --git a/sphinx-2.0.3-default_listen.patch b/sphinx-2.0.3-default_listen.patch new file mode 100644 index 0000000..07b602d --- /dev/null +++ b/sphinx-2.0.3-default_listen.patch @@ -0,0 +1,24 @@ +diff -r -U3 sphinx-2.0.3-release.orig/sphinx.conf.in sphinx-2.0.3-release/sphinx.conf.in +--- sphinx-2.0.3-release.orig/sphinx.conf.in 2011-04-18 09:39:40.000000000 -0500 ++++ sphinx-2.0.3-release/sphinx.conf.in 2012-02-14 13:49:19.660872549 -0600 +@@ -716,7 +716,7 @@ + # listen = 192.168.0.1:9312 + # listen = 9312 + # listen = /var/run/searchd.sock +- listen = 9312 ++ listen = 127.0.0.1:9312 + listen = 9306:mysql41 + + # log file, searchd run info is logged here +diff -r -U3 sphinx-2.0.3-release.orig/sphinx-min.conf.in sphinx-2.0.3-release/sphinx-min.conf.in +--- sphinx-2.0.3-release.orig/sphinx-min.conf.in 2011-04-18 09:39:40.000000000 -0500 ++++ sphinx-2.0.3-release/sphinx-min.conf.in 2012-02-14 13:49:55.682449012 -0600 +@@ -54,7 +54,7 @@ + + searchd + { +- listen = 9312 ++ listen = 127.0.0.1:9312 + listen = 9306:mysql41 + log = @CONFDIR@/log/searchd.log + query_log = @CONFDIR@/log/query.log 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..4ed4568 100644 --- a/sphinx.spec +++ b/sphinx.spec @@ -1,6 +1,6 @@ %global sphinx_user sphinx %global sphinx_group sphinx -%global sphinx_home %{_localstatedir}/lib/sphinx +%global sphinx_home %{_tmpfilesdir}/lib/sphinx # rpmbuild < 4.6 support %if ! 0%{?__isa_bits} @@ -11,33 +11,21 @@ %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: 5%{?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 +Patch1: %{name}-2.0.3-default_listen.patch -BuildRequires: make -BuildRequires: gcc gcc-c++ BuildRequires: expat-devel -BuildRequires: mariadb-connector-c-devel openssl-devel -BuildRequires: libpq-devel +BuildRequires: mysql-devel +BuildRequires: postgresql-devel BuildRequires: systemd Requires(post): systemd @@ -45,6 +33,7 @@ Requires(preun): systemd Requires(postun): systemd # Users and groups +Requires(pre): shadow-utils %description @@ -66,8 +55,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 +77,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 +88,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 +103,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 +119,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 < $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} << EOF -%{_localstatedir}/log/%{name}/*.log { +%{_tmpfilesdir}/log/%{name}/*.log { weekly rotate 10 copytruncate @@ -218,13 +195,11 @@ pushd api/libsphinxclient/ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p -c" popd -%if %{with java} # install the java api mkdir -p $RPM_BUILD_ROOT%{_javadir} install -m 0644 api/java/%{name}api.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}.jar ln -s %{_javadir}/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}api.jar -%endif # install the php api # "Non-PEAR PHP extensions should put their Class files in /usr/share/php." @@ -238,9 +213,13 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' # clean-up .a archives find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';' -install -m0644 -D sphinx.sysusers.conf %{buildroot}%{_sysusersdir}/sphinx.conf - +%pre +getent group %{sphinx_group} >/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 @@ -248,15 +227,17 @@ install -m0644 -D sphinx.sysusers.conf %{buildroot}%{_sysusersdir}/sphinx.conf %preun %systemd_preun searchd.service -%ldconfig_scriptlets -n libsphinxclient +%post -n libsphinxclient -p /sbin/ldconfig + +%postun -n libsphinxclient -p /sbin/ldconfig %postun %systemd_postun_with_restart searchd.service %posttrans -chown -R %{sphinx_user}:root %{_localstatedir}/log/%{name}/ -chown -R %{sphinx_user}:root %{_localstatedir}/run/%{name}/ -chown -R %{sphinx_user}:root %{_localstatedir}/lib/%{name}/ +chown -R %{sphinx_user}:root %{_tmpfilesdir}/log/%{name}/ +chown -R %{sphinx_user}:root %{_tmpfilesdir}/run/%{name}/ +chown -R %{sphinx_user}:root %{_tmpfilesdir}/lib/%{name}/ %triggerun -- sphinx < 2.0.3-1 # Save the current service runlevel info @@ -279,119 +260,28 @@ chown -R %{sphinx_user}:root %{_localstatedir}/lib/%{name}/ %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_tmpfilesdir}/%{name}.conf %{_bindir}/* -%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/log/%{name} -%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/run/%{name} -%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/lib/%{name} +%dir %attr(0755, %{sphinx_user}, root) %{_tmpfilesdir}/log/%{name} +%dir %attr(0755, %{sphinx_user}, root) %{_tmpfilesdir}/run/%{name} +%dir %attr(0755, %{sphinx_user}, root) %{_tmpfilesdir}/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 - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.2.11-19 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Mon Feb 08 2021 Pavel Raiskup - 2.2.11-18 -- rebuild for libpq ABI fix rhbz#1908268 - -* Wed Jan 27 2021 Fedora Release Engineering - 2.2.11-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 2.2.11-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sat Jul 11 2020 Jiri Vanek - 2.2.11-15 -- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 - -* Fri Jan 31 2020 Fedora Release Engineering - 2.2.11-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Sep 05 2019 Ben Cotton - 2.2.11-13 -- Listen only on localhost (CVE-2019-14511, rhbz#1749190) - -* Fri Jul 26 2019 Fedora Release Engineering - 2.2.11-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Thu Feb 14 2019 Orion Poplawski - 2.2.11-11 -- Revert incorrect use of _tmpfiledir rhbx#1551735 - -* Sun Feb 03 2019 Fedora Release Engineering - 2.2.11-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jul 20 2018 Ben Cotton - 2.2.11-9 -- Fix FTBFS rhbz#1606397 - -* Sat Jul 14 2018 Fedora Release Engineering - 2.2.11-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 2.2.11-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Sep 20 2017 Ben Cotton - 2.2.11-6 -- Change MariaDB interface package dependency rhbz#1493696 * Thu Aug 03 2017 Fedora Release Engineering - 2.2.11-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild