- include upstream-patch to make adapting the config more easy
authorGerd von Egidy <gerd.von.egidy@intra2net.com>
Mon, 31 Jan 2011 10:27:28 +0000 (11:27 +0100)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Mon, 31 Jan 2011 10:27:28 +0000 (11:27 +0100)
- add unrtf to default config and requires
- modifying the default configuration now done with a patch

mnogosearch-3.3.11-prepare-config.patch [new file with mode: 0644]
mnogosearch-distconfig.patch [new file with mode: 0644]
mnogosearch.spec

diff --git a/mnogosearch-3.3.11-prepare-config.patch b/mnogosearch-3.3.11-prepare-config.patch
new file mode 100644 (file)
index 0000000..f2d31f9
--- /dev/null
@@ -0,0 +1,55 @@
+commit 88ae39c72f464ce81b8eeea55bffc585807197be
+Author: bar <bar>
+Date:   Fri Jan 28 17:39:36 2011 +0000
+
+    - Moving Disallow commands for doc, pdf, ppt, xls, rtf
+      on separate lines, to uncomment easier.
+    - Adding unrtf
+
+diff --git a/etc/indexer.conf-dist b/etc/indexer.conf-dist
+index 798f0f7..a8eb757 100644
+--- a/etc/indexer.conf-dist
++++ b/etc/indexer.conf-dist
+@@ -308,6 +308,13 @@ DBAddr    mysql://root@localhost/test/?dbmode=blob
+ # special meaning in "string" match, so we have to use "regex" match here:
+ #Disallow Regex  \?
++# Disallow document extensions that are not understood by default.
++# Comment these lines if you have corresponding external parsers.
++Disallow *.rtf
++Disallow *.doc
++Disallow *.xls
++Disallow *.ppt
++Disallow *.pdf
+ # Exclude some known extensions using fast "String" match:
+ Disallow *.b    *.sh   *.md5  *.rpm
+@@ -318,9 +325,9 @@ Disallow *.vdo  *.mpeg *.mpe  *.mpg  *.avi  *.movie *.mov  *.wmv
+ Disallow *.mid  *.mp3  *.rm   *.ram  *.wav  *.aiff  *.ra
+ Disallow *.vrml *.wrl  *.png  *.ico  *.psd  *.dat
+ Disallow *.exe  *.com  *.cab  *.dll  *.bin  *.class *.ex_
+-Disallow *.tex  *.texi *.xls  *.doc  *.texinfo
+-Disallow *.rtf  *.pdf  *.cdf  *.ps
+-Disallow *.ai   *.eps  *.ppt  *.hqx
++Disallow *.tex  *.texi *.texinfo
++Disallow *.cdf  *.ps
++Disallow *.ai   *.eps  *.hqx
+ Disallow *.cpt  *.bms  *.oda  *.tcl
+ Disallow *.o    *.a    *.la   *.so 
+ Disallow *.pat  *.pm   *.m4   *.am   *.css
+@@ -484,6 +491,7 @@ AddType text/rtf                   *.rtf
+ AddType application/pdf                       *.pdf
+ AddType application/msword            *.doc
+ AddType application/vnd.ms-excel      *.xls
++AddType application/vnd.ms-powerpoint *.ppt
+ AddType text/x-postscript             *.ps
+@@ -531,6 +539,7 @@ AddType    application/unknown *.*
+ #Mime application/vnd.ms-excel text/html                  "xlhtml $1"
+ #Mime "text/rtf*"              text/html                  "rthc --use-stdout $1 2>/dev/null"
+ #Mime "text/rtf*"              text/xml                   "rtfx -w $1 2>/dev/null"
++#Mime "text/rtf*"              text/html                  "unrtf --html $1"
+ #Mime application/vnd.ms-powerpoint "text/html; charset=utf-8" "pptohtml $1"
+ #Mime application/vnd.ms-powerpoint text/html             "ppthtml $1"
diff --git a/mnogosearch-distconfig.patch b/mnogosearch-distconfig.patch
new file mode 100644 (file)
index 0000000..a35443a
--- /dev/null
@@ -0,0 +1,116 @@
+diff -r -u mnogosearch-3.3.11.orig/etc/indexer.conf-dist mnogosearch-3.3.11/etc/indexer.conf-dist
+--- mnogosearch-3.3.11.orig/etc/indexer.conf-dist      2011-01-31 11:06:27.000000000 +0100
++++ mnogosearch-3.3.11/etc/indexer.conf-dist   2011-01-31 11:15:30.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/mnogosearch/sbin/indexer -d
++#!/usr/bin/indexer -d
+ ###########################################################################
+ # This is a sample indexer config file.
+@@ -49,7 +49,7 @@
+ # then PostgreSQL will not work via TCP, but will use Unix socket.
+ #
+-DBAddr        mysql://root@localhost/test/?dbmode=blob
++DBAddr sqlite3://localhost/var/lib/mnogosearch/default.db/?dbmode=blob
+@@ -139,7 +139,7 @@
+ #LocalCharset Shift-JIS
+ # Full UNICODE
+-#LocalCharset UTF-8
++LocalCharset UTF-8
+ #######################################################################
+ #ForceIISCharset1251 yes/no
+@@ -169,7 +169,7 @@
+ #
+ #StopwordFile stopwords/en.sl
+-#Include stopwords.conf
++Include stopwords.conf
+ ###########################################################################
+@@ -180,7 +180,7 @@
+ #
+ #LangMapFile langmap/en.ascii.lm
+-#Include langmap.conf
++Include langmap.conf
+ #######################################################################
+@@ -310,11 +310,11 @@
+ # Disallow document extensions that are not understood by default.
+ # Comment these lines if you have corresponding external parsers.
+-Disallow *.rtf
+-Disallow *.doc
+-Disallow *.xls
+-Disallow *.ppt
+-Disallow *.pdf
++#Disallow *.rtf
++#Disallow *.doc
++#Disallow *.xls
++#Disallow *.ppt
++#Disallow *.pdf
+ # Exclude some known extensions using fast "String" match:
+ Disallow *.b    *.sh   *.md5  *.rpm
+@@ -531,16 +531,16 @@
+ #       from_mime                to_mime[charset]             [command line [$1]]
+ #
+ #Mime application/msword      "text/plain; charset=utf-8" "catdoc -a -dutf-8 $1"
+-#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 -"
+ #Mime application/x-troff-man  text/plain                 "deroff"
+ #Mime text/x-postscript        text/plain                 "ps2ascii"
+-#Mime application/pdf          text/plain                 "pdftotext $1 -"
++Mime application/pdf          "text/plain; charset=utf-8" "pdftotext $1 -"
+ #Mime application/vnd.ms-excel text/plain                 "xls2csv $1"
+-#Mime application/vnd.ms-excel text/html                  "xlhtml $1"
++Mime application/vnd.ms-excel "text/html; charset=utf-8"  "xlhtml $1"
+ #Mime "text/rtf*"              text/html                  "rthc --use-stdout $1 2>/dev/null"
+ #Mime "text/rtf*"              text/xml                   "rtfx -w $1 2>/dev/null"
+-#Mime "text/rtf*"              text/html                  "unrtf --html $1"
+-#Mime application/vnd.ms-powerpoint "text/html; charset=utf-8" "pptohtml $1"
++Mime "text/rtf*"              "text/html; charset=utf-8"  "unrtf --html $1"
++Mime application/vnd.ms-powerpoint "text/html; charset=utf-8" "ppthtml $1"
+ #Mime application/vnd.ms-powerpoint text/html             "ppthtml $1"
+@@ -975,7 +975,7 @@
+ # Default value is "path".
+ #
+ # To index whole server "localhost":
+-#Server http://localhost/
++Server http://localhost/
+ #
+ # You can also specify some path to index subdirectory only:
+ #Server http://localhost/subdir/
+diff -r -u mnogosearch-3.3.11.orig/etc/search.htm-dist mnogosearch-3.3.11/etc/search.htm-dist
+--- mnogosearch-3.3.11.orig/etc/search.htm-dist        2011-01-27 16:10:07.000000000 +0100
++++ mnogosearch-3.3.11/etc/search.htm-dist     2011-01-31 11:17:04.000000000 +0100
+@@ -13,7 +13,7 @@
+ <!--variables
+ # Database parameters
+ # Format: <DBType>:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/[?dbmode=mode]
+-DBAddr        mysql://root@localhost/test/?dbmode=blob
++DBAddr sqlite3://localhost/var/lib/mnogosearch/default.db/?dbmode=blob
+ # Uncomment this line to enable search result cache
+ #Cache yes
+@@ -25,8 +25,8 @@
+ # Default charset is iso-8859-1 (latin1)
+ # which is suitable for the most Western European languages
+-LocalCharset   iso-8859-1
+-BrowserCharset iso-8859-1
++LocalCharset   utf-8
++BrowserCharset utf-8
+ # Load stopwords file.  File name is either absolute
+ # or relative to /etc directory of mnoGoSearch installation.
index 3e64967..fc5b99d 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:        3
 License:        GPLv2+
 Group:          Applications/Internet
 URL:            http://www.mnogosearch.org/
@@ -23,6 +23,13 @@ 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}
@@ -30,6 +37,7 @@ Requires:       /usr/bin/wvHtml
 Requires:       /usr/bin/xlhtml
 Requires:       /usr/bin/ppthtml
 Requires:       /usr/bin/pdftotext
+Requires:       /usr/bin/unrtf
 Requires(pre):  shadow-utils
 
 # user "apache" is added to mnogosearch group so we need the user to be present
@@ -109,6 +117,9 @@ This package contains the PHP extension for %{name}
 %prep
 %setup -q -n mnogosearch-%{version}
 
+%patch0 -p1
+%patch1 -p1
+
 %build
 autoreconf -fi
 
@@ -155,45 +166,6 @@ 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
-
 # the cgi is no regular binary, move it to libexec
 install -d %{buildroot}%{_libexecdir}/mnogosearch
 mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}%{_libexecdir}/mnogosearch/
@@ -336,6 +308,11 @@ service httpd condrestart > /dev/null 2>&1 || :
 %{php_extdir}
 
 %changelog
+* 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
+
 * 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: