summaryrefslogtreecommitdiff
path: root/www/wwwoffle
diff options
context:
space:
mode:
authorfredb <fredb@pkgsrc.org>2001-03-12 18:05:24 +0000
committerfredb <fredb@pkgsrc.org>2001-03-12 18:05:24 +0000
commitb3bfb337282e5e3ca01544139abc75df2f0b6cf7 (patch)
tree467b4090a689186807f523af5a55a26b05aed886 /www/wwwoffle
parent17ac01585426f2b80bc12928da8423cd8d6d806d (diff)
downloadpkgsrc-b3bfb337282e5e3ca01544139abc75df2f0b6cf7.tar.gz
Some tweaks to the package:
- - Add a new-style rc.d script. - - Fix the included "htdig" scripts to work with packaged "htdig". ("htdig" remains optional.) - - Install the convert-cache and upgrade-config-pl tools to make upgrading less painful. Run convert-cache automatically for binary package install, but only suggest to for source install. - - Expand the MESSAGE text to explain how to use all this.
Diffstat (limited to 'www/wwwoffle')
-rw-r--r--www/wwwoffle/Makefile34
-rw-r--r--www/wwwoffle/files/patch-sum4
-rw-r--r--www/wwwoffle/files/wwwoffled30
-rw-r--r--www/wwwoffle/pkg/MESSAGE31
-rw-r--r--www/wwwoffle/pkg/PLIST14
5 files changed, 100 insertions, 13 deletions
diff --git a/www/wwwoffle/Makefile b/www/wwwoffle/Makefile
index 4354a1473e2..c5b2437b5ec 100644
--- a/www/wwwoffle/Makefile
+++ b/www/wwwoffle/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2001/02/25 04:18:25 hubertf Exp $
+# $NetBSD: Makefile,v 1.27 2001/03/12 18:05:24 fredb Exp $
DISTNAME= wwwoffle-2.6
CATEGORIES= www
@@ -18,7 +18,7 @@ COMMENT= WWW proxy with support for offline browsing
USE_GMAKE= yes
NO_CONFIGURE= yes
-PLIST_SUBST+= GTAR=${GTAR}
+PLIST_SUBST+= GTAR="${GTAR}" MKDIR="${MKDIR}" PREFIX="${PREFIX}"
BUILD_DEFS+= USE_INET6
@@ -29,14 +29,23 @@ MAKE_ENV+= LIBRARY="-lnsl -lsocket"
.endif
post-build:
+ cd ${WRKSRC}/html/search/htdig/scripts; \
+ for f in wwwoffle-ht*; do \
+ ${MV} $$f $$f.old; \
+ ${SED} -e '/htsearch/s#^#${PREFIX}/libexec/cgi-bin/#' \
+ -e 's#/usr/local#${PREFIX}#' <$$f.old >$$f; \
+ ${RM} $$f.old; \
+ done
@${SED} -e 's#@PREFIX@#${PREFIX}#g' <${FILESDIR}/wwwoffle.sh \
>${WRKDIR}/wwwoffle.sh
+ @${SED} -e 's#@PREFIX@#${PREFIX}#g' <${FILESDIR}/wwwoffled \
+ >${WRKDIR}/wwwoffled
pre-install:
${INSTALL_DATA_DIR} ${PREFIX}/etc/wwwoffle
if [ -d /var/wwwoffle ]; then \
${RM} -rf /var/wwwoffle/html.old; \
- ${INSTALL_DATA_DIR} /var/wwwoffle/http; \
+ ${INSTALL_DATA_DIR} /var/wwwoffle/prevtime1; \
fi
post-install:
@@ -47,10 +56,23 @@ post-install:
${CP} -p ${PREFIX}/etc/wwwoffle/wwwoffle.conf \
${PREFIX}/etc/wwwoffle/wwwoffle.conf.default; \
fi
+ ${INSTALL_PROGRAM} ${WRKSRC}/convert-cache ${PREFIX}/sbin/convert-cache
+ ${INSTALL_SCRIPT} ${WRKSRC}/upgrade-config.pl ${PREFIX}/sbin/wwwoffle-upgrade-config.pl
${INSTALL_SCRIPT} ${WRKDIR}/wwwoffle.sh ${PREFIX}/etc/rc.d/wwwoffle
- ${CHOWN} -R -h ${BINOWN}:${BINGRP} /var/wwwoffle
+ ${INSTALL_SCRIPT} ${WRKDIR}/wwwoffled ${PREFIX}/etc/rc.d
# directories other than html are automatically created at run time
- ${GTAR} czCf / ${PREFIX}/libdata/wwwoffle-spool.tar.gz \
- var/wwwoffle/html var/wwwoffle/outgoing
+ ${GTAR} czCf / ${PREFIX}/libdata/wwwoffle-spool.tar.gz var/wwwoffle/html
+ @${ECHO}
+ @${ECHO} ==+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=
+ @${ECHO}
+ @${ECHO} Attention pkgsrc source users:
+ @${ECHO}
+ @${ECHO} If your are upgrading from an older version of wwwoffle,
+ @${ECHO} your cache will not be converted automatically. Please do
+ @${ECHO} so by executing the command
+ @${ECHO} \"${PREFIX}/libexec/convert-cache /var/wwwoffle\".
+ @${ECHO}
+ @${ECHO} ==+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=
+ @${ECHO}
.include "../../mk/bsd.pkg.mk"
diff --git a/www/wwwoffle/files/patch-sum b/www/wwwoffle/files/patch-sum
index 3f9825f35ee..c3dd5b159dd 100644
--- a/www/wwwoffle/files/patch-sum
+++ b/www/wwwoffle/files/patch-sum
@@ -1,3 +1,3 @@
-$NetBSD: patch-sum,v 1.11 2000/11/20 05:12:38 itojun Exp $
+$NetBSD: patch-sum,v 1.12 2001/03/12 18:05:25 fredb Exp $
-MD5 (patch-aa) = e3f0fba77d933f06ed9b8abc753d2f11
+SHA1 (patch-aa) = fa1002e65a41690cd1df1e488014470e94097f7f
diff --git a/www/wwwoffle/files/wwwoffled b/www/wwwoffle/files/wwwoffled
new file mode 100644
index 00000000000..f65dd2200c0
--- /dev/null
+++ b/www/wwwoffle/files/wwwoffled
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $NetBSD: wwwoffled,v 1.1 2001/03/12 18:05:25 fredb Exp $
+#
+
+# PROVIDE: wwwoffled
+# REQUIRE: DAEMON network
+
+. /etc/rc.subr
+
+name="wwwoffled"
+command="@PREFIX@/sbin/${name}"
+control_prog="@PREFIX@/bin/wwwoffle"
+command_args="-c @PREFIX@/etc/wwwoffle/wwwoffle.conf"
+required_files="@PREFIX@/etc/wwwoffle/wwwoffle.conf"
+start_cmd=wwwoffled_start
+stop_cmd="${control_prog} -kill"
+autodial_cmd="${control_prog} -autodial ${command_args}"
+offline_cmd="${control_prog} -offline ${command_args}"
+online_cmd="${control_prog} -online ${command_args}"
+extra_commands="autodial offline online"
+
+wwwoffled_start() {
+ eval "${command} ${command_args}"
+ eval "${control_prog} -online ${command_args}"
+ eval "${control_prog} -fetch ${command_args}"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/www/wwwoffle/pkg/MESSAGE b/www/wwwoffle/pkg/MESSAGE
index 909e2c5cdb7..c78711ba71e 100644
--- a/www/wwwoffle/pkg/MESSAGE
+++ b/www/wwwoffle/pkg/MESSAGE
@@ -1,6 +1,33 @@
======================================================================
-$NetBSD: MESSAGE,v 1.5 2001/01/29 11:34:47 wiz Exp $
+$NetBSD: MESSAGE,v 1.6 2001/03/12 18:05:25 fredb Exp $
-Please add "${PREFIX}/etc/rc.d/wwwoffle" to "/etc/rc.local".
+1) To enable "wwwwoffled" to start on boot on NetBSD-1.5 or newer,
+please copy "${PREFIX}/etc/rc.d/wwwoffled" to "/etc/rc.d/" and add
+"wwwoffled=YES" to /etc/rc.conf. To do the same on older systems,
+add the following to /etc/rc.local:
+
+if [ -x ${PREFIX}/etc/rc.d/wwwoffle ]; then
+ ${PREFIX}/etc/rc.d/wwwoffle
+fi
+
+2) If this was an upgrade, your cache may have been converted and
+re-indexed automatically. If not, you may do so by executing the
+command "${PREFIX}/sbin/convert-cache /var/wwwoffle". To upgrade
+your wwwoffle.conf file, try the perl script
+"${PREFIX}/sbin/wwwoffle-upgrade-config.pl".
+
+3) The hooks are present to to use the package version of "htdig",
+if installed, to serve a searchable index of your cached pages.
+To make the word database, start "wwwoffle" and execute the script
+"/var/wwwoffle/html/search/htdig/scripts/wwwoffle-htdig-full".
+
+4) A complete installation will purge the cache (and optionally
+reindex the database for "htdig") periodically, as by the following
+example "crontab fragment":
+
+# wwwoffle proxy maintenance
+01 1 * * 0-5 /usr/bin/nice /usr/pkg/bin/wwwoffle -purge -c /usr/pkg/etc/wwwoffle/wwwoffle.conf && /bin/sh /var/wwwoffle/html/search/htdig/scripts/wwwoffle-htdig-incr
+01 1 * * 6 /usr/bin/nice /usr/pkg/bin/wwwoffle -purge -c /usr/pkg/etc/wwwoffle/wwwoffle.conf && /bin/sh /var/wwwoffle/html/search/htdig/scripts/wwwoffle-htdig-full
======================================================================
+
diff --git a/www/wwwoffle/pkg/PLIST b/www/wwwoffle/pkg/PLIST
index c7997d29e14..1349bbff01e 100644
--- a/www/wwwoffle/pkg/PLIST
+++ b/www/wwwoffle/pkg/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.9 2001/01/29 11:34:47 wiz Exp $
+@comment $NetBSD: PLIST,v 1.10 2001/03/12 18:05:25 fredb Exp $
bin/wwwoffle
bin/wwwoffle-ls
bin/wwwoffle-mv
@@ -7,12 +7,15 @@ bin/wwwoffle-rm
bin/wwwoffle-tools
bin/wwwoffle-write
etc/rc.d/wwwoffle
+etc/rc.d/wwwoffled
etc/wwwoffle/wwwoffle.conf.default
@exec if [ ! -f %D/etc/wwwoffle/wwwoffle.conf ]; then cp -p %D/etc/wwwoffle/wwwoffle.conf.default %D/etc/wwwoffle/wwwoffle.conf; fi
libdata/wwwoffle-spool.tar.gz
man/man1/wwwoffle.1
man/man5/wwwoffle.conf.5
man/man8/wwwoffled.8
+sbin/convert-cache
+sbin/wwwoffle-upgrade-config.pl
sbin/wwwoffled
share/doc/wwwoffle/CHANGES.CONF
share/doc/wwwoffle/CONVERT
@@ -32,6 +35,11 @@ share/doc/wwwoffle/README.win32
@dirrm share/doc/wwwoffle
@exec ${GTAR} xzCf / %D/libdata/wwwoffle-spool.tar.gz
@exec cd /var/wwwoffle/html && mv wwwoffle.pac wwwoffle.pac.dist && sed /PROXY/s/localhost/`hostname`/ <wwwoffle.pac.dist >wwwoffle.pac
-@unexec cd /var/wwwoffle && rm -rf html* lasttime outgoing prevtime* temp
-@unexec rmdir /var/wwwoffle/* 2>/dev/null && rmdir /var/wwwoffle ; :
+@exec ${MKDIR} /var/wwwoffle/outgoing
+@exec ${MKDIR} /var/wwwoffle/monitor
+@exec ${MKDIR} /var/wwwoffle/lastime
+@exec ${MKDIR} /var/wwwoffle/prevtime1
+@exec ${PREFIX}/sbin/convert-cache /var/wwwoffle
+@unexec cd /var/wwwoffle && rm -rf html*
+@unexec rmdir /var/wwwoffle/* 2>/dev/null && rmdir /var/wwwoffle 2>/dev/null || true
@unexec if [ -d /var/wwwoffle ]; then echo "If you won't use the WWWOFFLE package anymore, remove the cache manually by"; echo ' rm -rf /var/wwwoffle'; fi