Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > 66a950d7dd29503883799d96528275b9 > files > 11

mnogosearch-3.2.6-1mdk.src.rpm

%define	name		mnogosearch
%define	version		3.2.6
%define	release		1mdk
%define	major		3
%define finalname	lib%{name}%{major}

%define build_mysql 0
%define build_postgresql 0

# commandline overrides:
# rpm -ba|--rebuild --with 'xxx'
%{?_with_mysql: %{expand: %%define build_mysql 1}}
%{?_with_postgresql: %{expand: %%define build_postgresql 1}}

%if %{build_mysql}
%define build_mysql 1
%define build_postgresql 0
%endif

%if %{build_postgresql}
%define build_mysql 0
%define build_postgresql 1
%endif

Summary:		Another one web indexing and searching system for a small domain or intranet
Name:			%{name}
Version:		%{version}
Release:		%{release}
License:		GPL
Group:			System/Servers
Source0:		http://www.mnogosearch.ru/Download/mnogosearch-%{version}.tar.bz2
Source1:		mnogosearch-gethostnames.bz2
Source2:		mnogosearch-Mysql-database.bz2
Source3:		mnogosearch-stored.init.bz2
Source4:		mnogosearch-cachelogd.init.bz2
Source5:		mnogosearch.png.bz2
Patch0:			mnogosearch-DESTDIR.patch.bz2
Patch1:			mnogosearch-Mysql-pld.patch.bz2
Patch2:			mnogosearch-stored-dirs_1.patch.bz2
Patch3:			mnogosearch-local_button.patch.bz2
URL:			http://www.mnogosearch.ru/
PreReq:			rpm-helper
Prereq:			webserver
Requires:		%{finalname} = %{version}
BuildRequires:		autoconf automake libtool openssl-devel zlib-devel
Obsoletes:		udmsearch

%if %{build_mysql}
Requires:		mysqlserver
BuildRequires:		libmysql10-devel
%endif

%if %{build_postgresql}
Requires:		postgresqlserver
BuildRequires:		postgresql-devel
%endif

BuildRoot:		%{_tmppath}/%{name}-buildroot


%description
The mnogosearch system is a complete world wide web indexing and
searching system for a small domain or intranet. This system is
not meant to replace the need for powerful internet-wide search
systems like Lycos, Infoseek, Webcrawler and AltaVista. Instead it
is meant to cover the search needs for a single company, campus,
or even a particular sub section of a web site. Features:

 - mp3 tag info
 - news searching(?)
 - http: (and ftp: - via proxy) URL schemaa
 - charset guesser
 - externel parsers
 - support for ssl (https://)
 - limiting queries to one hostname by sth like this: <INPUT
   TYPE=HIDDEN NAME=ul VALUE=http://www.something.com/>
 - it's posilble to run indexers on several diffrent (theoreticaly
   128) hosts, and gather information on one of them, reindexing
   proceses make no harm to avalibility of search engine. See
   cachemode.txt

As opposed to some WAIS-based or web-server based search engines,
mnogsearch can span several web servers at a site. The type of
these different web servers doesn't matter as long as they
understand the HTTP 1.0 protocol. Mnogosearch supports also
virtual domains.

You can also rebuild %{name} with support for either MySQL,
PostgreSQL or the built-in database.

The following are valid build options.

(ie. use with rpm --rebuild):

    --with postgresql	Build with PostgreSQL support
    --with mysql	Build with MySQL support


%package -n		%{finalname}
Summary:		%{name} library
Group:          	System/Libraries
Provides:		lib%{name} = %{version}
Provides:		%{finalname} = %{version}
Obsoletes:		lib%{name} = %{version}
Obsoletes:		%{finalname} = %{version}

%description -n		%{finalname}
This package contains the %{name} library files.

%package -n		%{finalname}-devel
Summary:		Include files for %{name}
Group:			Development/C
Requires:		%{finalname} = %{version}-%{release}
Provides:		lib%{name}-devel = %{version}
Provides:		%{finalname}-devel = %{version}
Obsoletes:		lib%{name}-devel = %{version}
Obsoletes:		%{finalname}-devel = %{version}

%description -n		%{finalname}-devel
This package contains the %{name} development files.

%package -n		%{finalname}-static-devel
Summary:		%{name} static libraries
Group:			Development/C
Requires:		%{finalname}-devel = %{version}-%{release}
Provides:		lib%{name}-static-devel = %{version}
Provides:		%{finalname}-static-devel = %{version}
Obsoletes:		lib%{name}-static-devel = %{version}
Obsoletes:		%{finalname}-static-devel = %{version}

%description -n		%{finalname}-static-devel
This package contains static libraries of %{name}.

%package stored
Summary:		Daemon for saving gziped versions of documents.
Group:			System/Servers
PreReq:			rpm-helper
Requires:		%{name} = %{version}
Requires:		%{finalname} = %{version}
Provides:		%{name}-stored = %{version}
Obsoletes:		%{name}-stored = %{version}

%description stored
This package contains optional part of %{name} stored daemon,
which stores locally gziped versions of parsed (& indexed) html
files, news articles, etc.

%prep
%setup -q -n mnogosearch-%{version}
%patch0 -p0
#%patch1 -p0
%patch2 -p0
%patch3 -p1

%build
find . -type d -name CVS | xargs rm -rf
rm -f missing
libtoolize --copy --force; aclocal; autoconf; automake --add-missing

%serverbuild

%configure \
    --enable-syslog \
    --enable-syslog=LOG_LOCAL6 \
    --with-image-dir=/var/www/html/%{name} \
    --with-cgi-bin-dir=/var/www/cgi-bin \
    --with-search-dir=/var/www/html \
    --with-config-dir=%{_sysconfdir}/httpd/%{name} \
    --localstatedir=/var/lib/%{name} \
    --sysconfdir=%{_sysconfdir}/%{name} \
    --with-openssl \
%if !%{build_mysql} && !%{build_postgresql}
    --with-built-in \
%endif
%if %{build_mysql}
    --with-mysql \
%endif
%if %{build_postgresql}
    --with-pgsql \
%endif
    --enable-linux-pthreads \
    --enable-charset-guesser \
    --enable-news-extension \
    --enable-fast-tag \
    --enable-fast-cat \
    --enable-fast-site \
    --enable-phrase \
    --enable-shared \
    --with-zlib

%make

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}


# don't fiddle with the initscript!
export DONT_GPRINTIFY=1

install -d %{buildroot}%{_localstatedir}
install -d %{buildroot}/var/www/icons
install -d %{buildroot}/var/www/html
install -d %{buildroot}/var/www/cgi-bin
install -d %{buildroot}%{_sysconfdir}/cron.daily
install -d %{buildroot}%{_infodir}
install -d %{buildroot}%{_initrddir}

make install DESTDIR=%{buildroot}

ln -sf %{_sbindir}/indexer %{buildroot}%{_sysconfdir}/cron.daily/mnogo-dbgen
mv -f %{buildroot}%{_bindir}/*.cgi %{buildroot}/var/www/cgi-bin/

(cd %{buildroot}%{_sysconfdir}/%{name}
touch locals
for f in *-dist ; do
    mv -f $f `basename $f -dist`
done
)

bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/cron.daily/mnogosearch-gethostnames
bzcat %{SOURCE2} > mysql.sql
bzcat %{SOURCE3} > %{buildroot}%{_initrddir}/mnogosearch-stored
bzcat %{SOURCE4} > %{buildroot}%{_initrddir}/mnogosearch-cachelogd
bzcat %{SOURCE5} > %{buildroot}/var/www/icons/mnogosearch.png

mkdir html
mv -f doc/*.html html

%clean
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}


%post
%_post_service mnogosearch-cachelogd

%preun
%_preun_service mnogosearch-cachelogd

%post -n %{finalname} -p /sbin/ldconfig
%postun -n %{finalname} -p /sbin/ldconfig

%post -n %{finalname}-devel -p /sbin/ldconfig
%postun -n %{finalname}-devel -p /sbin/ldconfig

%post -n %{finalname}-static-devel -p /sbin/ldconfig
%postun -n %{finalname}-static-devel -p /sbin/ldconfig

%post stored
%_post_service mnogosearch-stored

%preun stored
%_preun_service mnogosearch-stored

%files
%defattr(644,root,root,755)
%doc ChangeLog README TODO html doc/samples db2

%if %{build_mysql}
%doc mysql mysql.sql
%endif

%if %{build_postgresql}
%doc pgsql
%endif

%config(noreplace) %attr(0755,root,root) %{_initrddir}/mnogosearch-cachelogd
%attr(755,root,root) %{_sbindir}/[^s]*
%attr(755,root,root) %{_sbindir}/s[^t]*
%attr(755,root,root) /var/www/cgi-bin/*
%attr(644,root,root) /var/www/icons/mnogosearch.png
%dir %{_localstatedir}/%{name}
%{_localstatedir}/%{name}/raw
%{_localstatedir}/%{name}/splitter
%{_localstatedir}/%{name}/tree
%attr(775,root,apache) %{_localstatedir}/%{name}/cache
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*.conf
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*.htm
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/locals
%dir %{_sysconfdir}/%{name}/langmap
%dir %{_sysconfdir}/%{name}/stopwords
%dir %{_sysconfdir}/%{name}/synonym
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*/*
%config(noreplace) %attr(750,root,root) %{_sysconfdir}/cron.daily/*
%{_mandir}/man?/*

%files -n %{finalname}
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/lib*-*.so

%files -n %{finalname}-devel
%defattr(644,root,root,755)
%attr (755,root,root) %{_bindir}/udm-config
%{_includedir}/*
%attr (755,root,root) %{_libdir}/libudmsearch.so
%attr (755,root,root) %{_libdir}/lib*.la

%files -n %{finalname}-static-devel
%defattr(644,root,root,755)
%{_libdir}/lib*.a

%files stored
%defattr(644,root,root,755)
%config(noreplace) %attr(0755,root,root) %{_initrddir}/mnogosearch-stored
%attr(755,root,root) %{_sbindir}/stored
%{_localstatedir}/%{name}/store

%changelog
* Sat Sep 21 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 3.2.6-1mdk
- initial cooker contrib, ripped from PLD, adapted for ML
- used spec file voodoo magic from the nagios package to be able
  to rebuild with either MySQL or PostgreSQL support.
- fixed the init scripts
- added S5 and P3