Your message dated Mon, 4 Jul 2016 22:27:42 +0200
with message-id <[email protected]>
and subject line Re: #563205:  sphinxsearch: Proposed package patches
has caused the Debian Bug report #563205,
regarding sphinxsearch: Proposed package patches (man pages, cronjob, non-root, 
API packages)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
563205: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563205
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sphinxsearch
Version: 0.9.9-1
Severity: wishlist
Tags: patch

Hi!

Thanks for bringing sphinxsearch into Debian. I've got some patches from 
my internal packaging to share, maybe they are of interest to you.

I'm attaching the patches, here are short descriptions:
0001-Add-man-pages-for-indexer-searchd.patch
     SGML-based man pages for indexer(1), searchd(1).

0002-Ship-configuration-file.patch
     Ship a sphinx.conf with Debian paths, and don't ship examples in /etc.

0003-Add-cronjob.patch
     Ship a cronjob to update the indexes daily.

0004-run-as-non-root.patch
     searchd does not need to run as root, run as user sphinxsearch instead.

0005-install-docs-examples.patch
0006-add-libsphinx-ruby-libsphinxclient-python-sphinxapi.patch
     Ship the included Ruby, Python and C client libraries.

You might need to shuffle some changes around if you're going to cherry pick 
patches.
Also I'm unsure if the Python and C library packaging is done correctly.

    Christian


-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
>From f7f55dd0a4c57903807da6c25ddc53e9bdc5094a Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 22:18:44 +0100
Subject: [PATCH 1/6] Add man-pages for indexer, searchd

---
 debian/control               |    2 +-
 debian/indexer.1.sgml        |  210 ++++++++++++++++++++++++++++++++++++++++++
 debian/rules                 |    4 +-
 debian/searchd.1.sgml        |  202 ++++++++++++++++++++++++++++++++++++++++
 debian/sphinxsearch.manpages |    2 +
 5 files changed, 418 insertions(+), 2 deletions(-)
 create mode 100644 debian/indexer.1.sgml
 create mode 100644 debian/searchd.1.sgml
 create mode 100644 debian/sphinxsearch.manpages

diff --git a/debian/control b/debian/control
index 78570a9..0337706 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: sphinxsearch
 Section: misc
 Priority: optional
 Maintainer: Radu Spineanu <[email protected]>
-Build-Depends: debhelper (>= 7), autotools-dev, gawk, libmysqlclient-dev, 
dpatch, libpq-dev, autoconf, libtool, automake
+Build-Depends: debhelper (>= 7), autotools-dev, gawk, libmysqlclient-dev, 
dpatch, libpq-dev, autoconf, libtool, automake, docbook-to-man
 Standards-Version: 3.8.3
 
 Package: sphinxsearch
diff --git a/debian/indexer.1.sgml b/debian/indexer.1.sgml
new file mode 100644
index 0000000..4b9cde6
--- /dev/null
+++ b/debian/indexer.1.sgml
@@ -0,0 +1,210 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+       docbook-to-man $< > $@
+
+
+       The docbook-to-man binary is found in the docbook-to-man package.
+       Please remember that if you create the nroff version in one of the
+       debian/rules file targets (such as build), you will need to include
+       docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Christian</firstname>">
+  <!ENTITY dhsurname   "<surname>Hofstaedtler</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>2009-10-09</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>[email protected]</email>">
+  <!ENTITY dhusername  "Christian Hofstaedtler">
+  <!ENTITY dhucpackage "<refentrytitle>sphinxsearch</refentrytitle>">
+  <!ENTITY dhpackage   "sphinxsearch">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2009</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>indexer</refname>
+
+    <refpurpose>fulltext index generator</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>indexer</command>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <arg><option>--rotate</option></arg>
+      <group>
+        <arg><option>--noprogress</option></arg>
+        <arg><option>--quiet</option></arg>
+      </group>
+      <group>
+        <arg><option>--all</option></arg>
+        <arg rep='repeat'><replaceable>INDEX</replaceable></arg>
+      </group>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>indexer</command>
+      <arg choice='req'>--buildstops <replaceable>OUTPUTFILE</replaceable> 
<replaceable>COUNT</replaceable></arg>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <group>
+        <arg><option>--noprogress</option></arg>
+        <arg><option>--quiet</option></arg>
+      </group>
+      <group>
+        <arg><option>--all</option></arg>
+        <arg rep='repeat'><replaceable>INDEX</replaceable></arg>
+      </group>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>indexer</command>
+      <arg choice='req'>--merge <replaceable>MAIN_INDEX</replaceable> 
<replaceable>DELTA_INDEX</replaceable></arg>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <arg><option>--rotate</option></arg>
+      <group>
+        <arg><option>--noprogress</option></arg>
+        <arg><option>--quiet</option></arg>
+      </group>
+    </cmdsynopsis>
+ 
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+    <para>Sphinx is a collection of programs that aim to provide high 
+      quality fulltext search. <command>indexer</command> fetches all
+      documents from the configured sources and creates the index data
+      files.</para>
+
+    <para>This manual page was written for the &debian; distribution
+      because the original program does not have a manual page.
+      Instead, it has documentation in HTML format, see below.</para>
+
+  </refsect1>
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <para>These programs follow the usual &gnu; command line syntax,
+      with long options starting with two dashes (`-').  A summary of
+      options is included below.  For a complete description, see the
+      HTML documentation.</para>
+
+    <variablelist>
+
+      <varlistentry>
+        <term><option>--config</option>
+        </term>
+        <listitem>
+          <para>Specify an alternate configuration file to use.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--all</option>
+        </term>
+        <listitem>
+          <para>Causes <command>indexer</command> to (re-)index all indexes, 
instead of the specified ones.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--quiet</option>
+        </term>
+        <listitem>
+          <para>Suppress all non-error output.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--noprogress</option>
+        </term>
+        <listitem>
+          <para>Suppress progress information.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--rotate</option>
+        </term>
+        <listitem>
+          <para>Writes index data files as INDEX.new files and sends a SIGHUP 
to searchd, causing it to rotate the index files.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>search (1), searchd (1).</para>
+
+    <para>Sphinx and it's programs are documented fully by the 
<citetitle>Spinx reference manual</citetitle> available 
+      in /usr/share/doc/sphinxsearch.</para>
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>This manual page was written by &dhusername; &dhemail; for
+      the &debian; system (but may be used by others).  Permission is
+      granted to copy, distribute and/or modify this document under
+      the terms of the &gnu; General Public License, Version 2 any
+         later version published by the Free Software Foundation.
+    </para>
+       <para>
+         On Debian systems, the complete text of the GNU General Public
+         License can be found in /usr/share/common-licenses/GPL.
+       </para>
+
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/debian/rules b/debian/rules
index 314c349..76e9306 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,6 +37,8 @@ build: patch build-stamp
 build-stamp:  config.status
        dh_testdir
        $(MAKE)
+       docbook-to-man debian/indexer.1.sgml > indexer.1
+       docbook-to-man debian/searchd.1.sgml > searchd.1
        touch build-stamp
 
 clean: clean1 unpatch
@@ -53,7 +55,7 @@ ifneq "$(wildcard /usr/share/misc/config.guess)" ""
        cp -f /usr/share/misc/config.guess config.guess
 endif
 
-
+       rm -f indexer.1 searchd.1
        dh_clean 
 
 install: build
diff --git a/debian/searchd.1.sgml b/debian/searchd.1.sgml
new file mode 100644
index 0000000..2a4e5c4
--- /dev/null
+++ b/debian/searchd.1.sgml
@@ -0,0 +1,202 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+       docbook-to-man $< > $@
+
+
+       The docbook-to-man binary is found in the docbook-to-man package.
+       Please remember that if you create the nroff version in one of the
+       debian/rules file targets (such as build), you will need to include
+       docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Christian</firstname>">
+  <!ENTITY dhsurname   "<surname>Hofstaedtler</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>2009-10-09</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>[email protected]</email>">
+  <!ENTITY dhusername  "Christian Hofstaedtler">
+  <!ENTITY dhucpackage "<refentrytitle>sphinxsearch</refentrytitle>">
+  <!ENTITY dhpackage   "sphinxsearch">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2009</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>searchd</refname>
+
+    <refpurpose>socket server handling search requests backed by 
Sphinx</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+   <cmdsynopsis>
+      <command>searchd</command>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <arg><option>--cpustats</option></arg>
+      <arg><option>--iostats</option></arg>
+      <arg><option>--index <replaceable>INDEX</replaceable></option></arg>
+      <arg><option>--port <replaceable>PORT</replaceable></option></arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>searchd</command>
+      <arg choice='req'>--status</arg>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <arg><option>--pidfile <replaceable>PIDFILE</replaceable></option></arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>searchd</command>
+      <arg choice='req'>--stop</arg>
+      <arg><option>--config 
<replaceable>CONFIGFILE</replaceable></option></arg>
+      <arg><option>--pidfile <replaceable>PIDFILE</replaceable></option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+    <para>Sphinx is a collection of programs that aim to provide high 
+      quality fulltext search. <command>searchd</command> answers search
+      requests coming in on a socket.</para>
+
+    <para>This manual page was written for the &debian; distribution
+      because the original program does not have a manual page.
+      Instead, it has documentation in HTML format, see below.</para>
+
+  </refsect1>
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <para>These programs follow the usual &gnu; command line syntax,
+      with long options starting with two dashes (`-').  A summary of
+      options is included below.  For a complete description, see the
+      HTML documentation.</para>
+
+    <variablelist>
+
+      <varlistentry>
+        <term><option>--config</option>
+        </term>
+        <listitem>
+          <para>Specify an alternate configuration file to use.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--cpustats</option>
+        </term>
+        <listitem>
+          <para>Provide per-query CPU stats in searchd log.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--iostats</option>
+        </term>
+        <listitem>
+          <para>Provide per-query I/O stats in searchd log.</para>
+        </listitem>
+      </varlistentry>
+
+
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--pidfile</option>
+        </term>
+        <listitem>
+          <para>Used with <option>--status</option> and 
<option>--stop</option> to find the correct searchd.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--status</option>
+        </term>
+        <listitem>
+          <para>Print status variables of a running searchd.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--stop</option>
+        </term>
+        <listitem>
+          <para>Send SIGTERM to a running searchd.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>indexer (1), search (1).</para>
+
+    <para>Sphinx and it's programs are documented fully by the 
<citetitle>Spinx reference manual</citetitle> available 
+      in /usr/share/doc/sphinxsearch.</para>
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>This manual page was written by &dhusername; &dhemail; for
+      the &debian; system (but may be used by others).  Permission is
+      granted to copy, distribute and/or modify this document under
+      the terms of the &gnu; General Public License, Version 2 any
+         later version published by the Free Software Foundation.
+    </para>
+       <para>
+         On Debian systems, the complete text of the GNU General Public
+         License can be found in /usr/share/common-licenses/GPL.
+       </para>
+
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/debian/sphinxsearch.manpages b/debian/sphinxsearch.manpages
new file mode 100644
index 0000000..8f4aa04
--- /dev/null
+++ b/debian/sphinxsearch.manpages
@@ -0,0 +1,2 @@
+searchd.1
+indexer.1
-- 
1.6.4.4

>From 12de659fa09615283f75e869bc565e033115fb7d Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 22:40:19 +0100
Subject: [PATCH 2/6] Ship configuration file

---
 debian/README.Debian |    7 +
 debian/init.d        |    7 -
 debian/rules         |    6 +
 debian/sphinx.conf   |  677 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 690 insertions(+), 7 deletions(-)
 create mode 100644 debian/README.Debian
 create mode 100644 debian/sphinx.conf

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..337de42
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,7 @@
+Sphinxsearch
+------------
+
+searchd will start automatically, but the default configuration does not supply
+any indexes. Therefore, searchd will not continue running. You have to edit
+/etc/sphinxsearch/sphinx.conf to get any meaningful mode of operation.
+
diff --git a/debian/init.d b/debian/init.d
index 5de86ce..d50a5f2 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -89,13 +89,6 @@ case "$1" in
   start)
         echo -n "Starting $DESC: "
 
-        # Check if we have the configuration file
-        if [ ! -f /etc/sphinxsearch/sphinx.conf ]; then
-            echo "Please create an /etc/sphinxsearch/sphinx.conf configuration 
file."
-            echo "Templates are in the /etc/sphinxsearch/ directory."
-            exit 0
-        fi
-
         start-stop-daemon --start --exec ${DAEMON}
         if running ; then
             echo "$NAME."
diff --git a/debian/rules b/debian/rules
index 76e9306..dc7ab52 100755
--- a/debian/rules
+++ b/debian/rules
@@ -67,6 +67,12 @@ install: build
        # Add here commands to install the package into debian/sphinxsearch.
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
 
+       # Ship no examples in /etc/, but our configuration file instead.
+       rm $(CURDIR)/debian/tmp/etc/sphinxsearch/example.sql
+       rm $(CURDIR)/debian/tmp/etc/sphinxsearch/sphinx-min.conf.dist
+       rm $(CURDIR)/debian/tmp/etc/sphinxsearch/sphinx.conf.dist
+       install -m0600 debian/sphinx.conf 
$(CURDIR)/debian/tmp/etc/sphinxsearch/sphinx.conf
+
 
 # Build architecture-independent files here.
 binary-indep: build install
diff --git a/debian/sphinx.conf b/debian/sphinx.conf
new file mode 100644
index 0000000..15c50c9
--- /dev/null
+++ b/debian/sphinx.conf
@@ -0,0 +1,677 @@
+#
+# Example Sphinx configuration for Debian
+#
+# WARNING! While this sample file mentions all available options,
+# it contains (very) short helper descriptions only. Please refer to
+# /usr/share/doc/sphinxsearch/sphinx.html for details.
+#
+
+#############################################################################
+## data source definition
+#############################################################################
+
+#source src1
+#{
+#      # data source type. mandatory, no default value
+#      # known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
+#      type                                    = mysql
+#
+#      #####################################################################
+#      ## SQL settings (for 'mysql' and 'pgsql' types)
+#      #####################################################################
+#
+#      # some straightforward parameters for SQL source types
+#      sql_host                                = localhost
+#      sql_user                                = test
+#      sql_pass                                =
+#      sql_db                                  = test
+#      sql_port                                = 3306  # optional, default is 
3306
+#
+#      # UNIX socket name
+#      # optional, default is empty (reuse client library defaults)
+#      # usually '/var/lib/mysql/mysql.sock' on Linux
+#      # usually '/tmp/mysql.sock' on FreeBSD
+#      #
+#      # sql_sock                              = /tmp/mysql.sock
+#
+#
+#      # MySQL specific client connection flags
+#      # optional, default is 0
+#      #
+#      # mysql_connect_flags   = 32 # enable compression
+#
+#      # MySQL specific SSL certificate settings
+#      # optional, defaults are empty
+#      #
+#      # mysql_ssl_cert                = /etc/ssl/client-cert.pem
+#      # mysql_ssl_key         = /etc/ssl/client-key.pem
+#      # mysql_ssl_ca          = /etc/ssl/cacert.pem
+#
+#      # MS SQL specific Windows authentication mode flag
+#      # MUST be in sync with charset_type index-level setting
+#      # optional, default is 0
+#      #
+#      # mssql_winauth                 = 1 # use currently logged on user 
credentials
+#
+#
+#      # MS SQL specific Unicode indexing flag
+#      # optional, default is 0 (request SBCS data)
+#      #
+#      # mssql_unicode                 = 1 # request Unicode data from server
+#
+#
+#      # ODBC specific DSN (data source name)
+#      # mandatory for odbc source type, no default value
+#      #
+#      # odbc_dsn                              = 
DBQ=C:\data;DefaultDir=C:\data;Driver={Microsoft Text Driver (*.txt; *.csv)};
+#      # sql_query                             = SELECT id, data FROM 
documents.csv
+#
+#
+#      # pre-query, executed before the main fetch query
+#      # multi-value, optional, default is empty list of queries
+#      #
+#      # sql_query_pre                 = SET NAMES utf8
+#      # sql_query_pre                 = SET SESSION query_cache_type=OFF
+#
+#
+#      # main document fetch query
+#      # mandatory, integer document ID field MUST be the first selected column
+#      sql_query                               = \
+#              SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, 
title, content \
+#              FROM documents
+#
+#      # range query setup, query that must return min and max ID values
+#      # optional, default is empty
+#      #
+#      # sql_query will need to reference $start and $end boundaries
+#      # if using ranged query:
+#      #
+#      # sql_query                             = \
+#      #       SELECT doc.id, doc.id AS group, doc.title, doc.data \
+#      #       FROM documents doc \
+#      #       WHERE id>=$start AND id<=$end
+#      #
+#      # sql_query_range               = SELECT MIN(id),MAX(id) FROM documents
+#
+#
+#      # range query step
+#      # optional, default is 1024
+#      #
+#      # sql_range_step                = 1000
+#
+#
+#      # unsigned integer attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # optional bit size can be specified, default is 32
+#      #
+#      # sql_attr_uint                 = author_id
+#      # sql_attr_uint                 = forum_id:9 # 9 bits for forum_id
+#      sql_attr_uint                   = group_id
+#
+#      # boolean attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # equivalent to sql_attr_uint with 1-bit size
+#      #
+#      # sql_attr_bool                 = is_deleted
+#
+#
+#      # bigint attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # declares a signed (unlike uint!) 64-bit attribute
+#      #
+#      # sql_attr_bigint                       = my_bigint_id
+#
+#
+#      # UNIX timestamp attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # similar to integer, but can also be used in date functions
+#      #
+#      # sql_attr_timestamp    = posted_ts
+#      # sql_attr_timestamp    = last_edited_ts
+#      sql_attr_timestamp              = date_added
+#
+#      # string ordinal attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # sorts strings (bytewise), and stores their indexes in the sorted list
+#      # sorting by this attr is equivalent to sorting by the original strings
+#      #
+#      # sql_attr_str2ordinal  = author_name
+#
+#
+#      # floating point attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # values are stored in single precision, 32-bit IEEE 754 format
+#      #
+#      # sql_attr_float = lat_radians
+#      # sql_attr_float = long_radians
+#
+#
+#      # multi-valued attribute (MVA) attribute declaration
+#      # multi-value (an arbitrary number of attributes is allowed), optional
+#      # MVA values are variable length lists of unsigned 32-bit integers
+#      #
+#      # syntax is ATTR-TYPE ATTR-NAME 'from' SOURCE-TYPE [;QUERY] 
[;RANGE-QUERY]
+#      # ATTR-TYPE is 'uint' or 'timestamp'
+#      # SOURCE-TYPE is 'field', 'query', or 'ranged-query'
+#      # QUERY is SQL query used to fetch all ( docid, attrvalue ) pairs
+#      # RANGE-QUERY is SQL query used to fetch min and max ID values, similar 
to 'sql_query_range'
+#      #
+#      # sql_attr_multi        = uint tag from query; SELECT id, tag FROM tags
+#      # sql_attr_multi        = uint tag from ranged-query; \
+#      #       SELECT id, tag FROM tags WHERE id>=$start AND id<=$end; \
+#      #       SELECT MIN(id), MAX(id) FROM tags
+#
+#
+#      # post-query, executed on sql_query completion
+#      # optional, default is empty
+#      #
+#      # sql_query_post                =
+#
+#      
+#      # post-index-query, executed on successful indexing completion
+#      # optional, default is empty
+#      # $maxid expands to max document ID actually fetched from DB
+#      #
+#      # sql_query_post_index = REPLACE INTO counters ( id, val ) \
+#      #       VALUES ( 'max_indexed_id', $maxid )
+#
+#
+#      # ranged query throttling, in milliseconds
+#      # optional, default is 0 which means no delay
+#      # enforces given delay before each query step
+#      sql_ranged_throttle     = 0
+#
+#      # document info query, ONLY for CLI search (ie. testing and debugging)
+#      # optional, default is empty
+#      # must contain $id macro and must fetch the document by that id
+#      sql_query_info          = SELECT * FROM documents WHERE id=$id
+#
+#      # kill-list query, fetches the document IDs for kill-list
+#      # k-list will suppress matches from preceding indexes in the same query
+#      # optional, default is empty
+#      #
+#      # sql_query_killlist    = SELECT id FROM documents WHERE 
edited>=@last_reindex
+#
+#
+#      # columns to unpack on indexer side when indexing
+#      # multi-value, optional, default is empty list
+#      #
+#      # unpack_zlib = zlib_column
+#      # unpack_mysqlcompress = compressed_column
+#      # unpack_mysqlcompress = compressed_column_2
+#
+#
+#      # maximum unpacked length allowed in MySQL COMPRESS() unpacker
+#      # optional, default is 16M
+#      #
+#      # unpack_mysqlcompress_maxsize = 16M
+#
+#
+#      #####################################################################
+#      ## xmlpipe settings
+#      #####################################################################
+#
+#      # type                          = xmlpipe
+#
+#      # shell command to invoke xmlpipe stream producer
+#      # mandatory
+#      #
+#      # xmlpipe_command       = cat /var/lib/sphinxsearch/test.xml
+#
+#      #####################################################################
+#      ## xmlpipe2 settings
+#      #####################################################################
+#
+#      # type                          = xmlpipe2
+#      # xmlpipe_command       = cat /var/lib/sphinxsearch/test2.xml
+#
+#
+#      # xmlpipe2 field declaration
+#      # multi-value, optional, default is empty
+#      #
+#      # xmlpipe_field                         = subject
+#      # xmlpipe_field                         = content
+#
+#
+#      # xmlpipe2 attribute declaration
+#      # multi-value, optional, default is empty
+#      # all xmlpipe_attr_XXX options are fully similar to sql_attr_XXX
+#      #
+#      # xmlpipe_attr_timestamp        = published
+#      # xmlpipe_attr_uint                     = author_id
+#
+#
+#      # perform UTF-8 validation, and filter out incorrect codes
+#      # avoids XML parser choking on non-UTF-8 documents
+#      # optional, default is 0
+#      #
+#      # xmlpipe_fixup_utf8            = 1
+#}
+
+
+# inherited source example
+#
+# all the parameters are copied from the parent source,
+# and may then be overridden in this source definition
+#source src1throttled : src1
+#{
+#      sql_ranged_throttle                     = 100
+#}
+
+#############################################################################
+## index definition
+#############################################################################
+
+# local index example
+#
+# this is an index which is stored locally in the filesystem
+#
+# all indexing-time options (such as morphology and charsets)
+# are configured per local index
+#index test1
+#{
+#      # document source(s) to index
+#      # multi-value, mandatory
+#      # document IDs must be globally unique across all sources
+#      source                  = src1
+#
+#      # index files path and file name, without extension
+#      # mandatory, path must be writable, extensions will be auto-appended
+#      path                    = /var/lib/sphinxsearch/data/test1
+#
+#      # document attribute values (docinfo) storage mode
+#      # optional, default is 'extern'
+#      # known values are 'none', 'extern' and 'inline'
+#      docinfo                 = extern
+#
+#      # memory locking for cached data (.spa and .spi), to prevent swapping
+#      # optional, default is 0 (do not mlock)
+#      # requires searchd to be run from root
+#      mlock                   = 0
+#
+#      # a list of morphology preprocessors to apply
+#      # optional, default is empty
+#      #
+#      # builtin preprocessors are 'none', 'stem_en', 'stem_ru', 'stem_enru',
+#      # 'soundex', and 'metaphone'; additional preprocessors available from
+#      # libstemmer are 'libstemmer_XXX', where XXX is algorithm code
+#      # (see libstemmer_c/libstemmer/modules.txt)
+#      #
+#      # morphology    = stem_en, stem_ru, soundex
+#      # morphology    = libstemmer_german
+#      # morphology    = libstemmer_sv
+#      morphology              = none
+#
+#      # minimum word length at which to enable stemming
+#      # optional, default is 1 (stem everything)
+#      #
+#      # min_stemming_len      = 1
+#
+#
+#      # stopword files list (space separated)
+#      # optional, default is empty
+#      # contents are plain text, charset_table and stemming are both applied
+#      #
+#      # stopwords                     = /var/lib/sphinxsearch/stopwords.txt
+#
+#
+#      # wordforms file, in "mapfrom > mapto" plain text format
+#      # optional, default is empty
+#      #
+#      # wordforms                     = /var/lib/sphinxsearch/wordforms.txt
+#
+#
+#      # tokenizing exceptions file
+#      # optional, default is empty
+#      #
+#      # plain text, case sensitive, space insensitive in map-from part
+#      # one "Map Several Words => ToASingleOne" entry per line
+#      #
+#      # exceptions            = /var/lib/sphinxsearch/exceptions.txt
+#
+#
+#      # minimum indexed word length
+#      # default is 1 (index everything)
+#      min_word_len            = 1
+#
+#      # charset encoding type
+#      # optional, default is 'sbcs'
+#      # known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
+#      charset_type            = sbcs
+#
+#      # charset definition and case folding rules "table"
+#      # optional, default value depends on charset_type
+#      #
+#      # defaults are configured to include English and Russian characters only
+#      # you need to change the table to include additional ones
+#      # this behavior MAY change in future versions
+#      #
+#      # 'sbcs' default value is
+#      # charset_table         = 0..9, A..Z->a..z, _, a..z, U+A8->U+B8, U+B8, 
U+C0..U+DF->U+E0..U+FF, U+E0..U+FF
+#      #
+#      # 'utf-8' default value is
+#      # charset_table         = 0..9, A..Z->a..z, _, a..z, 
U+410..U+42F->U+430..U+44F, U+430..U+44F
+#
+#
+#      # ignored characters list
+#      # optional, default value is empty
+#      #
+#      # ignore_chars          = U+00AD
+#
+#
+#      # minimum word prefix length to index
+#      # optional, default is 0 (do not index prefixes)
+#      #
+#      # min_prefix_len        = 0
+#
+#
+#      # minimum word infix length to index
+#      # optional, default is 0 (do not index infixes)
+#      #
+#      # min_infix_len         = 0
+#
+#
+#      # list of fields to limit prefix/infix indexing to
+#      # optional, default value is empty (index all fields in prefix/infix 
mode)
+#      #
+#      # prefix_fields         = filename
+#      # infix_fields          = url, domain
+#
+#
+#      # enable star-syntax (wildcards) when searching prefix/infix indexes
+#      # known values are 0 and 1
+#      # optional, default is 0 (do not use wildcard syntax)
+#      #
+#      # enable_star           = 1
+#
+#
+#      # n-gram length to index, for CJK indexing
+#      # only supports 0 and 1 for now, other lengths to be implemented
+#      # optional, default is 0 (disable n-grams)
+#      #
+#      # ngram_len                             = 1
+#
+#
+#      # n-gram characters list, for CJK indexing
+#      # optional, default is empty
+#      #
+#      # ngram_chars                   = U+3000..U+2FA1F
+#
+#
+#      # phrase boundary characters list
+#      # optional, default is empty
+#      #
+#      # phrase_boundary               = ., ?, !, U+2026 # horizontal ellipsis
+#
+#
+#      # phrase boundary word position increment
+#      # optional, default is 0
+#      #
+#      # phrase_boundary_step  = 100
+#
+#
+#      # whether to strip HTML tags from incoming documents
+#      # known values are 0 (do not strip) and 1 (do strip)
+#      # optional, default is 0
+#      html_strip                              = 0
+#
+#      # what HTML attributes to index if stripping HTML
+#      # optional, default is empty (do not index anything)
+#      #
+#      # html_index_attrs              = img=alt,title; a=title;
+#
+#
+#      # what HTML elements contents to strip
+#      # optional, default is empty (do not strip element contents)
+#      #
+#      # html_remove_elements  = style, script
+#
+#
+#      # whether to preopen index data files on startup
+#      # optional, default is 0 (do not preopen), searchd-only
+#      #
+#      # preopen                                       = 1
+#
+#
+#      # whether to keep dictionary (.spi) on disk, or cache it in RAM
+#      # optional, default is 0 (cache in RAM), searchd-only
+#      #
+#      # ondisk_dict                           = 1
+#
+#
+#      # whether to enable in-place inversion (2x less disk, 90-95% speed)
+#      # optional, default is 0 (use separate temporary files), indexer-only
+#      #
+#      # inplace_enable                        = 1
+#
+#
+#      # in-place fine-tuning options
+#      # optional, defaults are listed below
+#      #
+#      # inplace_hit_gap                       = 0             # preallocated 
hitlist gap size
+#      # inplace_docinfo_gap           = 0             # preallocated docinfo 
gap size
+#      # inplace_reloc_factor  = 0.1   # relocation buffer size within arena
+#      # inplace_write_factor  = 0.1   # write buffer size within arena
+#
+#
+#      # whether to index original keywords along with stemmed versions
+#      # enables "=exactform" operator to work
+#      # optional, default is 0
+#      #
+#      # index_exact_words             = 1
+#
+#
+#      # position increment on overshort (less that min_word_len) words
+#      # optional, allowed values are 0 and 1, default is 1
+#      #
+#      # overshort_step                        = 1
+#
+#
+#      # position increment on stopword
+#      # optional, allowed values are 0 and 1, default is 1
+#      #
+#      # stopword_step                 = 1
+#}
+
+#
+# inherited index example
+#
+# all the parameters are copied from the parent index,
+# and may then be overridden in this index definition
+#index test1stemmed : test1
+#{
+#      path                    = /var/lib/sphinxsearch/data/test1stemmed
+#      morphology              = stem_en
+#}
+
+
+# distributed index example
+#
+# this is a virtual index which can NOT be directly indexed,
+# and only contains references to other local and/or remote indexes
+#index dist1
+#{
+#      # 'distributed' index type MUST be specified
+#      type                            = distributed
+#
+#      # local index to be searched
+#      # there can be many local indexes configured
+#      local                           = test1
+#      local                           = test1stemmed
+#
+#      # remote agent
+#      # multiple remote agents may be specified
+#      # syntax for TCP connections is 'hostname:port:index1,[index2[,...]]'
+#      # syntax for local UNIX connections is 
'/path/to/socket:index1,[index2[,...]]'
+#      agent                           = localhost:9313:remote1
+#      agent                           = localhost:9314:remote2,remote3
+#      # agent                         = /var/run/searchd.sock:remote4
+#
+#      # blackhole remote agent, for debugging/testing
+#      # network errors and search results will be ignored
+#      #
+#      # agent_blackhole               = testbox:9312:testindex1,testindex2
+#
+#
+#      # remote agent connection timeout, milliseconds
+#      # optional, default is 1000 ms, ie. 1 sec
+#      agent_connect_timeout   = 1000
+#
+#      # remote agent query timeout, milliseconds
+#      # optional, default is 3000 ms, ie. 3 sec
+#      agent_query_timeout             = 3000
+#}
+
+#############################################################################
+## indexer settings
+#############################################################################
+
+indexer
+{
+       # memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
+       # optional, default is 32M, max is 2047M, recommended is 256M to 1024M
+       mem_limit                       = 256M
+
+       # maximum IO calls per second (for I/O throttling)
+       # optional, default is 0 (unlimited)
+       #
+       # max_iops                      = 40
+
+
+       # maximum IO call size, bytes (for I/O throttling)
+       # optional, default is 0 (unlimited)
+       #
+       # max_iosize            = 1048576
+
+
+       # maximum xmlpipe2 field length, bytes
+       # optional, default is 2M
+       #
+       # max_xmlpipe2_field    = 4M
+
+
+       # write buffer size, bytes
+       # several (currently up to 4) buffers will be allocated
+       # write buffers are allocated in addition to mem_limit
+       # optional, default is 1M
+       #
+       # write_buffer          = 1M
+}
+
+#############################################################################
+## searchd settings
+#############################################################################
+
+searchd
+{
+       # hostname, port, or hostname:port, or /unix/socket/path to listen on
+       # multi-value, multiple listen points are allowed
+       # optional, default is 0.0.0.0:9312 (listen on all interfaces, port 
3312)
+       #
+       listen                  = 127.0.0.1
+       # listen                = 192.168.0.1:9312
+       # listen                = 9312
+       # listen                = /var/run/sphinxsearch/searchd.sock
+
+
+       # log file, searchd run info is logged here
+       # optional, default is 'searchd.log'
+       log                     = /var/log/sphinxsearch/searchd.log
+
+       # query log file, all search queries are logged here
+       # optional, default is empty (do not log queries)
+       query_log               = /var/log/sphinxsearch/query.log
+
+       # client read timeout, seconds
+       # optional, default is 5
+       read_timeout            = 5
+
+       # request timeout, seconds
+       # optional, default is 5 minutes
+       client_timeout          = 300
+
+       # maximum amount of children to fork (concurrent searches to run)
+       # optional, default is 0 (unlimited)
+       max_children            = 30
+
+       # PID file, searchd process ID file name
+       # mandatory
+       # NOTE: If you change this, also edit /etc/default/sphinxsearch
+       pid_file                = /var/run/sphinxsearch/searchd.pid
+
+       # max amount of matches the daemon ever keeps in RAM, per-index
+       # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL
+       # default is 1000 (just like Google)
+       max_matches             = 1000
+
+       # seamless rotate, prevents rotate stalls if precaching huge datasets
+       # optional, default is 1
+       seamless_rotate         = 1
+
+       # whether to forcibly preopen all indexes on startup
+       # optional, default is 0 (do not preopen)
+       preopen_indexes         = 0
+
+       # whether to unlink .old index copies on succesful rotation.
+       # optional, default is 1 (do unlink)
+       unlink_old              = 1
+
+       # attribute updates periodic flush timeout, seconds
+       # updates will be automatically dumped to disk this frequently
+       # optional, default is 0 (disable periodic flush)
+       #
+       # attr_flush_period     = 900
+
+
+       # instance-wide ondisk_dict defaults (per-index value take precedence)
+       # optional, default is 0 (precache all dictionaries in RAM)
+       #
+       # ondisk_dict_default   = 1
+
+
+       # MVA updates pool size
+       # shared between all instances of searchd, disables attr flushes!
+       # optional, default size is 1M
+       mva_updates_pool        = 1M
+
+       # max allowed network packet size
+       # limits both query packets from clients, and responses from agents
+       # optional, default size is 8M
+       max_packet_size         = 8M
+
+       # crash log path
+       # searchd will (try to) log crashed query to 'crash_log_path.PID' file
+       # optional, default is empty (do not create crash logs)
+       #
+       # crash_log_path        = /var/log/sphinxsearch/crash
+
+
+       # max allowed per-query filter count
+       # optional, default is 256
+       max_filters             = 256
+
+       # max allowed per-filter values count
+       # optional, default is 4096
+       max_filter_values       = 4096
+
+
+       # socket listen queue length
+       # optional, default is 5
+       #
+       # listen_backlog        = 5
+
+
+       # per-keyword read buffer size
+       # optional, default is 256K
+       #
+       # read_buffer           = 256K
+
+
+       # unhinted read size (currently used when reading hits)
+       # optional, default is 32K
+       #
+       # read_unhinted         = 32K
+}
+
+# --eof--
+
-- 
1.6.4.4

>From ac874047f79ec2a7e1a55dc2cd6c13a6141d9a0e Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 22:42:48 +0100
Subject: [PATCH 3/6] Add cronjob

---
 debian/rules               |    1 +
 debian/sphinxsearch.cron.d |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
 create mode 100644 debian/sphinxsearch.cron.d

diff --git a/debian/rules b/debian/rules
index dc7ab52..8f0f304 100755
--- a/debian/rules
+++ b/debian/rules
@@ -87,6 +87,7 @@ binary-arch: build install
        dh_installdocs
        dh_installexamples
        dh_install
+       dh_installcron
        dh_installdebconf       
        dh_installinit
        dh_installman
diff --git a/debian/sphinxsearch.cron.d b/debian/sphinxsearch.cron.d
new file mode 100644
index 0000000..9a53fb8
--- /dev/null
+++ b/debian/sphinxsearch.cron.d
@@ -0,0 +1,9 @@
+
+# Rebuild all indexes daily and notify searchd.
+@daily      sphinxsearch [ -x /usr/bin/indexer ] && /usr/bin/indexer --quiet 
--rotate --all
+
+# Example for rotating only specific indexes (usually these would be part of
+# a larger combined index).
+
+# */5 * * * * sphinxsearch [ -x /usr/bin/indexer ] && /usr/bin/indexer --quiet 
--rotate postdelta threaddelta
+
-- 
1.6.4.4

>From dc5628d31e54fe4f9e65ca1a6de697ea762a819b Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 22:52:39 +0100
Subject: [PATCH 4/6] run as non-root

---
 debian/control               |    2 +-
 debian/init.d                |   15 +++++++++++----
 debian/sphinxsearch.postinst |   11 +++++++++++
 3 files changed, 23 insertions(+), 5 deletions(-)
 create mode 100644 debian/sphinxsearch.postinst

diff --git a/debian/control b/debian/control
index 0337706..379821e 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.8.3
 
 Package: sphinxsearch
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libmysqlclient16
+Depends: ${shlibs:Depends}, ${misc:Depends}, libmysqlclient16, adduser
 Description: Fast standalone full-text SQL search engine
  Sphinx is a standalone full text search engine, meant to provide fast,
  size-efficient and relevant fulltext search functions to other applications. 
diff --git a/debian/init.d b/debian/init.d
index d50a5f2..9742fb9 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -26,7 +26,8 @@ DESC=sphinx
 test -x $DAEMON || exit 0
 
 LOGDIR=/var/log/sphinx
-PIDFILE=/var/run/searchd.pid
+PIDDIR=/var/run/sphinxsearch
+PIDFILE=$PIDDIR/searchd.pid
 DODTIME=1                   # Time to wait for the server to die, in seconds
                             # If this value is set too low you might not
                             # let some servers to die gracefully and
@@ -39,6 +40,12 @@ fi
 
 set -e
 
+# Precreate PID-file location, as it may be on tmpfs
+if [ ! -d $PIDDIR ]; then
+        mkdir $PIDDIR
+        chown sphinxsearch $PIDDIR
+fi
+
 running_pid()
 {
     # Check if a given process pid's cmdline matches a given name
@@ -89,7 +96,7 @@ case "$1" in
   start)
         echo -n "Starting $DESC: "
 
-        start-stop-daemon --start --exec ${DAEMON}
+        start-stop-daemon --start --exec --chuid sphinxsearch ${DAEMON}
         if running ; then
             echo "$NAME."
         else
@@ -98,7 +105,7 @@ case "$1" in
         ;;
   stop)
         echo -n "Stopping $DESC: "
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
+        start-stop-daemon --stop --quiet --user sphinxsearch --oknodo 
--pidfile $PIDFILE \
             --exec $DAEMON
         echo "$NAME."
         ;;
@@ -113,7 +120,7 @@ case "$1" in
         ;;
   restart)
     echo -n "Restarting $DESC: "
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
+        start-stop-daemon --stop --quiet --user sphinxsearch --oknodo 
--pidfile $PIDFILE \
             --exec $DAEMON
         [ -n "$DODTIME" ] && sleep $DODTIME
         start-stop-daemon --start --exec ${DAEMON}
diff --git a/debian/sphinxsearch.postinst b/debian/sphinxsearch.postinst
new file mode 100644
index 0000000..698ac4c
--- /dev/null
+++ b/debian/sphinxsearch.postinst
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+getent passwd sphinxsearch >/dev/null
+if [[ $? != 0 ]]; then
+       adduser --system --disabled-login --home /var/run/sphinxsearch --gecos 
"Sphinx fulltext search service" --group sphinxsearch
+fi
+
+chown sphinxsearch: /var/log/sphinxsearch /var/lib/sphinxsearch
+
+#DEBHELPER#
+
-- 
1.6.4.4

>From fb0d843874cd7da758774666171af78ef47247d1 Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 22:53:23 +0100
Subject: [PATCH 5/6] install docs & examples

---
 debian/sphinxsearch.docs     |   10 ++++++++++
 debian/sphinxsearch.examples |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 debian/sphinxsearch.docs
 create mode 100644 debian/sphinxsearch.examples

diff --git a/debian/sphinxsearch.docs b/debian/sphinxsearch.docs
new file mode 100644
index 0000000..9cab886
--- /dev/null
+++ b/debian/sphinxsearch.docs
@@ -0,0 +1,10 @@
+example.sql
+doc/internals-coding-standard.txt
+doc/internals-index-format.txt
+doc/sphinx.css
+doc/sphinx.html
+doc/sphinx.txt
+doc/sphinx.xml
+contrib
+sphinx.conf.dist
+sphinx-min.conf.dist
diff --git a/debian/sphinxsearch.examples b/debian/sphinxsearch.examples
new file mode 100644
index 0000000..e0c7cdf
--- /dev/null
+++ b/debian/sphinxsearch.examples
@@ -0,0 +1 @@
+api/ruby/tasks/sphinx.rake
-- 
1.6.4.4

>From 9d66343f4ce1789b27357e1b2e2aa722ed9db267 Mon Sep 17 00:00:00 2001
From: Christian Hofstaedtler <[email protected]>
Date: Thu, 31 Dec 2009 23:00:48 +0100
Subject: [PATCH 6/6] add libsphinx-ruby, libsphinxclient, python-sphinxapi

---
 debian/control                       |   72 +++++++++++++++++++++++++++++-
 debian/libsphinx-ruby.install        |    2 +
 debian/libsphinxclient-0.0.1.docs    |    1 +
 debian/libsphinxclient-0.0.1.install |    1 +
 debian/libsphinxclient-dev.install   |    2 +
 debian/patches/00list                |    1 +
 debian/python-sphinxapi.examples     |    2 +
 debian/python-sphinxapi.install      |    1 +
 debian/rules                         |   80 +++++++++++++++++++++++++--------
 debian/sphinxsearch.dirs             |    3 +
 debian/sphinxsearch.install          |    2 +
 11 files changed, 145 insertions(+), 22 deletions(-)
 create mode 100644 debian/libsphinx-ruby.install
 create mode 100644 debian/libsphinxclient-0.0.1.docs
 create mode 100644 debian/libsphinxclient-0.0.1.install
 create mode 100644 debian/libsphinxclient-dev.install
 create mode 100644 debian/python-sphinxapi.examples
 create mode 100644 debian/python-sphinxapi.install
 create mode 100644 debian/sphinxsearch.dirs
 create mode 100644 debian/sphinxsearch.install

diff --git a/debian/control b/debian/control
index 379821e..d3697d8 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: sphinxsearch
 Section: misc
 Priority: optional
 Maintainer: Radu Spineanu <[email protected]>
-Build-Depends: debhelper (>= 7), autotools-dev, gawk, libmysqlclient-dev, 
dpatch, libpq-dev, autoconf, libtool, automake, docbook-to-man
+Build-Depends: debhelper (>= 7), autotools-dev, gawk, libmysqlclient-dev, 
dpatch, libpq-dev, autoconf, libtool, automake, docbook-to-man, python-support 
(>= 0.8.4), graphviz, rdoc
 Standards-Version: 3.8.3
 
 Package: sphinxsearch
@@ -17,4 +17,72 @@ Description: Fast standalone full-text SQL search engine
  mechanism (a pipe to indexer in special XML-based format which Sphinx 
  recognizes).
  .
- Sphinx is an acronym which is officially decoded as SQL Phrase Index. 
+ Sphinx is an acronym which is officially decoded as SQL Phrase Index.
+
+Package: libsphinxclient-0.0.1
+Depends: ${shlibs:Depends}
+Architecture: any
+Description: Fast standalone full-text SQL search engine - Client library
+ Sphinx is a standalone full text search engine, meant to provide fast,
+ size-efficient and relevant fulltext search functions to other applications.
+ Sphinx was specially designed to integrate well with SQL databases and
+ scripting languages. Currently built-in data sources support fetching data
+ either via direct connection to MySQL or PostgreSQL, or using XML pipe
+ mechanism (a pipe to indexer in special XML-based format which Sphinx
+ recognizes).
+ .
+ Sphinx is an acronym which is officially decoded as SQL Phrase Index.
+ .
+ This package contains the client library for C.
+
+Package: libsphinxclient-dev
+Architecture: any
+Section: libdevel
+Depends: libsphinxclient-0.0.1 (= ${binary:Version})
+Description: Fast standalone full-text SQL search engine - Client library
+ Sphinx is a standalone full text search engine, meant to provide fast,
+ size-efficient and relevant fulltext search functions to other applications.
+ Sphinx was specially designed to integrate well with SQL databases and
+ scripting languages. Currently built-in data sources support fetching data
+ either via direct connection to MySQL or PostgreSQL, or using XML pipe
+ mechanism (a pipe to indexer in special XML-based format which Sphinx
+ recognizes).
+ .
+ Sphinx is an acronym which is officially decoded as SQL Phrase Index.
+ .
+ This package contains the client library for C development files.
+
+Package: python-sphinxapi
+Architecture: all
+Section: python
+Depends: ${python:Depends}
+Description: Fast standalone full-text SQL search engine - Client library
+ Sphinx is a standalone full text search engine, meant to provide fast,
+ size-efficient and relevant fulltext search functions to other applications.
+ Sphinx was specially designed to integrate well with SQL databases and
+ scripting languages. Currently built-in data sources support fetching data
+ either via direct connection to MySQL or PostgreSQL, or using XML pipe
+ mechanism (a pipe to indexer in special XML-based format which Sphinx
+ recognizes).
+ .
+ Sphinx is an acronym which is officially decoded as SQL Phrase Index.
+ .
+ This package contains the client library for Python.
+
+Package: libsphinx-ruby
+Architecture: all
+Section: ruby
+Depends: libruby, ruby (>=1.8.7)
+Description: Fast standalone full-text SQL search engine - Client library
+ Sphinx is a standalone full text search engine, meant to provide fast,
+ size-efficient and relevant fulltext search functions to other applications.
+ Sphinx was specially designed to integrate well with SQL databases and
+ scripting languages. Currently built-in data sources support fetching data
+ either via direct connection to MySQL or PostgreSQL, or using XML pipe
+ mechanism (a pipe to indexer in special XML-based format which Sphinx
+ recognizes).
+ .
+ Sphinx is an acronym which is officially decoded as SQL Phrase Index.
+ .
+ This package contains the client library for Ruby.
+
diff --git a/debian/libsphinx-ruby.install b/debian/libsphinx-ruby.install
new file mode 100644
index 0000000..5322067
--- /dev/null
+++ b/debian/libsphinx-ruby.install
@@ -0,0 +1,2 @@
+usr/lib/ruby/*
+usr/share/doc/libsphinx-ruby/rdoc/*
diff --git a/debian/libsphinxclient-0.0.1.docs 
b/debian/libsphinxclient-0.0.1.docs
new file mode 100644
index 0000000..91c23b3
--- /dev/null
+++ b/debian/libsphinxclient-0.0.1.docs
@@ -0,0 +1 @@
+api/libsphinxclient/README
diff --git a/debian/libsphinxclient-0.0.1.install 
b/debian/libsphinxclient-0.0.1.install
new file mode 100644
index 0000000..6ac2169
--- /dev/null
+++ b/debian/libsphinxclient-0.0.1.install
@@ -0,0 +1 @@
+usr/lib/libsphinxclient*.so
diff --git a/debian/libsphinxclient-dev.install 
b/debian/libsphinxclient-dev.install
new file mode 100644
index 0000000..a44b074
--- /dev/null
+++ b/debian/libsphinxclient-dev.install
@@ -0,0 +1,2 @@
+usr/lib/libsphinxclient.a
+usr/include/sphinxclient.h
diff --git a/debian/patches/00list b/debian/patches/00list
index 34c3f18..ce4cf6a 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -1,2 +1,3 @@
 01_Makefile_am.dpatch
 02_sphinx.conf.dpatch
+03_sphinxclient_static_sock_close.dpatch
diff --git a/debian/python-sphinxapi.examples b/debian/python-sphinxapi.examples
new file mode 100644
index 0000000..0f4b640
--- /dev/null
+++ b/debian/python-sphinxapi.examples
@@ -0,0 +1,2 @@
+api/test.py
+api/test2.py
diff --git a/debian/python-sphinxapi.install b/debian/python-sphinxapi.install
new file mode 100644
index 0000000..8b1740b
--- /dev/null
+++ b/debian/python-sphinxapi.install
@@ -0,0 +1 @@
+usr/lib/python2.5/site-packages/*
diff --git a/debian/rules b/debian/rules
index 8f0f304..2eee2f3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,6 +32,8 @@ config.status: configure
        # Add here commands to configure the package.
        ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) 
--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 
--localstatedir=/var/lib/sphinxsearch --sysconfdir=/etc/sphinxsearch 
--with-pgsql CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
 
+       cd api/libsphinxclient && ./configure --host=$(DEB_HOST_GNU_TYPE) 
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info --localstatedir=/var/lib/sphinxsearch 
--sysconfdir=/etc/sphinxsearch CFLAGS="$(CFLAGS)"
+
 build: patch build-stamp
 
 build-stamp:  config.status
@@ -48,11 +50,15 @@ clean1:
        rm -f build-stamp 
 
        [ ! -f Makefile ] || $(MAKE) distclean
+       [ ! -f api/libsphinxclient/Makefile ] || $(MAKE) -C api/libsphinxclient 
distclean
+
 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
        cp -f /usr/share/misc/config.sub config.sub
+       cp -f /usr/share/misc/config.sub api/libsphinxclient/config.sub
 endif
 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
        cp -f /usr/share/misc/config.guess config.guess
+       cp -f /usr/share/misc/config.guess api/libsphinxclient/config.guess
 endif
 
        rm -f indexer.1 searchd.1
@@ -73,34 +79,68 @@ install: build
        rm $(CURDIR)/debian/tmp/etc/sphinxsearch/sphinx.conf.dist
        install -m0600 debian/sphinx.conf 
$(CURDIR)/debian/tmp/etc/sphinxsearch/sphinx.conf
 
+       # apis
+       cd api/libsphinxclient && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+       install -d $(CURDIR)/debian/tmp/usr/lib/python2.5/site-packages
+       install -m0644 api/sphinxapi.py 
$(CURDIR)/debian/tmp/usr/lib/python2.5/site-packages
+       install -d $(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby
+       install -d $(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/sphinx
+       install -m0644 api/ruby/lib/sphinx.rb 
$(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/
+       install -m0644 api/ruby/lib/sphinx/client.rb 
$(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/sphinx/
+       install -m0644 api/ruby/lib/sphinx/request.rb 
$(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/sphinx/
+       install -m0644 api/ruby/lib/sphinx/response.rb 
$(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/sphinx/
+       install -d $(CURDIR)/debian/tmp/usr/share/doc/libsphinx-ruby
+       cd api/ruby && rdoc --all --inline-source --diagram --fileboxes 
--line-numbers --fmt=html -o 
$(CURDIR)/debian/tmp/usr/share/doc/libsphinx-ruby/rdoc
+
 
 # Build architecture-independent files here.
 binary-indep: build install
-# We have nothing to do by default.
+       dh_testdir
+       dh_testroot
+       #dh_rdoc -plibsphinx-ruby api/ruby
+       dh_installdirs -ppython-sphinxapi -plibsphinx-ruby
+       dh_installchangelogs -ppython-sphinxapi -plibsphinx-ruby
+       dh_installdocs -ppython-sphinxapi -plibsphinx-ruby
+       dh_installexamples -ppython-sphinxapi -plibsphinx-ruby
+       dh_install -ppython-sphinxapi -plibsphinx-ruby -a --sourcedir=debian/tmp
+       dh_installcron -ppython-sphinxapi -plibsphinx-ruby
+       dh_installdebconf -ppython-sphinxapi -plibsphinx-ruby
+       dh_installinit -ppython-sphinxapi -plibsphinx-ruby
+       dh_installman -ppython-sphinxapi -plibsphinx-ruby
+       dh_link -ppython-sphinxapi -plibsphinx-ruby
+       dh_strip -ppython-sphinxapi -plibsphinx-ruby
+       dh_compress -ppython-sphinxapi -plibsphinx-ruby
+       dh_fixperms -ppython-sphinxapi -plibsphinx-ruby
+       dh_makeshlibs -ppython-sphinxapi -plibsphinx-ruby
+       dh_installdeb -ppython-sphinxapi -plibsphinx-ruby
+       dh_shlibdeps -ppython-sphinxapi -plibsphinx-ruby
+       dh_gencontrol -ppython-sphinxapi -plibsphinx-ruby
+       dh_md5sums -ppython-sphinxapi -plibsphinx-ruby
+       dh_builddeb -ppython-sphinxapi -plibsphinx-ruby
 
 # Build architecture-dependent files here.
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installdirs
-       dh_installchangelogs
-       dh_installdocs
-       dh_installexamples
-       dh_install
-       dh_installcron
-       dh_installdebconf       
-       dh_installinit
-       dh_installman
-       dh_link
-       dh_strip
-       dh_compress
-       dh_fixperms
-       dh_makeshlibs 
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
+       dh_installdirs -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installchangelogs -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installdocs -a -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installexamples -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_install -Npython-sphinxapi -Nlibsphinx-ruby -a --sourcedir=debian/tmp
+       dh_installcron -a -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installdebconf -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installinit -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installman -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_link -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_strip -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_compress -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_fixperms -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_makeshlibs -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_installdeb -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_shlibdeps -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_gencontrol -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_md5sums -Npython-sphinxapi -Nlibsphinx-ruby
+       dh_builddeb -Npython-sphinxapi -Nlibsphinx-ruby
 
 binary: binary-indep binary-arch
 .PHONY: build clean binary-indep binary-arch binary install patch unpatch
diff --git a/debian/sphinxsearch.dirs b/debian/sphinxsearch.dirs
new file mode 100644
index 0000000..1bff8c9
--- /dev/null
+++ b/debian/sphinxsearch.dirs
@@ -0,0 +1,3 @@
+usr/bin
+var/log/sphinxsearch
+var/lib/sphinxsearch/data
diff --git a/debian/sphinxsearch.install b/debian/sphinxsearch.install
new file mode 100644
index 0000000..a782cad
--- /dev/null
+++ b/debian/sphinxsearch.install
@@ -0,0 +1,2 @@
+usr/bin/*
+etc/sphinxsearch/*
-- 
1.6.4.4


--- End Message ---
--- Begin Message ---
Given nothing happened in a long time, let's close this.

-- 
 ,''`.  Christian Hofstaedtler <[email protected]>
: :' :  Debian Developer
`. `'   7D1A CFFA D9E0 806C 9C4C  D392 5C13 D6DB 9305 2E03
  `-

--- End Message ---

Reply via email to