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.
This commit is contained in:
parent
17ac015854
commit
b3bfb33728
5 changed files with 100 additions and 13 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
30
www/wwwoffle/files/wwwoffled
Normal file
30
www/wwwoffle/files/wwwoffled
Normal file
|
@ -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"
|
|
@ -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
|
||||
|
||||
======================================================================
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue