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 257c6bedb0113667654aaa7c47d0a9b3
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}
31 Requires(pre): shadow-utils
33 # user "apache" is added to mnogosearch group so we need the user to be present
36 BuildRequires: autoconf
37 BuildRequires: automake
38 BuildRequires: libtool
39 BuildRequires: openssl-devel
40 BuildRequires: zlib-devel
41 BuildRequires: expat-devel
42 BuildRequires: openssl-devel
43 BuildRequires: openjade
44 BuildRequires: docbook-utils
45 BuildRequires: mysql-devel
46 BuildRequires: readline-devel
47 BuildRequires: ncurses-devel
48 BuildRequires: sqlite-devel
49 BuildRequires: unixODBC-devel
50 BuildRequires: postgresql-devel
51 BuildRequires: freetds-devel
52 BuildRequires: firebird-devel
56 # build is done with unit testing by default, but it can be disabled
57 # by --without tests to save time
58 %define with_tests %{?_without_tests: 0} %{?!_without_tests: 1}
61 mnoGoSearch (formerly known as UdmSearch) is a full-featured Web search engine
62 that you can use to build search engines over HTTP, HTTPS, FTP, and NTTP
63 servers, local files, and database big text fields. It supports Oracle, MS SQL
64 Server, MySQL, PostgreSQL, InterBase/Firebird, Openlink Virtuoso, Intersystems
65 Cach, iODBC, EasySoft ODBC, and unixODBC database backends. It has XML, HTML,
66 and TEXT built-in support, and external converters support for other document
67 types. An automatic language/charset guesser for more 70 language/charset
68 combinations is included, along with basic authorization support, and you may
69 index password-protected intranet HTTP servers with proxy authorization
72 mnoGoSearch is built with support for mysql (including fulltext extension),
73 sqlite, postgresql, firebird, unixODBC and freetds.
76 Summary: Libraries for %{name}
77 Group: System Environment/Libraries
80 This package contains the %{name} library files.
83 Summary: Development headers and libraries for %{name}
84 Group: Development/Libraries
85 Requires: %{name} = %{version}-%{release}
88 This package contains the %{name} development files.
91 Summary: PHP-extension for %{name}
92 Group: Applications/Internet
93 Requires: %{name}-libs = %{version}-%{release}
94 BuildRequires: php-devel
95 BuildRequires: php-cli
98 Requires: php(zend-abi) = %{php_zend_api}
99 Requires: php(api) = %{php_core_api}
101 Requires: php-api = %{php_apiver}
105 This package contains the PHP extension for %{name}
108 %setup -q -n mnogosearch-%{version}
114 --sysconfdir=%{_sysconfdir}/mnogosearch \
115 --datadir=%{_datadir}/mnogosearch \
116 --localstatedir=%{_localstatedir}/lib/mnogosearch \
117 --includedir=%{_includedir}/mnogosearch \
119 --enable-syslog=LOG_LOCAL6 \
126 --with-openssl=%{_prefix} \
129 --with-extra-charsets=all \
131 --enable-mysql-fulltext-plugin \
135 --with-freetds=%{_prefix} \
146 DESTDIR=$RPM_BUILD_ROOT \
147 doc_FILES='$(HTML_ALL)'
149 # no need to call the config files *-dist
150 (cd %{buildroot}%{_sysconfdir}/%{name}
152 mv -f $f `basename $f -dist`
156 # fix header of config file
157 sed -i 's|/usr/local/mnogosearch/sbin/indexer|%{_bindir}/indexer|g' \
158 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
160 # change default configuration
161 sed -i 's|DBAddr.mysql://root@localhost/test/?dbmode=blob|DBAddr sqlite3://localhost/%{_localstatedir}/lib/mnogosearch/default.db/?dbmode=blob|g' \
162 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf \
163 %{buildroot}%{_sysconfdir}/mnogosearch/search.htm \
165 sed -i 's|#LocalCharset UTF-8|LocalCharset UTF-8|g' \
166 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
168 sed -i 's|#Server http://localhost/|Server http://localhost/|g' \
169 %{buildroot}%{_sysconfdir}/mnogosearch/indexer.conf
171 # the cgi is no regular binary, move it to libexec
172 install -d %{buildroot}%{_libexecdir}/mnogosearch
173 mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}%{_libexecdir}/mnogosearch/
175 # the .la's confuse libtool when building the php lib and they should not
176 # be packaged at all, so remove them
177 rm -f %{buildroot}%{_libdir}/*.la
179 install -m0755 %{SOURCE1} %{buildroot}%{_bindir}/
181 install -d %{buildroot}%{_sysconfdir}/cron.d/
182 install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.d/mnogosearch
184 install -d %{buildroot}%{_sysconfdir}/httpd/conf.d/
185 install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/mnogosearch.conf
188 # ---------------------
189 # make & install php stuff
190 # must be in install-section because it needs an already installed mnogosearch
194 %configure --with-mnogosearch=%{buildroot}%{_prefix}
197 sed -i 's|-Wl,-rpath,[^ ]*||g' Makefile
199 make %{?_smp_mflags} EXTRA_LDFLAGS="-L%{buildroot}%{_libdir}" EXTRA_CFLAGS="-I%{buildroot}%{_includedir}/mnogosearch"
201 INSTALL_ROOT=$RPM_BUILD_ROOT
204 install -d %{buildroot}%{_sysconfdir}/php.d
205 cat >%{buildroot}%{_sysconfdir}/php.d/mnogosearch.ini <<EOF
206 ; Enable mnogosearch extension module
207 extension=mnogosearch.so
211 # ---------------------
214 install -d %{buildroot}%{_localstatedir}/lib/mnogosearch
217 rm -rf html; mkdir -p html
218 cp -p doc/*.html html/
219 rm -rf %{buildroot}/usr/doc
223 # run unit tests with sqlite backend
224 touch ./msearch-test/sqlite.db
225 export UDM_TEST_DBADDR=sqlite3://`pwd`/msearch-test/sqlite.db/,sqlite3://`pwd`/msearch-test/sqlite2.db/
233 # create mnogosearch user and group
234 getent group mnogosearch >/dev/null || groupadd -r mnogosearch
235 getent passwd mnogosearch >/dev/null || \
236 useradd -r -g mnogosearch -d %{_localstatedir}/lib/mnogosearch \
237 -c "User the indexer of the mnoGoSearch search engine is executed with" \
238 -s /sbin/nologin mnogosearch
242 # the cgi (executed with the apache user) must be able to read the database:
243 # the apache user must be in the mnogosearch group
244 usermod -a -G mnogosearch apache || :
246 # we brought our own apache config snippet and new group rights
247 service httpd condrestart > /dev/null 2>&1 || :
249 # create default mnogosearch database (only during install)
250 if [ $1 -eq 1 ] ; then
251 /usr/bin/indexer --create >/dev/null
252 chown mnogosearch:mnogosearch %{_localstatedir}/lib/mnogosearch/default.db
253 # db must be group writeable to allow query tracking
254 chmod 0660 %{_localstatedir}/lib/mnogosearch/default.db
258 service httpd condrestart > /dev/null 2>&1 || :
260 %post libs -p /sbin/ldconfig
262 %postun libs -p /sbin/ldconfig
265 %defattr(-,root,root,-)
269 %{_bindir}/mnogosearch-reindex
270 %dir %{_libexecdir}/mnogosearch
271 %{_libexecdir}/mnogosearch/search.cgi
272 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cron.d/mnogosearch
273 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/mnogosearch.conf
275 %defattr (0644,root,root,0755)
276 %doc ChangeLog README README.XML README.CVS TODO COPYING AUTHORS INSTALL NEWS FAQ html doc/samples
278 %{_datadir}/mnogosearch
280 # the config files of mnogosearch often contain database passwords -> should not be world readable
281 %defattr (0640,root,mnogosearch,0750)
282 %dir %{_sysconfdir}/mnogosearch
284 # indexer.conf is executable: has a correct shebang to run the indexer with this configuration
285 %attr(0755,root,mnogosearch) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/indexer.conf
286 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/langmap.conf
287 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/stopwords.conf
288 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/search.htm
289 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/node.xml
291 # default dir for search databases should not be world-readable:
292 # the search engine could have indexed secret files
293 %attr (0750,mnogosearch,mnogosearch) %dir %{_localstatedir}/lib/mnogosearch
296 %defattr(-,root,root,-)
300 %defattr(-,root,root,-)
301 %{_bindir}/udm-config
302 %{_includedir}/mnogosearch
304 %{_libdir}/libmnogosearch.so
305 %{_libdir}/libmnogocharset.so
308 %defattr(-,root,root,-)
309 %{_sysconfdir}/php.d/mnogosearch.ini
313 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.11-1
315 - unit testing with two databases
316 - require catdoc and xlhtml for install and during build
317 - move make check into check-section
319 * Thu Jan 27 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-7.20110127cvs
320 - new cvs version with fix for directory names
321 - fix commandline options in mnogosearch-reindex
323 * Wed Jan 26 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-6.20110126cvs
324 - import new upstream fixes for issues found during packaging
325 - group writeable default.db
326 - reindex option improvements by Alexander Barkov
327 - only create db on install
328 - create databases not with sqlite, but with the --create option of indexer
330 * Tue Jan 25 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-5.20110124cvs
331 - update cvs version to get lib64 fix
332 - don't package *.la files as per Fedora review policy
333 - filter php module from provides
334 - create mnogosearch user and group during installation
335 - tighten file permissions to protect passwords and data
336 - create default configuration suitable for Fedora
338 * Fri Jan 21 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-4.20110121cvs
339 - don't rename udm-config anymore
340 - better differentiation between release and cvs snapshots
341 - don't use $RPM_BUILD_DIR anymore
343 * Thu Jan 20 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-3.20110120cvs
344 - make use of the new fhs configure option
345 - move language files to /usr/share
346 - move cgi to /usr/libexec
347 - clean up unneeded stuff left over from Mandriva
348 - link firebird database
349 - run supplied unit tests after build
351 * Mon Jan 17 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-2.20110117cvs
352 - use current CVS as there are/will be some patches making packaging more easy
354 * Thu Jan 13 2011 Gerd v. Egidy <gerd@egidy.de> 3.3.10-1
355 - add building of the php module
356 - initial packaging for Fedora
357 - based on the Mandriva .spec by Oden Eriksson