From 18a7385e6f731b0f19bd062c0234b696613ff4d2 Mon Sep 17 00:00:00 2001 From: Allisson Azevedo Date: Feb 11 2010 13:42:51 +0000 Subject: - Update to 0.9.9 (#556997). - Added sphinx-0.9.9-fix_static.patch to fix FTBS. - Run sphinx searchd as non-root user (#541464). --- diff --git a/.cvsignore b/.cvsignore index 2d8eb9d..b7cfe5a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -sphinx-0.9.8.1.tar.gz +sphinx-0.9.9.tar.gz diff --git a/import.log b/import.log index 12ddeaa..352428f 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ sphinx-0_9_8_1-3_fc11:F-11:sphinx-0.9.8.1-3.fc11.src.rpm:1250267828 +sphinx-0_9_9-1_fc12:F-11:sphinx-0.9.9-1.fc12.src.rpm:1265895727 diff --git a/sources b/sources index d5a6e9c..7694026 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -428a14df41fb425e664d9e2d6178c037 sphinx-0.9.8.1.tar.gz +7b9b618cb9b378f949bb1b91ddcc4f54 sphinx-0.9.9.tar.gz diff --git a/sphinx-0.9.9-fix_static.patch b/sphinx-0.9.9-fix_static.patch new file mode 100644 index 0000000..a3a94bf --- /dev/null +++ b/sphinx-0.9.9-fix_static.patch @@ -0,0 +1,12 @@ +diff -up sphinx-0.9.9/api/libsphinxclient/sphinxclient.c.fix_static sphinx-0.9.9/api/libsphinxclient/sphinxclient.c +--- sphinx-0.9.9/api/libsphinxclient/sphinxclient.c.fix_static 2010-02-11 08:32:43.473905916 -0300 ++++ sphinx-0.9.9/api/libsphinxclient/sphinxclient.c 2010-02-11 08:33:23.264905947 -0300 +@@ -277,7 +277,7 @@ static void sphinx_free_results ( sphinx + } + + +-void sock_close ( int sock ); ++static void sock_close ( int sock ); + + void sphinx_destroy ( sphinx_client * client ) + { diff --git a/sphinx.init b/sphinx.init index 76c5892..5a9fb7a 100755 --- a/sphinx.init +++ b/sphinx.init @@ -24,6 +24,7 @@ exec="/usr/bin/searchd" prog="searchd" config="/etc/sphinx/sphinx.conf" +username="sphinx" lockfile=/var/lock/subsys/searchd @@ -32,7 +33,7 @@ start() { [ -f $config ] || exit 6 echo -n $"Starting $prog: " # if not running, start it up here, usually something like "daemon $exec" - daemon $exec --config $config + daemon --user=$username $exec --config $config retval=$? echo [ $retval -eq 0 ] && touch $lockfile diff --git a/sphinx.spec b/sphinx.spec index c9d0a3f..d66ae78 100644 --- a/sphinx.spec +++ b/sphinx.spec @@ -1,6 +1,10 @@ +%global sphinx_user sphinx +%global sphinx_group sphinx +%global sphinx_home %{_localstatedir}/lib/sphinx + Name: sphinx -Version: 0.9.8.1 -Release: 3%{?dist} +Version: 0.9.9 +Release: 1%{?dist} Summary: Free open-source SQL full-text search engine Group: Applications/Text @@ -8,6 +12,7 @@ License: GPLv2+ URL: http://sphinxsearch.com Source0: http://sphinxsearch.com/downloads/%{name}-%{version}.tar.gz Source1: %{name}.init +Patch0: %{name}-%{version}-fix_static.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: mysql-devel @@ -15,10 +20,12 @@ BuildRequires: postgresql-devel BuildRequires: expat-devel #Requires: +#Initscripts Requires(post): chkconfig -Requires(preun): chkconfig -# This is for /sbin/service -Requires(preun): initscripts +Requires(preun): chkconfig initscripts + +# Users and groups +Requires(pre): shadow-utils %description @@ -66,6 +73,7 @@ Sphinx search engine, http://sphinxsearch.com/ %prep %setup -q +%patch0 -p1 -b .fix_static # Fix wrong-file-end-of-line-encoding sed -i 's/\r//' api/ruby/spec/sphinx/sphinx_test.sql @@ -145,6 +153,13 @@ find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';' %clean rm -rf $RPM_BUILD_ROOT +%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 /sbin/chkconfig --add searchd @@ -154,12 +169,14 @@ if [ $1 = 0 ] ; then /sbin/chkconfig --del searchd fi - %post -p /sbin/ldconfig -n libsphinxclient - %postun -p /sbin/ldconfig -n libsphinxclient - + +%posttrans +chown -R %{sphinx_user}:root %{_localstatedir}/log/sphinx/ +chown -R %{sphinx_user}:root %{_localstatedir}/run/sphinx/ +chown -R %{sphinx_user}:root %{_localstatedir}/lib/sphinx/ %files @@ -172,9 +189,9 @@ fi %{_initrddir}/searchd %config(noreplace) %{_sysconfdir}/logrotate.d/sphinx %{_bindir}/* -%dir %{_localstatedir}/log/sphinx -%dir %{_localstatedir}/run/sphinx -%dir %{_localstatedir}/lib/sphinx +%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/log/sphinx +%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/run/sphinx +%dir %attr(0755, %{sphinx_user}, root) %{_localstatedir}/lib/sphinx %files -n libsphinxclient %defattr(-,root,root,-) @@ -188,6 +205,11 @@ fi %{_includedir}/* %changelog +* Thu Feb 11 2010 Allisson Azevedo 0.9.9-1 +- Update to 0.9.9 (#556997). +- Added sphinx-0.9.9-fix_static.patch to fix FTBS. +- Run sphinx searchd as non-root user (#541464). + * Wed Aug 12 2009 Allisson Azevedo 0.9.8.1-3 - Fixed macros consistency. - Modified make install to keep timestamps.