%define name htdig %define version 3.2.0 %define betanum b4-072201 %define release 0.9mdk %define contentdir /var/www Name: %{name} Summary: A web indexing and searching system for a small domain or intranet Version: %{version} Release: %{release} License: GPL Group: Networking/WWW URL: http://www.htdig.org/ Source: %{name}-%{version}%{betanum}.tar.bz2 Source1: htdig-dbgen Source2: %{name}-rundig-accents.patch.bz2 Patch0: %{name}.patch.bz2 Patch1: %{name}-accents.patch.bz2 Patch2: rundig.emptydb.patch.bz2 Patch3: %{name}-dblmax.patch.bz2 Patch4: %{name}-memcpy.patch.bz2 Patch5: %{name}-localconf.patch.bz2 Patch6: %{name}-rundiginfos.patch.bz2 Patch50: %{name}-enabledebug.patch.bz2 # Laurent 2002-10-15 fix compile with gcc-3.2 Patch80: htdig-fix-compile-with-gcc-3.2.patch.bz2 Patch81: htdig-fix-configure.patch.bz2 Patch82: htdig-3.2.0b4-072201-64bit-fixes.patch.bz2 Patch83: htdig-gcc-3.4.patch.bz2 Patch84: htdig-3.2.0b4-CAN-2005-0085.patch BuildRoot: %{_tmppath}/%{name}-buildroot BuildRequires: flex >= 2.5.4a-13 BuildRequires: libtool BuildRequires: gcc-c++ BuildRequires: zlib1-devel %description The ht://Dig 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. As opposed to some WAIS-based or web-server based search engines, ht://Dig 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. ht://Dig was developed at San Diego State University as a way to search the various web servers on the campus network. %package devel Group: Development/C Summary: Libraries needed to develop for htdig Requires: %{name} = %{version} %description devel Libraries needed to develop for htdig. %package web Summary: Scripts and HTML code needed for using ht://Dig as a web search engine Group: Networking/WWW Requires: %{name} = %{version} Requires: webserver %description web The ht://Dig 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. As opposed to some WAIS-based or web-server based search engines, ht://Dig 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. The %{name}-web package includes CGI scripts and HTML code needed to use ht://Dig on a website. ht://Dig was developed at San Diego State University as a way to search the various web servers on the campus network. %prep %setup -q -n %{name}-%{version}%{betanum} chmod -R 0644 htdoc/* #%patch0 -p1 -b .config #%patch1 -p1 -b .accents #%patch2 -p1 -b .emptydb #%patch3 -p1 -b .dblmax %patch4 -p1 -b .memcpy %patch5 -p1 -b .localconf %patch6 -p1 -b .rundiginfos #%patch50 -p1 -b .enabledebug %patch80 -p1 %patch81 -p1 %patch82 -p1 -b .64bit-fixes %patch83 -p0 %patch84 -p0 -b .can-2005-0085 # Fix the flex output file for glibc 2.2 compatibility cd htcommon flex -oconf_lexer.cxx conf_lexer.lxx cd .. # Make it lib64 aware perl -pi -e "m|LDFLAGS=| and s|/lib\b|/%{_lib}|g" configure */configure %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr \ # --bindir=%{_sbindir} --libexec=%{_libdir} --libdir=%{_libdir} \ # --mandir=%{_mandir} --sysconfdir=/etc/htdig \ # --localstatedir=/var/lib \ # --with-image-dir=/var/www/html/htdig \ # --with-cgi-bin-dir=/var/www/cgi-bin \ # --with-search-dir=/var/www/html #CFLAGS="$RPM_OPT_FLAGS" # --enable-debug \ ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-shared \ --with-config-dir=%{_sysconfdir}/htdig \ --with-common-dir=%{contentdir}/html/htdig \ --with-database-dir=/var/lib/htdig \ --localstatedir=/var/lib/htdig \ --with-cgi-bin-dir=%{contentdir}/cgi-bin \ --with-image-dir=%{contentdir}/html/htdig \ --with-search-dir=%{contentdir}/html/htdig \ --with-default-config-file=/etc/htdig/htdig.conf \ --with-apache=/usr/sbin/httpd \ --with-zlib=%{_prefix} make %install [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT #make DESTDIR=$RPM_BUILD_ROOT install-strip make DESTDIR=$RPM_BUILD_ROOT install strip -R .comment $RPM_BUILD_ROOT%{contentdir}/cgi-bin/* || : strip -R .comment $RPM_BUILD_ROOT%{_bindir}/* || : mkdir -p $RPM_BUILD_ROOT/etc/cron.daily cp %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/htdig-dbgen cp $RPM_BUILD_ROOT%{contentdir}/cgi-bin/htsearch $RPM_BUILD_ROOT%{_bindir} chmod 644 $RPM_BUILD_ROOT%{contentdir}/html/htdig/* # pb with current rpm and symlinks (4.0.3-0.8mdk) ln -sf ./search.html $RPM_BUILD_ROOT%{contentdir}/html/htdig/index.html #cp $RPM_BUILD_ROOT%{contentdir}/html/htdig/search.html $RPM_BUILD_ROOT%{contentdir}/html/htdig/index.html # now get rid of the $RPM_BUILD_ROOT paths in the conf files for i in /etc/htdig.conf /usr/bin/rundig ; do perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/$i done mkdir -p $RPM_BUILD_ROOT%{_datadir} mv $RPM_BUILD_ROOT%{contentdir}/html/htdig $RPM_BUILD_ROOT%{_datadir} ln -sf ../../../usr/share/htdig $RPM_BUILD_ROOT%{contentdir}/html/htdig #ln -sf ../../../../usr/share/doc/htdig-%{PACKAGE_VERSION} \ # $RPM_BUILD_ROOT/var/www/html/htdig/htdoc %pre egrep "^htdig:" /etc/group >/dev/null if [ $? = 1 ]; then echo "adding htdig group" groupadd -r htdig fi egrep "^htdig:" /etc/passwd >/dev/null if [ $? = 1 ]; then echo "adding htdig user" useradd -r -g htdig -s "" -d /var/lib/htdig htdig fi egrep "^htdig:.*/var/lib/htdig:" /etc/passwd >/dev/null if [ $? = 1 ]; then echo "updating htdig homedir" perl -pi -e "s,^(htdig:.*:)[^:]+(:[^:]*)$,\1/var/lib/htdig\2," /etc/passwd fi %preun # we're uninstalling if [ $1 = 0 ]; then egrep "^htdig:" /etc/passwd >/dev/null if [ $? = 0 ]; then echo "removing htdig user" userdel htdig # userdel seems to nuke the group too.. fi egrep "^htdig:" /etc/group >/dev/null if [ $? = 0 ]; then echo "removing htdig group" groupdel htdig fi fi %clean [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_DIR/%{name}-%{version} %post web # Only run this if installing for the first time if [ "$1" = 1 ]; then if [ -f /etc/httpd/conf/httpd.conf ];then SERVERNAME="`grep '^ServerName' /etc/httpd/conf/httpd.conf | awk 'NR == 1 {print $2}'`" fi [ -z "$SERVERNAME" ] && SERVERNAME="`hostname -f`" [ -z "$SERVERNAME" ] && SERVERNAME="localhost" sed 's/^start_url:.*/#&\ # (See end of file for this parameter.)/' /etc/htdig/htdig.conf > /tmp/ht.$$ cat /tmp/ht.$$ > /etc/htdig/htdig.conf rm /tmp/ht.$$ cat >> /etc/htdig/htdig.conf <<! # Automatically set up by htdig RPM, from your current Apache httpd.conf... # Verify and configure these, and set maintainer above, before running # /usr/bin/rundig. # See /usr/doc/htdig*/attrs.html for descriptions of attributes. # The URL(s) where htdig will start. See also limit_urls_to above. start_url: http://$SERVERNAME/ # This makes sure that we don't spider the web local_urls_only: true # These attributes allow indexing server via local filesystem rather than HTTP. local_urls: http://$SERVERNAME/=/var/www/html/ local_user_urls: http://$SERVERNAME/=/home/,/public_html/ ! fi %files devel %defattr(-,root,root) %{_libdir}/htdig/*.a %{_libdir}/htdig/*.la %{_libdir}/htdig/*[a-z].so %{_libdir}/mifluz/*.a %{_libdir}/mifluz/*.la %{_libdir}/mifluz/*[a-z].so %{_includedir}/* %files web %defattr(-,root,root) %config(missingok, noreplace) %attr(0755,root,root) /etc/cron.daily/htdig-dbgen %{contentdir}/html/htdig %{contentdir}/cgi-bin/* %files %defattr(-,root,root,0755) %doc htdoc/* %dir %{_sysconfdir}/htdig %config(noreplace) %{_sysconfdir}/htdig/htdig.conf %config(noreplace) %{_sysconfdir}/htdig/mime.types %{_bindir}/* %dir %{_libdir}/htdig %dir %{_libdir}/mifluz %{_libdir}/htdig/*3.2.0.so %{_libdir}/mifluz/*3.2.0.so %dir %attr(-,htdig,htdig) /var/lib/htdig #%dir %{_datadir}/htdig %dir %attr(-,htdig,root) %{_datadir}/htdig %{_datadir}/htdig/* %changelog * Tue Apr 05 2005 Nicolas Lécureuil <neoclust@mandrake.org> 3.2.0-0.9mdk - P84: security fix for CAN-2005-0085 from updates * Tue Jun 29 2004 Michael Scherer <misc@mandrake.org> 3.2.0-0.8mdk - rebuild for new gcc ( patch #83 ) - changes permissions of doc to please rpmlint * Sat Apr 19 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.2.0-0.7mdk - Patch82: Minor 64-bit fixes - Enable zlib back, make it lib64 aware * Wed Jan 15 2003 Lenny Cartier <lenny@mandrakesoft.com> 3.2.0-0.6mdk - rebuild against new libopenssl * Tue Oct 15 2002 Laurent MONTEL <lmontel@mandrakesoft.com> 3.2.0-0.5mdk - add patch80 : fix compile with gcc-3.2 - Add patch81 : fix configure * Wed Aug 29 2001 Pixel <pixel@mandrakesoft.com> 3.2.0-0.4mdk - makes it own /etc/htdig * Tue Jul 24 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.2.0-0.3mdk - new snapshot - removed troublesome compiler options * Wed Jun 27 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.2.0-0.2mdk - htdig needs write access to commondir when run as user htdig by the cron script (web package) * Wed Jun 27 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.2.0-0.1mdk - new version (3.2.0b3) - updated filelist - changed INSTALL_ROOT to DESTDIR - changed configure options - copy conf files from /usr/conf to /etc/htdig - devel package (@!?%&! non standard sonames) - web package - moved to bindir instead of sbindir - a few patches (3-6) * Mon Feb 5 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 3.1.5-9mdk - grep httpd.conf only if exist. * Fri Dec 29 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.1.5-8mdk - patch to avoid using htmerge when database is empty (avoid error message being sent by cron job) - added '-a' option to rundig in the cron script, to allow searching while a new index is created (in separate *.work files) - corrected doc link * Fri Nov 17 2000 Lenny Cartier <lenny@mandrakesoft.com> 3.1.5-7mdk - build for gcc-2.96 * Fri Sep 15 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.1.5-6mdk - well, changed /var/www/httpd to /var/www ; don't know what I was thinking... * Thu Sep 14 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.1.5-5mdk - added noreplace for cron daily job - added accent patches * Thu Sep 14 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 3.1.5-4mdk - moved /home/httpd to /var/www/httpd - copied htsearch to sbindir to allow users to search locally * Wed Sep 06 2000 Lenny Cartier <lenny@mandrakesoft.com> 3.1.5-3mdk - BM - macros * Wed Apr 12 2000 Chris Green <cmg@dok.org> 3.1.5-2mdk - made htdig run as the htdig user - added noreplace to config file * Tue Apr 11 2000 Lenny Cartier <lenny@mandrakesoft.com> 3.1.5-1mdk - used srpm provided by Vincent Danen <vdanen@linux-mandrake.com> * Fri Mar 24 2000 Vincent Danen <vdanen@linux-mandrake.com> - adapted spec file by Gilles Detillieux <grdetil@scrc.umanitoba.ca> - 3.1.5 - bzip sources