1 %global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
2 %global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined")
3 %global php_version %(php-config --version 2>/dev/null || echo 0)
5 # do not add php module to provides, it is no regular library
7 %filter_provides_in %{php_extdir}/.*\.so$
11 Summary: Web indexing and search system for a small domain or intranet
16 Group: Applications/Internet
17 URL: http://www.mnogosearch.org/
19 # md5sum 906d5e1e21ba00024574f57548d32029
20 Source0: http://www.mnogosearch.org/Download/mnogosearch-%{version}.tar.gz
22 Source1: mnogosearch-reindex
23 Source2: mnogosearch.crond
26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
28 Requires: %{name}-libs = %{version}-%{release}
29 Requires: /usr/bin/wvHtml
30 Requires: /usr/bin/xlhtml
31 Requires: /usr/bin/ppthtml
32 Requires: /usr/bin/pdftotext
33 Requires(pre): shadow-utils
35 # user "apache" is added to mnogosearch group so we need the user to be present
38 BuildRequires: autoconf
39 BuildRequires: automake
40 BuildRequires: libtool
41 BuildRequires: openssl-devel
42 BuildRequires: zlib-devel
43 BuildRequires: expat-devel
44 BuildRequires: openssl-devel
45 BuildRequires: openjade
46 BuildRequires: docbook-utils
47 BuildRequires: mysql-devel
48 BuildRequires: readline-devel
49 BuildRequires: ncurses-devel
50 BuildRequires: sqlite-devel
51 BuildRequires: unixODBC-devel
52 BuildRequires: postgresql-devel
53 BuildRequires: freetds-devel
54 BuildRequires: firebird-devel
58 # build is done with unit testing by default, but it can be disabled
59 # by --without tests to save time
60 %define with_tests %{?_without_tests: 0} %{?!_without_tests: 1}
63 mnoGoSearch (formerly known as UdmSearch) is a full-featured Web search engine
64 that you can use to build search engines over HTTP, HTTPS, FTP, and NTTP
65 servers, local files, and database big text fields. It supports Oracle, MS SQL
66 Server, MySQL, PostgreSQL, InterBase/Firebird, Openlink Virtuoso, Intersystems
67 Cach, iODBC, EasySoft ODBC, and unixODBC database backends. It has XML, HTML,
68 and TEXT built-in support, and external converters support for other document
69 types. An automatic language/charset guesser for more 70 language/charset
70 combinations is included, along with basic authorization support, and you may
71 index password-protected intranet HTTP servers with proxy authorization
74 mnoGoSearch is built with support for mysql (including fulltext extension),
75 sqlite, postgresql, firebird, unixODBC and freetds.
78 Summary: Libraries for %{name}
79 Group: System Environment/Libraries
82 This package contains the %{name} library files.
85 Summary: Development headers and libraries for %{name}
86 Group: Development/Libraries
87 Requires: %{name} = %{version}-%{release}
90 This package contains the %{name} development files.
93 Summary: PHP-extension for %{name}
94 Group: Applications/Internet
95 Requires: %{name}-libs = %{version}-%{release}
96 BuildRequires: php-devel
97 BuildRequires: php-cli
100 Requires: php(zend-abi) = %{php_zend_api}
101 Requires: php(api) = %{php_core_api}
103 Requires: php-api = %{php_apiver}
107 This package contains the PHP extension for %{name}
110 %setup -q -n mnogosearch-%{version}
116 --sysconfdir=%{_sysconfdir}/mnogosearch \
117 --datadir=%{_datadir}/mnogosearch \
118 --localstatedir=%{_localstatedir}/lib/mnogosearch \
119 --includedir=%{_includedir}/mnogosearch \
121 --enable-syslog=LOG_LOCAL6 \
128 --with-openssl=%{_prefix} \
131 --with-extra-charsets=all \
133 --enable-mysql-fulltext-plugin \
137 --with-freetds=%{_prefix} \
148 DESTDIR=$RPM_BUILD_ROOT \
149 doc_FILES='$(HTML_ALL)'
151 # no need to call the config files *-dist
152 (cd %{buildroot}%{_sysconfdir}/%{name}
154 mv -f $f `basename $f -dist`
158 # fix header of config file
159 sed -i 's|/usr/local/mnogosearch/sbin/indexer|%{_bindir}/indexer|g' \
160 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
162 # change default configuration
163 sed -i 's|DBAddr.mysql://root@localhost/test/?dbmode=blob|DBAddr sqlite3://localhost/%{_localstatedir}/lib/mnogosearch/default.db/?dbmode=blob|g' \
164 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf \
165 %{buildroot}%{_sysconfdir}/mnogosearch/search.htm \
167 sed -i 's|#LocalCharset UTF-8|LocalCharset UTF-8|g' \
168 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
170 sed -i 's|#Server http://localhost/|Server http://localhost/|g' \
171 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
173 # enable common external document helpers by default
174 # we require them so they will be installed
176 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' \
177 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
179 sed -i 's|#Mime application/pdf text/plain "pdftotext $1 -"|Mime application/pdf text/plain "pdftotext $1 -"|g' \
180 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
182 sed -i 's|#Mime application/vnd.ms-excel text/html "xlhtml $1"|Mime application/vnd.ms-excel text/html "xlhtml $1"|g' \
183 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
185 sed -i 's|#Mime application/vnd.ms-powerpoint text/html "ppthtml $1"|Mime application/vnd.ms-powerpoint text/html "ppthtml $1"|g' \
186 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
188 sed -i 's|Disallow \*.tex \*.texi \*.xls \*.doc \*.texinfo|Disallow *.tex *.texi *.texinfo|g' \
189 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
191 sed -i 's|Disallow \*.rtf \*.pdf \*.cdf \*.ps|Disallow *.rtf *.cdf *.ps|g' \
192 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
194 sed -i 's|Disallow \*.ai \*.eps \*.ppt \*.hqx|Disallow *.ai *.eps *.hqx|g' \
195 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
197 # the cgi is no regular binary, move it to libexec
198 install -d %{buildroot}%{_libexecdir}/mnogosearch
199 mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}%{_libexecdir}/mnogosearch/
201 # the .la's confuse libtool when building the php lib and they should not
202 # be packaged at all, so remove them
203 rm -f %{buildroot}%{_libdir}/*.la
205 install -m0755 %{SOURCE1} %{buildroot}%{_bindir}/
207 install -d %{buildroot}%{_sysconfdir}/cron.d/
208 install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.d/mnogosearch
210 install -d %{buildroot}%{_sysconfdir}/httpd/conf.d/
211 install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/mnogosearch.conf
214 # ---------------------
215 # make & install php stuff
216 # must be in install-section because it needs an already installed mnogosearch
220 %configure --with-mnogosearch=%{buildroot}%{_prefix}
223 sed -i 's|-Wl,-rpath,[^ ]*||g' Makefile
225 make %{?_smp_mflags} EXTRA_LDFLAGS="-L%{buildroot}%{_libdir}" EXTRA_CFLAGS="-I%{buildroot}%{_includedir}/mnogosearch"
227 INSTALL_ROOT=$RPM_BUILD_ROOT
230 install -d %{buildroot}%{_sysconfdir}/php.d
231 cat >%{buildroot}%{_sysconfdir}/php.d/mnogosearch.ini <<EOF
232 ; Enable mnogosearch extension module
233 extension=mnogosearch.so
237 # ---------------------
240 install -d %{buildroot}%{_localstatedir}/lib/mnogosearch
243 rm -rf html; mkdir -p html
244 cp -p doc/*.html html/
245 rm -rf %{buildroot}/usr/doc
249 # run unit tests with sqlite backend
250 touch ./msearch-test/sqlite.db
251 export UDM_TEST_DBADDR=sqlite3://`pwd`/msearch-test/sqlite.db/,sqlite3://`pwd`/msearch-test/sqlite2.db/
259 # create mnogosearch user and group
260 getent group mnogosearch >/dev/null || groupadd -r mnogosearch
261 getent passwd mnogosearch >/dev/null || \
262 useradd -r -g mnogosearch -d %{_localstatedir}/lib/mnogosearch \
263 -c "User the indexer of the mnoGoSearch search engine is executed with" \
264 -s /sbin/nologin mnogosearch
268 # the cgi (executed with the apache user) must be able to read the database:
269 # the apache user must be in the mnogosearch group
270 usermod -a -G mnogosearch apache || :
272 # we brought our own apache config snippet and new group rights
273 service httpd condrestart > /dev/null 2>&1 || :
275 # create default mnogosearch database (only during install)
276 if [ $1 -eq 1 ] ; then
277 /usr/bin/indexer --create >/dev/null
278 chown mnogosearch:mnogosearch %{_localstatedir}/lib/mnogosearch/default.db
279 # db must be group writeable to allow query tracking
280 chmod 0660 %{_localstatedir}/lib/mnogosearch/default.db
284 service httpd condrestart > /dev/null 2>&1 || :
286 %post libs -p /sbin/ldconfig
288 %postun libs -p /sbin/ldconfig
291 %defattr(-,root,root,-)
295 %{_bindir}/mnogosearch-reindex
296 %dir %{_libexecdir}/mnogosearch
297 %{_libexecdir}/mnogosearch/search.cgi
298 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cron.d/mnogosearch
299 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/mnogosearch.conf
301 %defattr (0644,root,root,0755)
302 %doc ChangeLog README README.XML README.CVS TODO COPYING AUTHORS INSTALL NEWS FAQ html doc/samples
304 %{_datadir}/mnogosearch
306 # the config files of mnogosearch often contain database passwords -> should not be world readable
307 %defattr (0640,root,mnogosearch,0750)
308 %dir %{_sysconfdir}/mnogosearch
310 # indexer.conf is executable: has a correct shebang to run the indexer with this configuration
311 %attr(0755,root,mnogosearch) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/indexer.conf
312 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/langmap.conf
313 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/stopwords.conf
314 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/search.htm
315 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/node.xml
317 # default dir for search databases should not be world-readable:
318 # the search engine could have indexed secret files
319 %attr (0750,mnogosearch,mnogosearch) %dir %{_localstatedir}/lib/mnogosearch
322 %defattr(-,root,root,-)
326 %defattr(-,root,root,-)
327 %{_bindir}/udm-config
328 %{_includedir}/mnogosearch
330 %{_libdir}/libmnogosearch.so
331 %{_libdir}/libmnogocharset.so
334 %defattr(-,root,root,-)
335 %{_sysconfdir}/php.d/mnogosearch.ini
339 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-2
340 - last minute-changes in the 3.3.11 release
341 - enable some external document helpers by default:
342 we always have them because of requires
343 - require the binaries of the helpers used, not the package names
344 - use wvHtml instead of catdoc by default: it retains formatting
345 - don't disable the file types we now have helpers for
347 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-1
349 - unit testing with two databases
350 - require catdoc and xlhtml for install and during build
351 - move make check into check-section
352 - fix timezone issue with test-blob unit test
354 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-7.20110127cvs
355 - new cvs version with fix for directory names
356 - fix commandline options in mnogosearch-reindex
358 * Wed Jan 26 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-6.20110126cvs
359 - import new upstream fixes for issues found during packaging
360 - group writeable default.db
361 - reindex option improvements by Alexander Barkov
362 - only create db on install
363 - create databases not with sqlite, but with the --create option of indexer
365 * Tue Jan 25 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-5.20110124cvs
366 - update cvs version to get lib64 fix
367 - don't package *.la files as per Fedora review policy
368 - filter php module from provides
369 - create mnogosearch user and group during installation
370 - tighten file permissions to protect passwords and data
371 - create default configuration suitable for Fedora
373 * Fri Jan 21 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-4.20110121cvs
374 - don't rename udm-config anymore
375 - better differentiation between release and cvs snapshots
376 - don't use $RPM_BUILD_DIR anymore
378 * Thu Jan 20 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-3.20110120cvs
379 - make use of the new fhs configure option
380 - move language files to /usr/share
381 - move cgi to /usr/libexec
382 - clean up unneeded stuff left over from Mandriva
383 - link firebird database
384 - run supplied unit tests after build
386 * Mon Jan 17 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-2.20110117cvs
387 - use current CVS as there are/will be some patches making packaging more easy
389 * Thu Jan 13 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-1
390 - add building of the php module
391 - initial packaging for Fedora
392 - based on the Mandriva .spec by Oden Eriksson