According to Ric Klaren:
> Hope I haven't been doing something already fixed... but here is it anyway..
> patches against the 3.1.0-020399 snapshot.

I think the two of us were working in parallel, but you finished before me.
No problem.  I hadn't gotten very far anyway, so I started over with the
latest snapshot and your patches.  I've now got my new RPMs built (on
Red Hat 4.2), and I hope to test them tomorrow.

> Patches for all the (relevant) Makefile.in's and the CONFIG.in. For the
> buildroot construct discussed earlier.
> 
> A teeny patch to htsearch/Display.cc to shut egcs up over a discarding
> const to blah blah etc...
> 
> An adapted spec file (original from Gilles). To go with the previous patches.
> 
> Some changes with respect to install.. I prefer installing the html stuff
> and the cgi to a /home/httpd/htdig/ directory.. (which is then again a
> virtual root for apache).

Hmmm.  That requires a customised setup of Apache for it to work.
I had set up my RPMs so you could drop them onto a standard Red Hat
installation, with their uncustomized Apache RPM, run rundig, and you're
off.  That's why I used the paths that I did.  I guess this is one of
those situations that Geoff alluded to about "support for everyone's
favorite packaging scheme."  Anyway, it doesn't matter to me which spec
file winds up in contrib, mine or yours.  I'll stick with my spec file
(with some of your changes) for my Red Hat RPMs.

Your patch to CONFIG.in is just the thing to take all the paths out of
the source and put them all on the configure command line in the spec
file.  I wonder, though, whether other users will want those changes
as a permanent part of CONFIG.in in the source tree.  If so, great,
because then the RPMs won't need to include any patches, but if not,
then this one patch will still have to remain in the RPMs.

I used your patch to the Makefile.in files, but then I made a few more
changes to clean things up, and echo the actual locations where files
are installed.  I also put the HTML & dictionary file installations in
loops, to make things tidier.  Here's my patch to your patched Makefile.in:

--- ./Makefile.in.klaren        Thu Feb  4 18:07:42 1999
+++ ./Makefile.in       Thu Feb  4 18:24:43 1999
@@ -45,6 +45,8 @@
                button1.png button2.png button3.png button4.png button5.png \
                 button6.png button7.png button8.png button9.png buttonl.png \
                 buttonr.png button10.png htdig.png star.png star_blank.png
+COMMONHTML=    header.html footer.html wrapper.html nomatch.html syntax.html
+COMMONDICT=    bad_words english.0 english.aff synonyms
 
 all:
        @for i in $(DIRS); do \
@@ -91,31 +93,28 @@
        done && test -z "$$fail"
        @echo ""
        @echo "Installing default configuration files..."
-       @if [ ! -f $(INSTALL_ROOT)$(CONFIG_DIR)/htdig.conf ]; then sed -e 
s%@DATABASE_DIR@%$(DATABASE_DIR)% -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% 
$(top_srcdir)/installdir/htdig.conf >$(INSTALL_ROOT)$(CONFIG_DIR)/htdig.conf; echo 
$(CONFIG_DIR)/htdig.conf;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/bad_words ]; then $(INSTALL_DATA) 
$(top_srcdir)/installdir/bad_words $(INSTALL_ROOT)$(COMMON_DIR); echo 
$(COMMON_DIR)/bad_words; fi
-       @if [ ! -f $(INSTALL_ROOT)$(SEARCH_DIR)/$(SEARCH_FORM) ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/search.html 
>$(INSTALL_ROOT)$(SEARCH_DIR)/$(SEARCH_FORM); echo $(SEARCH_DIR)/$(SEARCH_FORM);fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/footer.html ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/footer.html 
>$(INSTALL_ROOT)$(COMMON_DIR)/footer.html; echo $(COMMON_DIR)/footer.html;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/header.html ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/header.html 
>$(INSTALL_ROOT)$(COMMON_DIR)/header.html; echo $(COMMON_DIR)/header.html;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/wrapper.html ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/wrapper.html 
>$(INSTALL_ROOT)$(COMMON_DIR)/wrapper.html; echo $(COMMON_DIR)/wrapper.html;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/nomatch.html ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/nomatch.html 
>$(INSTALL_ROOT)$(COMMON_DIR)/nomatch.html; echo $(COMMON_DIR)/nomatch.html;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/syntax.html ]; then sed -e 
s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/syntax.html 
>$(INSTALL_ROOT)$(COMMON_DIR)/syntax.html; echo $(COMMON_DIR)/syntax.html;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/english.0 ]; then $(INSTALL_DATA) 
$(top_srcdir)/installdir/english.0 $(INSTALL_ROOT)$(COMMON_DIR); echo 
$(COMMON_DIR)/english.0;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/english.aff ]; then $(INSTALL_DATA) 
$(top_srcdir)/installdir/english.aff $(INSTALL_ROOT)$(COMMON_DIR); echo 
$(COMMON_DIR)/english.aff;fi
-       @if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/synonyms ]; then $(INSTALL_DATA) 
$(top_srcdir)/installdir/synonyms $(INSTALL_ROOT)$(COMMON_DIR); echo 
$(COMMON_DIR)/synonyms;fi
+       @if [ ! -f $(INSTALL_ROOT)$(CONFIG_DIR)/htdig.conf ]; then sed -e 
+s%@DATABASE_DIR@%$(DATABASE_DIR)% -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% 
+$(top_srcdir)/installdir/htdig.conf >$(INSTALL_ROOT)$(CONFIG_DIR)/htdig.conf; echo 
+$(INSTALL_ROOT)$(CONFIG_DIR)/htdig.conf;fi
+       @if [ ! -f $(INSTALL_ROOT)$(SEARCH_DIR)/$(SEARCH_FORM) ]; then sed -e 
+s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/search.html 
+>$(INSTALL_ROOT)$(SEARCH_DIR)/$(SEARCH_FORM); echo 
+$(INSTALL_ROOT)$(SEARCH_DIR)/$(SEARCH_FORM);fi
+       @for i in $(COMMONHTML); do \
+               if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/$$i ]; then sed -e 
+s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/$$i 
+>$(INSTALL_ROOT)$(COMMON_DIR)/$$i; echo $(INSTALL_ROOT)$(COMMON_DIR)/$$i;fi \
+       done && test -z "$$fail"
+       @for i in $(COMMONDICT); do \
+               if [ ! -f $(INSTALL_ROOT)$(COMMON_DIR)/$$i ]; then $(INSTALL_DATA) 
+$(top_srcdir)/installdir/$$i $(INSTALL_ROOT)$(COMMON_DIR)/$$i; echo 
+$(INSTALL_ROOT)$(COMMON_DIR)/$$i; fi \
+       done && test -z "$$fail"
        @echo "Installing images..."
        @for i in $(IMAGES); do \
-               if [ ! -f $(INSTALL_ROOT)$(IMAGE_DIR)/$$i ]; then $(INSTALL_DATA) 
$(top_srcdir)/installdir/$$i $(INSTALL_ROOT)$(IMAGE_DIR)/$$i; echo 
$(IMAGE_DIR)/$$i;fi; \
+               if [ ! -f $(INSTALL_ROOT)$(IMAGE_DIR)/$$i ]; then $(INSTALL_DATA) 
+$(top_srcdir)/installdir/$$i $(INSTALL_ROOT)$(IMAGE_DIR)/$$i; echo 
+$(INSTALL_ROOT)$(IMAGE_DIR)/$$i;fi; \
        done && test -z "$$fail"
        @echo "Creating rundig script..."
        @if [ ! -f $(INSTALL_ROOT)$(BIN_DIR)/rundig ]; then \
                sed -e s%@BIN_DIR@%$(BIN_DIR)% -e s%@COMMON_DIR@%$(COMMON_DIR)% -e 
s%@DATABASE_DIR@%$(DATABASE_DIR)% $(top_srcdir)/installdir/rundig 
>$(INSTALL_ROOT)$(BIN_DIR)/rundig; \
-               chmod 755 $(BIN_DIR)/rundig; \
+               chmod 755 $(INSTALL_ROOT)$(BIN_DIR)/rundig; \
        fi
        @echo "Installation done."
        @echo ""
        @echo "Before you can start searching, you will need to create a"
        @echo "search database.  A sample script to do this has been"
-       @echo "installed as " $(BIN_DIR)/rundig
+       @echo "installed as " $(INSTALL_ROOT)$(BIN_DIR)/rundig
 
 install-strip:
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \

> --- htdig-3.1.0-020399/htsearch/Display.cc.rkorig     Thu Feb  4 12:38:27 1999
> +++ htdig-3.1.0-020399/htsearch/Display.cc    Thu Feb  4 12:39:22 1999
> @@ -370,7 +370,7 @@ Display::setVariables(int pageNumber, Li
>      else if (mystrcasecmp(config["match_method"], "or") == 0)
>       vars.Add("MATCH_MESSAGE", new String("some"));
>      vars.Add("MATCHES", new String(form("%d", nMatches)));
> -    vars.Add("PLURAL_MATCHES", new String(nMatches == 0 ? "" : "s"));
> +    vars.Add("PLURAL_MATCHES", new String(nMatches == 0 ? (char *)"" : (char 
>*)"s"));
>      vars.Add("PAGE", new String(form("%d", pageNumber)));
>      vars.Add("PAGES", new String(form("%d", nPages)));
>      vars.Add("FIRSTDISPLAYED",
> @@ -1116,8 +1116,8 @@ Display::compareTitle(const void *a1, co
>  {
>      ResultMatch      *m1 = *((ResultMatch **) a1);
>      ResultMatch *m2 = *((ResultMatch **) a2);
> -    char     *t1 = (m1->getRef()) ? m1->getRef()->DocTitle() : "";
> -    char     *t2 = (m2->getRef()) ? m2->getRef()->DocTitle() : "";
> +    char     *t1 = (m1->getRef()) ? m1->getRef()->DocTitle() : (char *)"";
> +    char     *t2 = (m2->getRef()) ? m2->getRef()->DocTitle() : (char *)"";
>  
>      if (!t1) t1 = "";
>      if (!t2) t2 = "";

I had a couple observations about this patch:
1) it seems harmless enough, so if it helps with egcs, then great!  It's
quite odd, though, that egcs would need those type casts.  I thought any
character string in double quotes was a char *, in C and C++.  Why does
egcs seem to think otherwise?
2) I just noticed that the test for PLURAL_MATCHES is wrong.  It should be
nMatches == 1, not nMatches == 0!  I'd send a patch, but it hardly seems
worth it for one character.  Geoff, can you put this fix in manually, please?


In case anyone is interested, here is my current spec file, from which
I'll eventually develop the final release.  The changes to the Makefiles
in the past month have allowed me to really clean up the installation.
The patches will go, eventually.
--------------- (snip) ---------------
Summary: A web indexing and searching system for a small domain or intranet
Name: htdig
Version: 3.1.0-020399
Release: 0
Copyright: GPL
Group: Networking/Utilities
BuildRoot: /var/tmp/htdig-root
Source0: http://www.htdig.org/files/htdig-%{PACKAGE_VERSION}.tar.gz
Patch0: htdig-%{PACKAGE_VERSION}-buildroot.patch
Patch1: htdig-%{PACKAGE_VERSION}-buildroot.patch2
Patch2: htdig-%{PACKAGE_VERSION}-nmatch.patch
URL: http://www.htdig.org/
Packager: Gilles Detillieux <[EMAIL PROTECTED]>

%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.
%prep
%setup -q -n htdig-%{PACKAGE_VERSION}
%patch0 -p1
%patch1 -p1 -b .klaren
%patch2 -p1

%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr \
        --bindir=/usr/sbin --libexec=/usr/lib --libdir=/usr/lib \
        --mandir=/usr/man --sysconfdir=/etc/htdig \
        --localstatedir=/var/lib/htdig \
        --with-image-dir=/home/httpd/html/htdig \
        --with-cgi-bin-dir=/home/httpd/cgi-bin \
        --with-search-dir=/home/httpd/html
make

%install
rm -rf $RPM_BUILD_ROOT
make INSTALL_ROOT=$RPM_BUILD_ROOT install-strip
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
ln -s ../../usr/sbin/rundig $RPM_BUILD_ROOT/etc/cron.daily/htdig-dbgen
ln -s ../../../../usr/doc/htdig-%{PACKAGE_VERSION} \
        $RPM_BUILD_ROOT/home/httpd/html/htdig/htdoc

%clean
rm -rf $RPM_BUILD_ROOT

%post
# Only run this if installing for the first time
if [ "$1" = 1 ]; then
        SERVERNAME="`grep '^ServerName' /etc/httpd/conf/httpd.conf | awk '{print $2}'`"
        [ -z "$SERVERNAME" ] && SERVERNAME="`hostname -f`"
        [ -z "$SERVERNAME" ] && SERVERNAME="localhost"
        echo "start_url:        http://$SERVERNAME/
local_urls:     http://$SERVERNAME/=/home/httpd/html/
local_user_urls:        http://$SERVERNAME/=/home/,/public_html/" >> 
/etc/htdig/htdig.conf

fi

%files
%defattr(-,root,root)
%config /etc/htdig/htdig.conf
%config /usr/sbin/rundig
%config /home/httpd/html/search.html
/etc/cron.daily/htdig-dbgen
/usr/sbin/htdig
/usr/sbin/htfuzzy
/usr/sbin/htmerge
/usr/sbin/htnotify
/var/lib/htdig
/home/httpd/cgi-bin/htsearch
/home/httpd/html/htdig

%doc CONFIG README htdoc/*

%changelog
* Thu Feb  4 1999 Gilles Detillieux <[EMAIL PROTECTED]>
  - put web stuff back in /home/httpd/html & /home/httpd/cgi-bin, so it can
        go over a standard Apache installation on Red Hat
  - cleaned up %install to make use of new features

* Thu Feb 4 1999 Ric Klaren <[EMAIL PROTECTED]>
  - updated to 3.1.0-020399
  - changed buildroot stuff
  - minor spec file fixes
  - install web stuff in /home/httpd/htdig
  - made rundig config file

* Mon Jan  4 1999 Gilles Detillieux <[EMAIL PROTECTED]>
  - updated to 3.1.0b4

* Tue Dec 15 1998 Gilles Detillieux <[EMAIL PROTECTED]>
  - updated to 3.1.0b3, changed version number & rundig script accordingly

* Thu Nov  5 1998 Gilles Detillieux <[EMAIL PROTECTED]>
  - patched htdoc/where.html to reflect latest version

* Tue Nov  3 1998 Gilles Detillieux <[EMAIL PROTECTED]>
  - updated to 3.1.0b2, changed patches accordingly

* Tue Sep 22 1998 Gilles Detillieux <[EMAIL PROTECTED]>
  - Changed config patches to remove -ggdb compile option (for 3.1.0b1)
  - Added local_urls stuff to generated htdig.conf file

* Fri Sep 18 1998 Gilles Detillieux <[EMAIL PROTECTED]>
  - Built the rpm from latest htdig source (3.1.0b1), using earlier
    versions of rpms by Mihai Ibanescu <[EMAIL PROTECTED]> and Elliot Lee
    <[EMAIL PROTECTED]> as a model, incorporating ideas from both.  I've
    made the install locations as FSSTND compliant as I can think of.

--------------- (snip) ---------------

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to