%{?!ruby_sitelib:%define ruby_sitelib %(ruby -r rbconfig -le 'print ::Config::CONFIG["sitelibdir"]')}
%{?!ruby_sitearch:%define ruby_sitearch %(ruby -r rbconfig -le 'print ::Config::CONFIG["sitearchdir"]')}
%define lzo_major %(rpm -q --qf '%{VERSION}' lzo |cut -d. -f1)
Name: hyperestraier
Version: 1.4.10
Release: 1.n0i.3%{?dist}
Summary: A full-text search system for communities
Group: Applications/Internet
License: LGPL
URL: http://hyperestraier.sourceforge.net/
Source0: http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig zlib-devel bzip2-devel lzo-devel qdbm-devel
BuildConflicts: %{name}-devel
%description
Hyper Estraier is a full-text search system. You can search lots of documents
for some documents including specified words. If you run a web site, it is
useful as your own search engine for pages in your site. Also, it is useful
as search utilities of mail boxes and file servers.
%package cgi
Summary: Hyperestraier CGI programs
Group: Applications/Internet
Requires: %{name} = %{version}-%{release}
Requires: webserver
%description cgi
Hyper Estraier is a full-text search system. You can search lots of documents
for some documents including specified words. If you run a web site, it is
useful as your own search engine for pages in your site. Also, it is useful
as search utilities of mail boxes and file servers.
This package contains the CGI programs for Hyperestraier
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package perl
Summary: Perl interface for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description perl
The %{name}-perl package contains modules for
developing Perl applications that use %{name}.
%package ruby
Summary: Ruby interface for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: ruby
%description ruby
The %{name}-ruby package contains modules for
developing Ruby applications that use %{name}.
%prep
%setup -q
%if %lzo_major == 1
%{__sed} -i 's@lzo/@@' myconf.h
%{__sed} -i 's@lzo2@lzo@g' configure */configure
%endif
%build
export CFLAGS="$RPM_OPT_FLAGS -fPIC -I$(pwd)"
for dir in . perlnative rubynative rubypure
do
pushd $dir
%configure --disable-static \
--enable-zlib \
--enable-lzo \
--enable-bzip \
--libexecdir=/var/www/cgi-bin
RUNENV='' LDENV='' %{__make} %{?_smp_mflags} -e
popd
done
%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT
%{__mv} $RPM_BUILD_ROOT%{_bindir}/estconfig $RPM_BUILD_ROOT%{_bindir}/est-config
%{__mv} $RPM_BUILD_ROOT%{_mandir}/man1/estconfig.1 $RPM_BUILD_ROOT%{_mandir}/man1/est-config.1
%{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf << EOF
Options ExecCGI FollowSymlinks
Order deny,allow
Deny from all
Allow from 127.0.0.1
EOF
%{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
for i in estseek.{conf,tmpl,top} ; do
%{__install} -m0644 $i $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
%{__ln_s} -f %{_sysconfdir}/%{name}/$i $RPM_BUILD_ROOT/var/www/cgi-bin/$i
done
pushd perlnative
%{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
pod2man -n 'Estraier' -s 3 estraier-doc.pod > $RPM_BUILD_ROOT%{_mandir}/man3/Estraier.3pm
popd
# clean up perl installation
find $RPM_BUILD_ROOT \( -name .packlist -o -name perllocal.pod \) -delete || :
find $RPM_BUILD_ROOT -type f -name '*.bs' -a -empty -delete || :
find $RPM_BUILD_ROOT -depth -type d -a -empty -delete || :
find $RPM_BUILD_ROOT -name '*.so' -exec %{__chmod} 0755 {} \;
for i in rubynative rubypure ; do
pushd $i
%{__make} install DESTDIR=$RPM_BUILD_ROOT
popd
done
# drop docs (goto %doc)
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/hyperestraier/{ChangeLog,COPYING,THANKS,doc/,locale/}
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/hyperestraier/estseek.{conf,tmpl,top}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING ChangeLog README THANKS
%{_libdir}/*.so.*
%{_bindir}/*
%exclude %{_bindir}/est-config
%exclude %{_bindir}/*.pl
%exclude %{_bindir}/*.rb
%{_datadir}/hyperestraier
%{_mandir}/man1/*
%exclude %{_mandir}/man1/est-config.*
%files cgi
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
/var/www/cgi-bin/*
%files devel
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/est-config
%{_includedir}/*.h
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man1/est-config.*
%{_mandir}/man3/*
%exclude %{_mandir}/man3/*.3pm.*
%files perl
%defattr(-,root,root,-)
%doc doc/perlnativeapi
%{_bindir}/*.pl
%{perl_vendorarch}/*
%exclude %dir %{perl_vendorarch}/auto
%{_mandir}/man3/*.3pm.*
%files ruby
%defattr(-,root,root,-)
%doc doc/rubynativeapi/ doc/rubypureapi/
%{_bindir}/*.rb
%{ruby_sitelib}/*
%changelog
* Sun Apr 22 2007 Marius FERARU - 1.4.10-1.n0i.4
- version 1.4.10
* Mon Aug 21 2006 Marius FERARU - 1.3.8-1.n0i.3
- version 1.3.8
- using "clean" lzo2 (but keep backward compatibility somehow)
* Tue Jul 18 2006 Marius FERARU - 1.3.3-1.n0i.2
- version 1.3.3
* Sun Jul 02 2006 Marius FERARU - 1.3.0-1.n0i.1
- baked a Fedora package starting from Mandriva's spec (1.2.9-1mdv2007.0)