new srpm, built with rpmbuild-md5
[mnogosearch-rpm] / mnogosearch.spec
index 3e64967..728a785 100644 (file)
@@ -11,7 +11,7 @@
 Summary:        Web indexing and search system for a small domain or intranet
 Name:           mnogosearch
 Version:        3.3.11
-Release:        2
+Release:        5%{?dist}
 License:        GPLv2+
 Group:          Applications/Internet
 URL:            http://www.mnogosearch.org/
@@ -23,13 +23,26 @@ Source1:        mnogosearch-reindex
 Source2:        mnogosearch.crond
 Source3:        httpd.conf
 
+# makes adapting the configuration more easy, taken from upstream cvs
+Patch0:         mnogosearch-3.3.11-prepare-config.patch
+
+# modify the default configuration suitable for our distribution
+# distribution-specific, not upstream
+Patch1:         mnogosearch-distconfig.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:       %{name}-libs = %{version}-%{release}
 Requires:       /usr/bin/wvHtml
+Requires:       /usr/bin/pdftohtml
+
+%if !0%{?rhel}
+# these are currently not available on RHEL/EPEL
 Requires:       /usr/bin/xlhtml
 Requires:       /usr/bin/ppthtml
-Requires:       /usr/bin/pdftotext
+Requires:       /usr/bin/unrtf
+%endif
+
 Requires(pre):  shadow-utils
 
 # user "apache" is added to mnogosearch group so we need the user to be present
@@ -53,7 +66,10 @@ BuildRequires:  postgresql-devel
 BuildRequires:  freetds-devel
 BuildRequires:  firebird-devel
 BuildRequires:  catdoc
+
+%if !0%{?rhel}
 BuildRequires:  xlhtml
+%endif
 
 # build is done with unit testing by default, but it can be disabled
 # by --without tests to save time
@@ -109,6 +125,9 @@ This package contains the PHP extension for %{name}
 %prep
 %setup -q -n mnogosearch-%{version}
 
+%patch0 -p1
+%patch1 -p1
+
 %build
 autoreconf -fi
 
@@ -130,7 +149,9 @@ autoreconf -fi
     --with-readline \
     --with-extra-charsets=all \
     --with-mysql \
+%if !0%{?rhel}
     --enable-mysql-fulltext-plugin \
+%endif
     --with-pgsql \
     --with-sqlite3 \
     --with-unixODBC \
@@ -155,44 +176,12 @@ for f in *-dist ; do
 done
 )
 
-# fix header of config file
-sed -i 's|/usr/local/mnogosearch/sbin/indexer|%{_bindir}/indexer|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-# change default configuration
-sed -i 's|DBAddr.mysql://root@localhost/test/?dbmode=blob|DBAddr sqlite3://localhost/%{_localstatedir}/lib/mnogosearch/default.db/?dbmode=blob|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf \
-    %{buildroot}%{_sysconfdir}/mnogosearch/search.htm \
-
-sed -i 's|#LocalCharset UTF-8|LocalCharset UTF-8|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|#Server http://localhost/|Server http://localhost/|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-# enable common external document helpers by default
-# we require them so they will be installed
-
-sed -i 's|#Mime application/msword      "text/html; charset=utf-8"  "wvHtml --charset=utf-8 $1 -"|Mime application/msword      "text/html; charset=utf-8"  "wvHtml --charset=utf-8 $1 -"|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|#Mime application/pdf          text/plain                 "pdftotext $1 -"|Mime application/pdf          text/plain                 "pdftotext $1 -"|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|#Mime application/vnd.ms-excel text/html                  "xlhtml $1"|Mime application/vnd.ms-excel text/html                  "xlhtml $1"|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|#Mime application/vnd.ms-powerpoint text/html             "ppthtml $1"|Mime application/vnd.ms-powerpoint text/html             "ppthtml $1"|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|Disallow \*.tex  \*.texi \*.xls  \*.doc  \*.texinfo|Disallow *.tex *.texi *.texinfo|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|Disallow \*.rtf  \*.pdf  \*.cdf  \*.ps|Disallow *.rtf  *.cdf  *.ps|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
-
-sed -i 's|Disallow \*.ai   \*.eps  \*.ppt  \*.hqx|Disallow *.ai   *.eps  *.hqx|g' \
-    %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
+%if 0%{?rhel}
+# comment out the converters not available on RHEL/EPEL
+sed -i 's|^\(.*xlhtml.*\)$|#\1|g' %{buildroot}%{_sysconfdir}/%{name}/indexer.conf
+sed -i 's|^\(.*ppthtml.*\)$|#\1|g' %{buildroot}%{_sysconfdir}/%{name}/indexer.conf
+sed -i 's|^\(.*unrtf.*\)$|#\1|g' %{buildroot}%{_sysconfdir}/%{name}/indexer.conf
+%endif
 
 # the cgi is no regular binary, move it to libexec
 install -d %{buildroot}%{_libexecdir}/mnogosearch
@@ -336,6 +325,22 @@ service httpd condrestart > /dev/null 2>&1 || :
 %{php_extdir}
 
 %changelog
+* Mon Feb 1 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-5
+- add dist-tag to the release
+- add conditionals to allow building on RHEL 5 too
+
+* Mon Feb 1 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-4
+- don't use stopwords by default anymore
+- switch from pdftotext to pdftohtml
+- explicit charset not needed for all converters
+
+* Mon Jan 31 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-3
+- include upstream-patch to make adapting the config more easy
+- add unrtf to default config and requires
+- modifying the default configuration now done with a patch
+- utf-8 now used in search template too
+- include langmap and stopwords in search template too
+
 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-2
 - last minute-changes in the 3.3.11 release
 - enable some external document helpers by default: