[htdig3-dev] improved buildroot patch + egcs patch + RPM spec file


Ric Klaren (klaren@telin.nl)
Thu, 4 Feb 1999 16:47:44 +0000


Hi,

Hope I haven't been doing something already fixed... but here is it anyway..
patches against the 3.1.0-020399 snapshot.

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).

See the spec file for details... (sowwy :( for that)

Cheers Ric

PS the snapshot runs like a charm =) pdf's work etc. At least I didn't
notice any irregularities yet.

--- htdig-3.1.0-020399/htdig/Makefile.in.rkorig Thu Feb 4 12:16:35 1999
+++ htdig-3.1.0-020399/htdig/Makefile.in Thu Feb 4 12:16:58 1999
@@ -21,7 +21,7 @@
 
 install: $(TARGET)
         transform=@program_transform_name@
- $(INSTALL_PROGRAM) $(TARGET) $(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
+ $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
 
 clean:
         rm -f $(TARGET) $(OBJS) *~ *.bak *% a.out *.orig core
--- htdig-3.1.0-020399/htfuzzy/Makefile.in.rkorig Thu Feb 4 12:17:13 1999
+++ htdig-3.1.0-020399/htfuzzy/Makefile.in Thu Feb 4 12:18:19 1999
@@ -30,7 +30,7 @@
 
 install: $(TARGET)
         transform=@program_transform_name@
- $(INSTALL_PROGRAM) $(TARGET) $(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
+ $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
 
 clean:
         rm -f $(TARGET) $(LIBTARGET) $(OBJS) *~ *.bak *% a.out *.orig core
--- htdig-3.1.0-020399/htmerge/Makefile.in.rkorig Thu Feb 4 12:18:29 1999
+++ htdig-3.1.0-020399/htmerge/Makefile.in Thu Feb 4 12:18:45 1999
@@ -19,7 +19,7 @@
 
 install: $(TARGET)
         transform=@program_transform_name@
- $(INSTALL_PROGRAM) $(TARGET) $(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
+ $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
 
 clean:
         rm -f $(OBJS) $(TARGET) *~ *% *.bak core a.out *.orig
--- htdig-3.1.0-020399/htnotify/Makefile.in.rkorig Thu Feb 4 12:18:56 1999
+++ htdig-3.1.0-020399/htnotify/Makefile.in Thu Feb 4 12:19:09 1999
@@ -20,7 +20,7 @@
 
 install: $(TARGET)
         transform=@program_transform_name@
- $(INSTALL_PROGRAM) $(TARGET) $(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
+ $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(BIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
 
 clean:
         rm -f $(TARGET) $(OBJS) *~ *.bak *% a.out *.orig core
--- htdig-3.1.0-020399/htsearch/Makefile.in.rkorig Thu Feb 4 12:19:24 1999
+++ htdig-3.1.0-020399/htsearch/Makefile.in Thu Feb 4 12:19:39 1999
@@ -22,7 +22,7 @@
 
 install: all
         transform=@program_transform_name@
- $(INSTALL_PROGRAM) $(TARGET) $(CGIBIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
+ $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(CGIBIN_DIR)/`echo $(TARGET) | sed '$(transform)'`
 
 clean:
         rm -f $(OBJS) $(TARGET) *~ *.bak *% core *.orig a.out
--- htdig-3.1.0-020399/CONFIG.in.rkorig Thu Feb 4 11:38:51 1999
+++ htdig-3.1.0-020399/CONFIG.in Thu Feb 4 11:56:59 1999
@@ -23,19 +23,19 @@
 #
 # This specifies the root of the directory tree to be used by ht://Dig
 #
-DEST= $(prefix)
+DEST= @localstatedir@
 
 #
 # BIN_DIR
 # Set this macro to where you want the binaries to be installed.
 #
-BIN_DIR= $(exec_prefix)/bin
+BIN_DIR= @bindir@
 
 #
 # CONFIG_DIR
 # This is the directory that contains ht://Dig configuration files
 #
-CONFIG_DIR= $(DEST)/conf
+CONFIG_DIR= @sysconfdir@
 
 #
 # COMMON_DIR
--- htdig-3.1.0-020399/Makefile.in.rkorig Thu Feb 4 12:04:52 1999
+++ htdig-3.1.0-020399/Makefile.in Thu Feb 4 12:57:30 1999
@@ -82,7 +82,7 @@
         @echo ""
         @echo "Creating directories (if needed)..."
         -@for i in $(CREATEDIRS); do \
- $(top_srcdir)/mkinstalldirs $$i; \
+ $(top_srcdir)/mkinstalldirs $(INSTALL_ROOT)$$i; \
         done && test -z "$$fail"
         @echo ""
         @echo "Installing individual programs..."
@@ -91,24 +91,24 @@
         done && test -z "$$fail"
         @echo ""
         @echo "Installing default configuration files..."
- @if [ ! -f $(CONFIG_DIR)/htdig.conf ]; then sed -e s%@DATABASE_DIR@%$(DATABASE_DIR)% -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/htdig.conf >$(CONFIG_DIR)/htdig.conf; echo $(CONFIG_DIR)/htdig.conf;fi
- @if [ ! -f $(COMMON_DIR)/bad_words ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/bad_words $(COMMON_DIR); echo $(COMMON_DIR)/bad_words; fi
- @if [ ! -f $(SEARCH_DIR)/$(SEARCH_FORM) ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/search.html >$(SEARCH_DIR)/$(SEARCH_FORM); echo $(SEARCH_DIR)/$(SEARCH_FORM);fi
- @if [ ! -f $(COMMON_DIR)/footer.html ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/footer.html >$(COMMON_DIR)/footer.html; echo $(COMMON_DIR)/footer.html;fi
- @if [ ! -f $(COMMON_DIR)/header.html ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/header.html >$(COMMON_DIR)/header.html; echo $(COMMON_DIR)/header.html;fi
- @if [ ! -f $(COMMON_DIR)/wrapper.html ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/wrapper.html >$(COMMON_DIR)/wrapper.html; echo $(COMMON_DIR)/wrapper.html;fi
- @if [ ! -f $(COMMON_DIR)/nomatch.html ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/nomatch.html >$(COMMON_DIR)/nomatch.html; echo $(COMMON_DIR)/nomatch.html;fi
- @if [ ! -f $(COMMON_DIR)/syntax.html ]; then sed -e s%@IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/syntax.html >$(COMMON_DIR)/syntax.html; echo $(COMMON_DIR)/syntax.html;fi
- @if [ ! -f $(COMMON_DIR)/english.0 ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/english.0 $(COMMON_DIR); echo $(COMMON_DIR)/english.0;fi
- @if [ ! -f $(COMMON_DIR)/english.aff ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/english.aff $(COMMON_DIR); echo $(COMMON_DIR)/english.aff;fi
- @if [ ! -f $(COMMON_DIR)/synonyms ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/synonyms $(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 $(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
         @echo "Installing images..."
         @for i in $(IMAGES); do \
- if [ ! -f $(IMAGE_DIR)/$$i ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/$$i $(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 $(IMAGE_DIR)/$$i;fi; \
         done && test -z "$$fail"
         @echo "Creating rundig script..."
- @if [ ! -f $(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 >$(BIN_DIR)/rundig; \
+ @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; \
         fi
         @echo "Installation done."

--- 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 = "";

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
#Source1: htdig-%{PACKAGE_VERSION}-htdig.conf
#Source2: htdig-%{PACKAGE_VERSION}-rundig
Patch0: htdig.patch
Patch1: htdig-egcs.patch
URL: http://www.htdig.org/
Packager: Gilles Detillieux <grdetil@scrc.umanitoba.ca>

%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

%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/htdig \
        --with-cgi-bin-dir=/home/httpd/htdig/cgi-bin \
        --with-search-dir=/home/httpd/htdig
make

%install

test -n "$RPM_BUILD_ROOT" -a x"/" != x"$RPM_BUILD_ROOT" && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/htdig
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
mkdir -p $RPM_BUILD_ROOT/home/httpd/htdig/cgi-bin
#mkdir -p $RPM_BUILD_ROOT/home/httpd/htdig/images
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/var/lib/htdig/common
mkdir -p $RPM_BUILD_ROOT/var/lib/htdig/db

make INSTALL_ROOT=$RPM_BUILD_ROOT install
chmod -R go-w $RPM_BUILD_ROOT/home/httpd/htdig
chmod a-x $RPM_BUILD_ROOT/var/lib/htdig/common/*
strip $RPM_BUILD_ROOT/usr/sbin/ht* $RPM_BUILD_ROOT/home/httpd/htdig/cgi-bin/htsearch
#install -m644 $RPM_SOURCE_DIR/htdig-%{PACKAGE_VERSION}-htdig.conf \
# $RPM_BUILD_ROOT/etc/htdig/htdig.conf
#install -m755 $RPM_SOURCE_DIR/htdig-%{PACKAGE_VERSION}-rundig \
# $RPM_BUILD_ROOT/usr/sbin/rundig
chmod 755 $RPM_BUILD_ROOT/usr/sbin/rundig
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/htdig/htdoc

%clean
test -n "$RPM_BUILD_ROOT" -a x"/" != x"$RPM_BUILD_ROOT" && 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
/etc/cron.daily/htdig-dbgen
/usr/sbin/htdig
/usr/sbin/htfuzzy
/usr/sbin/htmerge
/usr/sbin/htnotify
/var/lib/htdig
/home/httpd/htdig

%doc CONFIG README htdoc/*

%changelog
* Thu Feb 4 1999 Ric Klaren <klaren@telin.nl>
  - 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 <grdetil@scrc.umanitoba.ca>
  - updated to 3.1.0b4

* Tue Dec 15 1998 Gilles Detillieux <grdetil@scrc.umanitoba.ca>
  - updated to 3.1.0b3, changed version number & rundig script accordingly

* Thu Nov 5 1998 Gilles Detillieux <grdetil@scrc.umanitoba.ca>
  - patched htdoc/where.html to reflect latest version

* Tue Nov 3 1998 Gilles Detillieux <grdetil@scrc.umanitoba.ca>
  - updated to 3.1.0b2, changed patches accordingly

* Tue Sep 22 1998 Gilles Detillieux <grdetil@scrc.umanitoba.ca>
  - 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 <grdetil@scrc.umanitoba.ca>
  - Built the rpm from latest htdig source (3.1.0b1), using earlier
    versions of rpms by Mihai Ibanescu <misa@dntis.ro> and Elliot Lee
    <sopwith@cuc.edu> as a model, incorporating ideas from both. I've
    made the install locations as FSSTND compliant as I can think of.

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Thu Feb 04 1999 - 22:20:31 PST