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 # makes adapting the configuration more easy, taken from upstream cvs
27 Patch0: mnogosearch-3.3.11-prepare-config.patch
29 # modify the default configuration suitable for our distribution
30 # distribution-specific, not upstream
31 Patch1: mnogosearch-distconfig.patch
33 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
35 Requires: %{name}-libs = %{version}-%{release}
36 Requires: /usr/bin/wvHtml
37 Requires: /usr/bin/xlhtml
38 Requires: /usr/bin/ppthtml
39 Requires: /usr/bin/pdftohtml
40 Requires: /usr/bin/unrtf
41 Requires(pre): shadow-utils
43 # user "apache" is added to mnogosearch group so we need the user to be present
46 BuildRequires: autoconf
47 BuildRequires: automake
48 BuildRequires: libtool
49 BuildRequires: openssl-devel
50 BuildRequires: zlib-devel
51 BuildRequires: expat-devel
52 BuildRequires: openssl-devel
53 BuildRequires: openjade
54 BuildRequires: docbook-utils
55 BuildRequires: mysql-devel
56 BuildRequires: readline-devel
57 BuildRequires: ncurses-devel
58 BuildRequires: sqlite-devel
59 BuildRequires: unixODBC-devel
60 BuildRequires: postgresql-devel
61 BuildRequires: freetds-devel
62 BuildRequires: firebird-devel
66 # build is done with unit testing by default, but it can be disabled
67 # by --without tests to save time
68 %define with_tests %{?_without_tests: 0} %{?!_without_tests: 1}
71 mnoGoSearch (formerly known as UdmSearch) is a full-featured Web search engine
72 that you can use to build search engines over HTTP, HTTPS, FTP, and NTTP
73 servers, local files, and database big text fields. It supports Oracle, MS SQL
74 Server, MySQL, PostgreSQL, InterBase/Firebird, Openlink Virtuoso, Intersystems
75 Cach, iODBC, EasySoft ODBC, and unixODBC database backends. It has XML, HTML,
76 and TEXT built-in support, and external converters support for other document
77 types. An automatic language/charset guesser for more 70 language/charset
78 combinations is included, along with basic authorization support, and you may
79 index password-protected intranet HTTP servers with proxy authorization
82 mnoGoSearch is built with support for mysql (including fulltext extension),
83 sqlite, postgresql, firebird, unixODBC and freetds.
86 Summary: Libraries for %{name}
87 Group: System Environment/Libraries
90 This package contains the %{name} library files.
93 Summary: Development headers and libraries for %{name}
94 Group: Development/Libraries
95 Requires: %{name} = %{version}-%{release}
98 This package contains the %{name} development files.
101 Summary: PHP-extension for %{name}
102 Group: Applications/Internet
103 Requires: %{name}-libs = %{version}-%{release}
104 BuildRequires: php-devel
105 BuildRequires: php-cli
107 %if 0%{?php_zend_api}
108 Requires: php(zend-abi) = %{php_zend_api}
109 Requires: php(api) = %{php_core_api}
111 Requires: php-api = %{php_apiver}
115 This package contains the PHP extension for %{name}
118 %setup -q -n mnogosearch-%{version}
127 --sysconfdir=%{_sysconfdir}/mnogosearch \
128 --datadir=%{_datadir}/mnogosearch \
129 --localstatedir=%{_localstatedir}/lib/mnogosearch \
130 --includedir=%{_includedir}/mnogosearch \
132 --enable-syslog=LOG_LOCAL6 \
139 --with-openssl=%{_prefix} \
142 --with-extra-charsets=all \
144 --enable-mysql-fulltext-plugin \
148 --with-freetds=%{_prefix} \
159 DESTDIR=$RPM_BUILD_ROOT \
160 doc_FILES='$(HTML_ALL)'
162 # no need to call the config files *-dist
163 (cd %{buildroot}%{_sysconfdir}/%{name}
165 mv -f $f `basename $f -dist`
169 # the cgi is no regular binary, move it to libexec
170 install -d %{buildroot}%{_libexecdir}/mnogosearch
171 mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}%{_libexecdir}/mnogosearch/
173 # the .la's confuse libtool when building the php lib and they should not
174 # be packaged at all, so remove them
175 rm -f %{buildroot}%{_libdir}/*.la
177 install -m0755 %{SOURCE1} %{buildroot}%{_bindir}/
179 install -d %{buildroot}%{_sysconfdir}/cron.d/
180 install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.d/mnogosearch
182 install -d %{buildroot}%{_sysconfdir}/httpd/conf.d/
183 install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/mnogosearch.conf
186 # ---------------------
187 # make & install php stuff
188 # must be in install-section because it needs an already installed mnogosearch
192 %configure --with-mnogosearch=%{buildroot}%{_prefix}
195 sed -i 's|-Wl,-rpath,[^ ]*||g' Makefile
197 make %{?_smp_mflags} EXTRA_LDFLAGS="-L%{buildroot}%{_libdir}" EXTRA_CFLAGS="-I%{buildroot}%{_includedir}/mnogosearch"
199 INSTALL_ROOT=$RPM_BUILD_ROOT
202 install -d %{buildroot}%{_sysconfdir}/php.d
203 cat >%{buildroot}%{_sysconfdir}/php.d/mnogosearch.ini <<EOF
204 ; Enable mnogosearch extension module
205 extension=mnogosearch.so
209 # ---------------------
212 install -d %{buildroot}%{_localstatedir}/lib/mnogosearch
215 rm -rf html; mkdir -p html
216 cp -p doc/*.html html/
217 rm -rf %{buildroot}/usr/doc
221 # run unit tests with sqlite backend
222 touch ./msearch-test/sqlite.db
223 export UDM_TEST_DBADDR=sqlite3://`pwd`/msearch-test/sqlite.db/,sqlite3://`pwd`/msearch-test/sqlite2.db/
231 # create mnogosearch user and group
232 getent group mnogosearch >/dev/null || groupadd -r mnogosearch
233 getent passwd mnogosearch >/dev/null || \
234 useradd -r -g mnogosearch -d %{_localstatedir}/lib/mnogosearch \
235 -c "User the indexer of the mnoGoSearch search engine is executed with" \
236 -s /sbin/nologin mnogosearch
240 # the cgi (executed with the apache user) must be able to read the database:
241 # the apache user must be in the mnogosearch group
242 usermod -a -G mnogosearch apache || :
244 # we brought our own apache config snippet and new group rights
245 service httpd condrestart > /dev/null 2>&1 || :
247 # create default mnogosearch database (only during install)
248 if [ $1 -eq 1 ] ; then
249 /usr/bin/indexer --create >/dev/null
250 chown mnogosearch:mnogosearch %{_localstatedir}/lib/mnogosearch/default.db
251 # db must be group writeable to allow query tracking
252 chmod 0660 %{_localstatedir}/lib/mnogosearch/default.db
256 service httpd condrestart > /dev/null 2>&1 || :
258 %post libs -p /sbin/ldconfig
260 %postun libs -p /sbin/ldconfig
263 %defattr(-,root,root,-)
267 %{_bindir}/mnogosearch-reindex
268 %dir %{_libexecdir}/mnogosearch
269 %{_libexecdir}/mnogosearch/search.cgi
270 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cron.d/mnogosearch
271 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/mnogosearch.conf
273 %defattr (0644,root,root,0755)
274 %doc ChangeLog README README.XML README.CVS TODO COPYING AUTHORS INSTALL NEWS FAQ html doc/samples
276 %{_datadir}/mnogosearch
278 # the config files of mnogosearch often contain database passwords -> should not be world readable
279 %defattr (0640,root,mnogosearch,0750)
280 %dir %{_sysconfdir}/mnogosearch
282 # indexer.conf is executable: has a correct shebang to run the indexer with this configuration
283 %attr(0755,root,mnogosearch) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/indexer.conf
284 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/langmap.conf
285 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/stopwords.conf
286 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/search.htm
287 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/node.xml
289 # default dir for search databases should not be world-readable:
290 # the search engine could have indexed secret files
291 %attr (0750,mnogosearch,mnogosearch) %dir %{_localstatedir}/lib/mnogosearch
294 %defattr(-,root,root,-)
298 %defattr(-,root,root,-)
299 %{_bindir}/udm-config
300 %{_includedir}/mnogosearch
302 %{_libdir}/libmnogosearch.so
303 %{_libdir}/libmnogocharset.so
306 %defattr(-,root,root,-)
307 %{_sysconfdir}/php.d/mnogosearch.ini
311 * Mon Feb 1 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-4
312 - don't use stopwords by default anymore
313 - switch from pdftotext to pdftohtml
314 - explicit charset not needed for all converters
316 * Mon Jan 31 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-3
317 - include upstream-patch to make adapting the config more easy
318 - add unrtf to default config and requires
319 - modifying the default configuration now done with a patch
320 - utf-8 now used in search template too
321 - include langmap and stopwords in search template too
323 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-2
324 - last minute-changes in the 3.3.11 release
325 - enable some external document helpers by default:
326 we always have them because of requires
327 - require the binaries of the helpers used, not the package names
328 - use wvHtml instead of catdoc by default: it retains formatting
329 - don't disable the file types we now have helpers for
331 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-1
333 - unit testing with two databases
334 - require catdoc and xlhtml for install and during build
335 - move make check into check-section
336 - fix timezone issue with test-blob unit test
338 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-7.20110127cvs
339 - new cvs version with fix for directory names
340 - fix commandline options in mnogosearch-reindex
342 * Wed Jan 26 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-6.20110126cvs
343 - import new upstream fixes for issues found during packaging
344 - group writeable default.db
345 - reindex option improvements by Alexander Barkov
346 - only create db on install
347 - create databases not with sqlite, but with the --create option of indexer
349 * Tue Jan 25 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-5.20110124cvs
350 - update cvs version to get lib64 fix
351 - don't package *.la files as per Fedora review policy
352 - filter php module from provides
353 - create mnogosearch user and group during installation
354 - tighten file permissions to protect passwords and data
355 - create default configuration suitable for Fedora
357 * Fri Jan 21 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-4.20110121cvs
358 - don't rename udm-config anymore
359 - better differentiation between release and cvs snapshots
360 - don't use $RPM_BUILD_DIR anymore
362 * Thu Jan 20 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-3.20110120cvs
363 - make use of the new fhs configure option
364 - move language files to /usr/share
365 - move cgi to /usr/libexec
366 - clean up unneeded stuff left over from Mandriva
367 - link firebird database
368 - run supplied unit tests after build
370 * Mon Jan 17 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-2.20110117cvs
371 - use current CVS as there are/will be some patches making packaging more easy
373 * Thu Jan 13 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-1
374 - add building of the php module
375 - initial packaging for Fedora
376 - based on the Mandriva .spec by Oden Eriksson