%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) %global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined") %global php_version %(php-config --version 2>/dev/null || echo 0) # do not add php module to provides, it is no regular library %{?filter_setup: %filter_provides_in %{php_extdir}/.*\.so$ %filter_setup } Summary: Web indexing and search system for a small domain or intranet Name: mnogosearch Version: 3.3.11 Release: 5%{?dist} License: GPLv2+ Group: Applications/Internet URL: http://www.mnogosearch.org/ # md5sum 906d5e1e21ba00024574f57548d32029 Source0: http://www.mnogosearch.org/Download/mnogosearch-%{version}.tar.gz 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/unrtf %endif Requires(pre): shadow-utils # user "apache" is added to mnogosearch group so we need the user to be present Requires(post): httpd BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: openssl-devel BuildRequires: zlib-devel BuildRequires: expat-devel BuildRequires: openssl-devel BuildRequires: openjade BuildRequires: docbook-utils BuildRequires: mysql-devel BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: sqlite-devel BuildRequires: unixODBC-devel 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 %define with_tests %{?_without_tests: 0} %{?!_without_tests: 1} %description mnoGoSearch (formerly known as UdmSearch) is a full-featured Web search engine that you can use to build search engines over HTTP, HTTPS, FTP, and NTTP servers, local files, and database big text fields. It supports Oracle, MS SQL Server, MySQL, PostgreSQL, InterBase/Firebird, Openlink Virtuoso, Intersystems Cach, iODBC, EasySoft ODBC, and unixODBC database backends. It has XML, HTML, and TEXT built-in support, and external converters support for other document types. An automatic language/charset guesser for more 70 language/charset combinations is included, along with basic authorization support, and you may index password-protected intranet HTTP servers with proxy authorization support. mnoGoSearch is built with support for mysql (including fulltext extension), sqlite, postgresql, firebird, unixODBC and freetds. %package libs Summary: Libraries for %{name} Group: System Environment/Libraries %description libs This package contains the %{name} library files. %package devel Summary: Development headers and libraries for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains the %{name} development files. %package php Summary: PHP-extension for %{name} Group: Applications/Internet Requires: %{name}-libs = %{version}-%{release} BuildRequires: php-devel BuildRequires: php-cli %if 0%{?php_zend_api} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} %else Requires: php-api = %{php_apiver} %endif %description php This package contains the PHP extension for %{name} %prep %setup -q -n mnogosearch-%{version} %patch0 -p1 %patch1 -p1 %build autoreconf -fi %configure \ --sysconfdir=%{_sysconfdir}/mnogosearch \ --datadir=%{_datadir}/mnogosearch \ --localstatedir=%{_localstatedir}/lib/mnogosearch \ --includedir=%{_includedir}/mnogosearch \ --enable-syslog \ --enable-syslog=LOG_LOCAL6 \ --enable-parser \ --enable-mp3 \ --enable-file \ --enable-http \ --enable-ftp \ --enable-news \ --with-openssl=%{_prefix} \ --with-zlib \ --with-readline \ --with-extra-charsets=all \ --with-mysql \ %if !0%{?rhel} --enable-mysql-fulltext-plugin \ %endif --with-pgsql \ --with-sqlite3 \ --with-unixODBC \ --with-freetds=%{_prefix} \ --with-ibase \ --with-docs \ --enable-fhs-layout make %{?_smp_mflags} %install rm -rf %{buildroot} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT \ doc_FILES='$(HTML_ALL)' # no need to call the config files *-dist (cd %{buildroot}%{_sysconfdir}/%{name} for f in *-dist ; do mv -f $f `basename $f -dist` done ) %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 mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}%{_libexecdir}/mnogosearch/ # the .la's confuse libtool when building the php lib and they should not # be packaged at all, so remove them rm -f %{buildroot}%{_libdir}/*.la install -m0755 %{SOURCE1} %{buildroot}%{_bindir}/ install -d %{buildroot}%{_sysconfdir}/cron.d/ install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.d/mnogosearch install -d %{buildroot}%{_sysconfdir}/httpd/conf.d/ install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/mnogosearch.conf # --------------------- # make & install php stuff # must be in install-section because it needs an already installed mnogosearch cd php /usr/bin/phpize %configure --with-mnogosearch=%{buildroot}%{_prefix} # get rid of rpath sed -i 's|-Wl,-rpath,[^ ]*||g' Makefile make %{?_smp_mflags} EXTRA_LDFLAGS="-L%{buildroot}%{_libdir}" EXTRA_CFLAGS="-I%{buildroot}%{_includedir}/mnogosearch" make install \ INSTALL_ROOT=$RPM_BUILD_ROOT cd .. install -d %{buildroot}%{_sysconfdir}/php.d cat >%{buildroot}%{_sysconfdir}/php.d/mnogosearch.ini </dev/null || groupadd -r mnogosearch getent passwd mnogosearch >/dev/null || \ useradd -r -g mnogosearch -d %{_localstatedir}/lib/mnogosearch \ -c "User the indexer of the mnoGoSearch search engine is executed with" \ -s /sbin/nologin mnogosearch exit 0 %post # the cgi (executed with the apache user) must be able to read the database: # the apache user must be in the mnogosearch group usermod -a -G mnogosearch apache || : # we brought our own apache config snippet and new group rights service httpd condrestart > /dev/null 2>&1 || : # create default mnogosearch database (only during install) if [ $1 -eq 1 ] ; then /usr/bin/indexer --create >/dev/null chown mnogosearch:mnogosearch %{_localstatedir}/lib/mnogosearch/default.db # db must be group writeable to allow query tracking chmod 0660 %{_localstatedir}/lib/mnogosearch/default.db fi %postun service httpd condrestart > /dev/null 2>&1 || : %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files %defattr(-,root,root,-) %{_bindir}/indexer %{_bindir}/mconv %{_bindir}/mguesser %{_bindir}/mnogosearch-reindex %dir %{_libexecdir}/mnogosearch %{_libexecdir}/mnogosearch/search.cgi %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cron.d/mnogosearch %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/mnogosearch.conf %defattr (0644,root,root,0755) %doc ChangeLog README README.XML README.CVS TODO COPYING AUTHORS INSTALL NEWS FAQ html doc/samples %{_mandir}/man?/* %{_datadir}/mnogosearch # the config files of mnogosearch often contain database passwords -> should not be world readable %defattr (0640,root,mnogosearch,0750) %dir %{_sysconfdir}/mnogosearch # indexer.conf is executable: has a correct shebang to run the indexer with this configuration %attr(0755,root,mnogosearch) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/indexer.conf %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/langmap.conf %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/stopwords.conf %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/search.htm %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mnogosearch/node.xml # default dir for search databases should not be world-readable: # the search engine could have indexed secret files %attr (0750,mnogosearch,mnogosearch) %dir %{_localstatedir}/lib/mnogosearch %files libs %defattr(-,root,root,-) %{_libdir}/lib*-*.so %files devel %defattr(-,root,root,-) %{_bindir}/udm-config %{_includedir}/mnogosearch %{_libdir}/*.a %{_libdir}/libmnogosearch.so %{_libdir}/libmnogocharset.so %files php %defattr(-,root,root,-) %{_sysconfdir}/php.d/mnogosearch.ini %{php_extdir} %changelog * Mon Feb 1 2011 Gerd v. Egidy 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 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 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 3.3.11-2 - last minute-changes in the 3.3.11 release - enable some external document helpers by default: we always have them because of requires - require the binaries of the helpers used, not the package names - use wvHtml instead of catdoc by default: it retains formatting - don't disable the file types we now have helpers for * Thu Jan 27 2011 Gerd v. Egidy 3.3.11-1 - mnogosearch 3.3.11 - unit testing with two databases - require catdoc and xlhtml for install and during build - move make check into check-section - fix timezone issue with test-blob unit test * Thu Jan 27 2011 Gerd v. Egidy 3.3.10-7.20110127cvs - new cvs version with fix for directory names - fix commandline options in mnogosearch-reindex * Wed Jan 26 2011 Gerd v. Egidy 3.3.10-6.20110126cvs - import new upstream fixes for issues found during packaging - group writeable default.db - reindex option improvements by Alexander Barkov - only create db on install - create databases not with sqlite, but with the --create option of indexer * Tue Jan 25 2011 Gerd v. Egidy 3.3.10-5.20110124cvs - update cvs version to get lib64 fix - don't package *.la files as per Fedora review policy - filter php module from provides - create mnogosearch user and group during installation - tighten file permissions to protect passwords and data - create default configuration suitable for Fedora * Fri Jan 21 2011 Gerd v. Egidy 3.3.10-4.20110121cvs - don't rename udm-config anymore - better differentiation between release and cvs snapshots - don't use $RPM_BUILD_DIR anymore * Thu Jan 20 2011 Gerd v. Egidy 3.3.10-3.20110120cvs - make use of the new fhs configure option - move language files to /usr/share - move cgi to /usr/libexec - clean up unneeded stuff left over from Mandriva - link firebird database - run supplied unit tests after build * Mon Jan 17 2011 Gerd v. Egidy 3.3.10-2.20110117cvs - use current CVS as there are/will be some patches making packaging more easy * Thu Jan 13 2011 Gerd v. Egidy 3.3.10-1 - add building of the php module - initial packaging for Fedora - based on the Mandriva .spec by Oden Eriksson