summaryrefslogtreecommitdiff
path: root/source/n/htdig
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committerEric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/n/htdig
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/n/htdig')
-rw-r--r--source/n/htdig/doinst.sh14
-rw-r--r--source/n/htdig/htdig-3.2.0b6.diff333
-rwxr-xr-xsource/n/htdig/htdig.SlackBuild138
-rw-r--r--source/n/htdig/htdig.conf.diff16
-rw-r--r--source/n/htdig/slack-desc19
5 files changed, 520 insertions, 0 deletions
diff --git a/source/n/htdig/doinst.sh b/source/n/htdig/doinst.sh
new file mode 100644
index 00000000..1f730e07
--- /dev/null
+++ b/source/n/htdig/doinst.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+config etc/htdig/htdig.conf.new
+
diff --git a/source/n/htdig/htdig-3.2.0b6.diff b/source/n/htdig/htdig-3.2.0b6.diff
new file mode 100644
index 00000000..72e195ee
--- /dev/null
+++ b/source/n/htdig/htdig-3.2.0b6.diff
@@ -0,0 +1,333 @@
+--- ./db/os_rw.c.orig 2004-01-12 06:48:24.000000000 -0600
++++ ./db/os_rw.c 2007-04-07 17:29:44.000000000 -0500
+@@ -5,6 +5,14 @@
+ * Sleepycat Software. All rights reserved.
+ */
+
++
++#define _XOPEN_SOURCE 500
++#include <sys/types.h>
++#include <unistd.h>
++#ifndef u_long
++typedef __u_long u_long;
++#endif
++
+ #include "db_config.h"
+
+ #ifndef lint
+--- ./db/hash.c.orig 2004-06-11 11:44:35.000000000 -0500
++++ ./db/hash.c 2007-04-07 17:29:44.000000000 -0500
+@@ -250,6 +250,11 @@
+ hashp->h_hash = hcp->hdr->dbmeta.version < 5
+ ? CDB___ham_func4 : CDB___ham_func5;
+
++ /* Make sure we always have a valid hashp->h_hash function. */
++ if (hashp->h_hash == NULL)
++ hashp->h_hash = hcp->hdr->dbmeta.version < 5
++ ? CDB___ham_func4 : CDB___ham_func5;
++
+ err2: /* Release the meta data page */
+ if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0)
+ ret = t_ret;
+--- ./htdig/Server.cc.orig 2004-05-28 08:15:16.000000000 -0500
++++ ./htdig/Server.cc 2007-04-07 17:29:44.000000000 -0500
+@@ -341,6 +341,8 @@
+ {
+ String fullpatt = "^[^:]*://[^/]*(";
+ fullpatt << pattern << ')';
++ if (pattern.length() == 0)
++ fullpatt = "";
+ _disallow.set(fullpatt, config->Boolean("case_sensitive"));
+ }
+ }
+--- ./htfuzzy/Regexp.cc.orig 2004-05-28 08:15:20.000000000 -0500
++++ ./htfuzzy/Regexp.cc 2007-04-07 17:29:45.000000000 -0500
+@@ -73,16 +73,16 @@
+ int wordCount = 0;
+ int maximumWords = config.Value("regex_max_words", 25);
+
+- wordList->Start_Get();
+- while (wordCount < maximumWords && (key = (String *) wordList->Get_Next()))
+- {
+- if (regexMatch.match(*key, 0, 0) != 0)
+- {
+- words.Add(new String(*key));
+- wordCount++;
+- }
+- }
+ if (wordList) {
++ wordList->Start_Get();
++ while (wordCount < maximumWords && (key = (String *) wordList->Get_Next()))
++ {
++ if (regexMatch.match(*key, 0, 0) != 0)
++ {
++ words.Add(new String(*key));
++ wordCount++;
++ }
++ }
+ wordList->Destroy();
+ delete wordList;
+ }
+--- ./htfuzzy/Substring.cc.orig 2004-05-28 08:15:20.000000000 -0500
++++ ./htfuzzy/Substring.cc 2007-04-07 17:29:45.000000000 -0500
+@@ -73,16 +73,16 @@
+ int wordCount = 0;
+ int maximumWords = config.Value("substring_max_words", 25);
+
+- wordList->Start_Get();
+- while (wordCount < maximumWords && (key = (String *) wordList->Get_Next()))
+- {
+- if (match.FindFirst((char*)*key) >= 0)
+- {
+- words.Add(new String(*key));
+- wordCount++;
+- }
+- }
+ if (wordList) {
++ wordList->Start_Get();
++ while (wordCount < maximumWords && (key = (String *) wordList->Get_Next()))
++ {
++ if (match.FindFirst((char*)*key) >= 0)
++ {
++ words.Add(new String(*key));
++ wordCount++;
++ }
++ }
+ wordList->Destroy();
+ delete wordList;
+ }
+--- ./htfuzzy/htfuzzy.cc.orig 2004-05-28 08:15:20.000000000 -0500
++++ ./htfuzzy/htfuzzy.cc 2007-04-07 17:29:45.000000000 -0500
+@@ -153,8 +153,9 @@
+ String word, fuzzyKey;
+ int count = 0;
+
+- words->Start_Get();
+- while ((key = (String *) words->Get_Next()))
++ if (words)
++ words->Start_Get();
++ while (words && (key = (String *) words->Get_Next()))
+ {
+ word = *key;
+ wordAlgorithms.Start_Get();
+@@ -185,8 +186,11 @@
+ fuzzy->writeDB();
+ }
+ worddb.Close();
+- words->Destroy();
+- delete words;
++ if (words)
++ {
++ words->Destroy();
++ delete words;
++ }
+ if (fuzzy)
+ delete fuzzy;
+ }
+--- ./htfuzzy/Prefix.cc.orig 2004-05-28 08:15:20.000000000 -0500
++++ ./htfuzzy/Prefix.cc 2007-04-07 17:29:45.000000000 -0500
+@@ -99,9 +99,10 @@
+ WordReference *word_ref;
+ String last_word;
+
+- wordList->Start_Get();
+- while (wordCount < maximumWords && (word_ref = (WordReference *) wordList->Get_Next() ))
+- {
++ if (wordList) {
++ wordList->Start_Get();
++ while (wordCount < maximumWords && (word_ref = (WordReference *) wordList->Get_Next() ))
++ {
+ s = word_ref->Key().GetWord();
+
+ // If we're somehow past the original word, we're done
+@@ -115,8 +116,7 @@
+ last_word = s;
+ words.Add(new String(s));
+ wordCount++;
+- }
+- if (wordList) {
++ }
+ wordList->Destroy();
+ delete wordList;
+ }
+--- ./htfuzzy/Fuzzy.cc.orig 2004-05-28 08:15:20.000000000 -0500
++++ ./htfuzzy/Fuzzy.cc 2007-04-07 17:29:45.000000000 -0500
+@@ -61,7 +61,11 @@
+ delete index;
+ index = 0;
+ }
+- delete dict;
++ if (dict)
++ {
++ delete dict;
++ dict = 0;
++ }
+ }
+
+
+@@ -154,8 +158,9 @@
+
+ int count = 0;
+
+- dict->Start_Get();
+- while ((fuzzyKey = dict->Get_Next()))
++ if (dict)
++ dict->Start_Get();
++ while (dict && (fuzzyKey = dict->Get_Next()))
+ {
+ s = (String *) dict->Find(fuzzyKey);
+ index->Put(fuzzyKey, *s);
+--- ./htsearch/Display.cc.orig 2004-05-28 08:15:24.000000000 -0500
++++ ./htsearch/Display.cc 2007-04-07 17:29:44.000000000 -0500
+@@ -54,6 +54,7 @@
+
+ #include <math.h>
+ #include <float.h>
++#include <values.h>
+
+ #if !defined(DBL_MAX)
+ # if defined (MAXDOUBLE)
+--- ./htsearch/htsearch.cc.orig 2004-05-28 08:15:24.000000000 -0500
++++ ./htsearch/htsearch.cc 2007-04-07 17:29:44.000000000 -0500
+@@ -211,8 +211,7 @@
+ }
+ if (access((char*)configFile, R_OK) < 0)
+ {
+- reportError(form("Unable to read configuration file '%s'",
+- configFile.get()));
++ reportError("Unable to read configuration file");
+ }
+ config->Read(configFile);
+
+--- ./htsearch/qtest.cc.orig 2004-05-28 08:15:25.000000000 -0500
++++ ./htsearch/qtest.cc 2007-04-07 17:29:44.000000000 -0500
+@@ -132,8 +132,7 @@
+
+ if (access((char*)configFile, R_OK) < 0)
+ {
+- reportError(form("Unable to find configuration file '%s'",
+- configFile.get()));
++ reportError("Unable to find configuration file");
+ }
+
+ config->Read(configFile);
+--- ./htsearch/Collection.h.orig 2004-05-28 08:15:24.000000000 -0500
++++ ./htsearch/Collection.h 2007-04-07 17:29:45.000000000 -0500
+@@ -36,9 +36,9 @@
+ const char *docExcerpt);
+ ~Collection();
+
+- void Collection::Open();
++ void Open();
+
+- void Collection::Close();
++ void Close();
+
+ char *getWordFile() { return wordFile.get(); }
+ DocumentRef *getDocumentRef(int id);
+--- ./htword/WordDBPage.cc.orig 2004-05-28 08:15:26.000000000 -0500
++++ ./htword/WordDBPage.cc 2007-04-07 17:29:44.000000000 -0500
+@@ -82,7 +82,7 @@
+ if(debuglevel>2)printf("TOTAL SIZE: %6d %8f\n",size,size/8.0);
+ // argh! compare failed somthing went wrong
+ // display the compress/decompress sequence and fail
+- if(cmp || size>8*1024*1000000000)
++ if(cmp || size>8*1024)
+ {
+ if(size>8*1024)
+ {
+--- ./installdir/rundig.orig 2007-04-07 17:29:45.000000000 -0500
++++ ./installdir/rundig 2007-04-07 17:29:45.000000000 -0500
+@@ -14,6 +14,7 @@
+
+ # To help debug problems, try running rundig -vvv
+ # This will add lots of debugging output to all of the programs
++incremental=0
+ stats= opts= alt=
+ while [ "$#" -gt 0 ]
+ do
+@@ -24,6 +25,7 @@
+ conffile="$1"
+ opts="$opts -c $conffile"
+ ;;
++ +i) incremental=1;;
+ *) opts="$opts $1" ;; # e.g. -v
+ esac
+ shift
+@@ -53,7 +55,13 @@
+ TMPDIR=$DBDIR
+ export TMPDIR
+
+-$BINDIR/htdig -i $opts $stats $alt
++if [ $incremental -ne 0 ]
++then
++ $BINDIR/htdig $opts $stats $alt
++else
++ $BINDIR/htdig -i $opts $stats $alt
++fi
++
+ $BINDIR/htpurge $opts $alt
+ case "$alt" in
+ -a)
+--- ./installdir/htdig.conf.orig 2004-02-08 04:19:33.000000000 -0600
++++ ./installdir/htdig.conf 2007-04-07 17:29:44.000000000 -0500
+@@ -18,6 +18,18 @@
+ database_dir: @DATABASE_DIR@
+
+ #
++# Define common_dir, which is used in several of the examples.
++#
++common_dir: /var/www/html/htdig
++
++#
++# Disable the translation of the ISO Latin 1 SGML entities from the
++# documents into upper end 8-bit characters in the database,
++# and then back to the Latin 1 SGML entities in htsearch results.
++#
++translate_latin1: false
++
++#
+ # This specifies the URL where the robot (htdig) will start. You can specify
+ # multiple URLs here. Just separate them by some whitespace.
+ # The example here will cause the ht://Dig homepage and related pages to be
+@@ -25,7 +37,7 @@
+ # You could also index all the URLs in a file like so:
+ # start_url: `${common_dir}/start.url`
+ #
+-start_url: http://www.htdig.org/
++start_url: http://localhost
+
+ #
+ # This attribute limits the scope of the indexing process. The default is to
+@@ -76,7 +88,7 @@
+ # The string htdig will send in every request to identify the robot. Change
+ # this to your email address.
+ #
+-maintainer: unconfigured@htdig.searchengine.maintainer
++maintainer: root@localhost
+
+ #
+ # The excerpts that are displayed in long results rely on stored information
+--- ./installdir/rundig.1.in.orig 2004-03-12 02:11:06.000000000 -0600
++++ ./installdir/rundig.1.in 2007-04-07 17:29:46.000000000 -0500
+@@ -23,6 +23,9 @@
+ .TP
+ .B \-c configfile
+ Use alternate config file.
++.TP
++.B \+i
++Use incremental digging instead non-incremental
+ .SH "SEE ALSO"
+ Please refer to the HTML pages (in the htdig-doc package)
+ .B /usr/share/doc/htdig-doc/html/index.html
+--- ./configure.orig 2004-06-14 03:25:31.000000000 -0500
++++ ./configure 2007-04-07 17:29:44.000000000 -0500
+@@ -28034,7 +28034,7 @@
+ APACHE_REQUEST=`echo 1.3.1 | sed -e 's/\.//g'`
+ APACHE_REQUEST_MAJOR=`expr $APACHE_REQUEST : '\(..\)'`
+ APACHE_REQUEST_MINOR=`expr $APACHE_REQUEST : '..\(.*\)'`
+- if test "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" -o "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" ; then
++ if test "$APACHE_MAJOR" -eq "APACHE_REQUEST_MAJOR" -a "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" -o "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" ; then
+ echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6
+ { { echo "$as_me:$LINENO: error: apache version is $APACHE_READABLE_VERSION" >&5
diff --git a/source/n/htdig/htdig.SlackBuild b/source/n/htdig/htdig.SlackBuild
new file mode 100755
index 00000000..1451b4c2
--- /dev/null
+++ b/source/n/htdig/htdig.SlackBuild
@@ -0,0 +1,138 @@
+#!/bin/sh
+
+# Copyright 2006, 2007, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=htdig
+VERSION=${VERSION:-3.2.0b6}
+ARCH=${ARCH:-x86_64}
+NUMJOBS=${NUMJOBS:-" -j7 "}
+BUILD=${BUILD:-3}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-${PKGNAM}
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+fi
+
+cd $TMP
+rm -rf ${PKGNAM}-${VERSION}
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1
+cd ${PKGNAM}-$VERSION
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Get htdig-beta working again with new gcc/glibc/kernel:
+zcat $CWD/htdig-3.2.0b6.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix "common dir" location and add "synonym_dictionary" entry:
+zcat $CWD/htdig.conf.diff.gz | patch -p1 --verbose || exit 1
+
+# Configure:
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib/htdig \
+ --with-apache=/usr/sbin/httpd \
+ --with-cgi-bin-dir=/var/www/cgi-bin \
+ --with-config-dir=/etc/htdig \
+ --with-common-dir=/var/www/htdocs/htdig \
+ --with-database-dir=/var/lib/htdig \
+ --with-default-config-file=/etc/htdig/htdig.conf \
+ --with-image-dir=/var/www/htdocs/htdig \
+ --with-search-dir=/var/www/htdocs/htdig \
+ --with-ssl \
+ --with-zlib=/usr \
+ --mandir=/usr/man \
+ --enable-bigfile \
+ --enable-shared \
+ --disable-static \
+ --enable-tests \
+ --program-prefix= \
+ --program-suffix= \
+ --build=$ARCH-slackware-linux
+
+# Build and install:
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+mv $PKG/etc/htdig/htdig.conf $PKG/etc/htdig/htdig.conf.new
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.*
+ )
+ done
+ )
+fi
+
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ ( cd $PKG/usr/info
+ rm -f dir
+ gzip -9 *
+ )
+fi
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS CHANGES COPYING LICENSE README \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/n/htdig/htdig.conf.diff b/source/n/htdig/htdig.conf.diff
new file mode 100644
index 00000000..a80c707b
--- /dev/null
+++ b/source/n/htdig/htdig.conf.diff
@@ -0,0 +1,16 @@
+--- ./installdir/htdig.conf.orig 2007-04-23 17:06:21.000000000 -0500
++++ ./installdir/htdig.conf 2007-04-23 17:08:46.000000000 -0500
+@@ -20,7 +20,12 @@
+ #
+ # Define common_dir, which is used in several of the examples.
+ #
+-common_dir: /var/www/html/htdig
++common_dir: /var/www/htdocs/htdig
++
++#
++# Define synonyms dictionary.
++#
++synonym_dictionary: /var/www/htdocs/htdig/synonyms
+
+ #
+ # Disable the translation of the ISO Latin 1 SGML entities from the
diff --git a/source/n/htdig/slack-desc b/source/n/htdig/slack-desc
new file mode 100644
index 00000000..7436cf16
--- /dev/null
+++ b/source/n/htdig/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+htdig: htdig (web indexing and searching system)
+htdig:
+htdig: The ht://Dig system is a complete web indexing and searching system
+htdig: for a small domain or intranet. This system is not indended to
+htdig: replace the need for outside Internet search engines such as Google,
+htdig: but rather to cover the search needs for a single company, campus, or
+htdig: even a particular sub section of a web site.
+htdig:
+htdig:
+htdig:
+htdig: