File wwwoffle.spec of Package wwwoffle

#
# spec file for package wwwoffle (Version 2.9d)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           wwwoffle
BuildRequires:  flex gnutls-devel htdig zlib-devel
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Proxy
AutoReqProv:    on
Summary:        World Wide Web Offline Proxy
Url:            http://www.gedanken.demon.co.uk/wwwoffle/
Version:        2.9d
Release:        26
Source0:        http://www.gedanken.freeserve.co.uk/download-wwwoffle/%name-%version.tar.bz2
Source1:        rc.%name
Source3:        ip-up.%name
Source4:        ip-down.%name
Source5:        %name.cron
Patch0:         %name-2.8d-IndexProtocol.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_prereq %fillup_prereq
Requires:       cron

%description
A proxy HTTP server for computers with dial-up internet access.

- Caching of pages viewed while connected for review later.

- Browsing of cached pages while not connected, with the ability to
   follow links and mark other pages for download.

- Non-interactive downloading of specified pages.

- Multiple indices of pages stored in cache for easy selection.

- Interactive or command line option to select pages for fetching
   individually or recursively.

- All options controlled using a simple configuration file with a web
page to edit it.



Authors:
--------
    Andreas Dietrich <quasi@baccus.franken.de>
    Andrew M. Bishop <amb@gedanken.demon.co.uk>
    Axel Rasmus Wienberg <2wienbe@informatik.uni-hamburg.de>
    Tilman Bohn <tb@bohn.isdn.uni-heidelberg.de>
    Ullrich von Bassewitz <uz@wuschel.ibb.schwaben.com>
    Walter Pfannenmller <Walter.Pfannenmueller@t-online.de>
    Yannick Versley <sa6z225@public.uni-hamburg.de>

%prep
%setup -q
%patch0 -b _orig

%build
export LC_ALL=C
%configure \
		--with-confdir=%{_sysconfdir}/%{name} \
        --with-docdir=%_defaultdocdir/%{name} \
		--with-gnutls=%{_usr}
make

%install
export LC_ALL=C
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/%_sysconfdir/cron.{daily,weekly}
make DESTDIR=$RPM_BUILD_ROOT install
install -m 755 %SOURCE3 $RPM_BUILD_DIR
sed "s@/etc/wwwoffle\\.conf@/etc/wwwoffle/wwwoffle.conf@g" < doc/wwwoffled.man \
	> $RPM_BUILD_ROOT%_mandir/man8/wwwoffled.8
install -m 755 %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/wwwoffle
ln -fs ../../etc/init.d/wwwoffle $RPM_BUILD_ROOT/usr/sbin/rcwwwoffle
install -d -m 755 $RPM_BUILD_ROOT/var/adm/fillup-templates
install -d -m 755 $RPM_BUILD_ROOT/etc/ppp/ip-{up,down}.d
install -m 755 %SOURCE3 $RPM_BUILD_ROOT/%_sysconfdir/ppp/ip-up.d/%name
install -m 755 %SOURCE4 $RPM_BUILD_ROOT/%_sysconfdir/ppp/ip-down.d/%name
install -m 644 %SOURCE5 $RPM_BUILD_ROOT/%_sysconfdir/cron.weekly/%name
# run as wwwrun:www by default
pushd $RPM_BUILD_ROOT%_sysconfdir/wwwoffle
sed "s/^#run-uid.*/ run-uid           = wwwrun/
     s/^#run-gid.*/ run-gid           = www/" < wwwoffle.conf > wwwoffle.conf.t
mv wwwoffle.conf.t wwwoffle.conf
popd
rm -rf $RPM_BUILD_ROOT/usr/doc/wwwoffle
rm -rf $RPM_BUILD_ROOT/var/spool/wwwoffle/outgoing/*
rm -f doc/ANNOUNCE~

%post 
%fillup_and_insserv wwwoffle

%preun
%stop_on_removal wwwoffle

%postun
%restart_on_update wwwoffle
%insserv_cleanup

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
# docs
%doc ChangeLog* LSM contrib doc/*
%_mandir/man1/*
%_mandir/man5/*
%_mandir/man8/*
# wwwoffle configs
%config /etc/init.d/wwwoffle
%config(missingok,noreplace) %attr(755,root,root) %_sysconfdir/cron.weekly/%name
%dir %attr(750, wwwrun, root) /etc/wwwoffle
%config %attr(640, wwwrun, root) /etc/wwwoffle/wwwoffle.conf
%dir  /var/spool/wwwoffle/search/
# search configs for htdig
%dir /var/spool/wwwoffle/search/htdig
%dir /var/spool/wwwoffle/search/htdig/conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htfuzzy.conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htsearch.conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htdig-full.conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htdig-lasttime.conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htdig-incr.conf
%config(noreplace) /var/spool/wwwoffle/search/htdig/conf/htmerge.conf
# search configs for mnogosearch
%dir /var/spool/wwwoffle/search/mnogosearch
%dir /var/spool/wwwoffle/search/mnogosearch/conf
%config(noreplace) /var/spool/wwwoffle/search/mnogosearch/conf/indexer-full.old.conf
%config(noreplace) /var/spool/wwwoffle/search/mnogosearch/conf/result.html
%config(noreplace) /var/spool/wwwoffle/search/mnogosearch/conf/indexer-incr.old.conf
%config(noreplace) /var/spool/wwwoffle/search/mnogosearch/conf/indexer-full.conf
%config(noreplace) /var/spool/wwwoffle/search/mnogosearch/conf/indexer-incr.conf
# search configs for namazu
%dir /var/spool/wwwoffle/search/namazu
%dir /var/spool/wwwoffle/search/namazu/conf/
%config(noreplace) /var/spool/wwwoffle/search/namazu/conf/mknmzrc
%config(noreplace) /var/spool/wwwoffle/search/namazu/conf/namazurc
%dir %attr(750, wwwrun, root) /var/spool/wwwoffle
%dir                        /var/spool/wwwoffle/html
%doc                        /var/spool/wwwoffle/html/*
%dir %attr(-, wwwrun, root) /var/spool/wwwoffle/http
%dir %attr(-, wwwrun, root) /var/spool/wwwoffle/lasttime
%dir %attr(-, wwwrun, root) /var/spool/wwwoffle/monitor
%dir %attr(-, wwwrun, root) /var/spool/wwwoffle/outgoing
%dir %attr(-, wwwrun, root) /var/spool/wwwoffle/prevtime1
# rest of htdig
/var/spool/wwwoffle/search/htdig/db
/var/spool/wwwoffle/search/htdig/tmp
/var/spool/wwwoffle/search/htdig/scripts
/var/spool/wwwoffle/search/htdig/db-lasttime
# rest of mnogosearch
/var/spool/wwwoffle/search/mnogosearch/db
/var/spool/wwwoffle/search/mnogosearch/scripts
/var/spool/wwwoffle/search/udmsearch
# rest of namazu
/var/spool/wwwoffle/search/namazu/db
/var/spool/wwwoffle/search/namazu/scripts
# hyperestraier
/var/spool/wwwoffle/search/hyperestraier
%config(noreplace) /var/spool/wwwoffle/search/hyperestraier/conf/estseek.conf
%_bindir/*
%_sbindir/*
/etc/ppp/ip-up.d/%name
/etc/ppp/ip-down.d/%name

%changelog
* Thu Apr 10 2008 crrodriguez@suse.de
- missing zlib-devel and gnutls-devel in buildrequires
- wwwofle does not clean the proxy disk cache without cron, which is
  not installed by default, possible leading to a disk full problem
* Mon Jan 28 2008 kssingvo@suse.de
- Upgrade to version 2.9d:
  * src/html.l:
  Fetch image URLs stored in style attributes
  * src/certinfo.c:
  Print out the full certificate information
  * src/iozlib.c:
  Fix bug with decompressing zlib data.
  * src/certinfo.c:
  Remove the generation and display of the XML format certificate.
  * doc/README.CONF:
  Make the description of http-port and https-port options clearer.
  * src/spool.c:
  In case of failure to create directory check it hasn't been made
  simultaneously by another server.
  * doc/README.CONF, doc/wwwoffle.conf.man.template, src/config.h,
  src/configdata.c, src/document.h, src/html.l, src/info.c,
  src/refresh.c, src/wwwoffle.c, src/wwwoffle.h,
  conf/upgrade-config.pl, conf/wwwoffle.conf.template:
  Add a new option to the FetchOptions section called iframes.
  * conf/wwwoffle.conf.template, doc/README, doc/README.CONF,
  src/config.h, src/configdata.c, src/parse.c:
  Added a new option referer-from that will censor the outgoing
  Referer header based on the referring URL
  * src/htmlmodify.l:
  Don't output an extra space before an XHTML closing tag.
  * doc/README.CONF:
  Add some clarifications on IPv6 addresses in config file and how
  matching is performed.
- removed obsolete gcc patch (now in upstream code)
- fixed init script: requires $remote_fs now, as /usr might be one
* Tue Dec 04 2007 kssingvo@suse.de
- fix for next gcc: use open(2) with mode flags
* Mon Jul 30 2007 kssingvo@suse.de
- Upgrade to version 2.9c:
  * src/htmlmodify.l, src/html.l:
  Find the end of the script by searching for "</script".
  * src/certificates.c:
  Add some more information to the fatal error messages.
  * doc/README.CONF: Grammatical correction and clarification.
  * src/https.c: Don't try securing link if socket connection failed.
  * src/sockets6.c:
  Use the AI_ADDRCONFIG flag when calling getaddrinfo().
  * src/configmisc.c:
  Fix bug with case-insensitive wildcard matching in the
  configuration file
  * src/info.c: Fix some warnings & errors splint detected.
  * src/certificates.c, src/certinfo.c:
  Add some splint annotations, fix some warnings & errors splint
  detected.
  * src/certificates.h, src/iopriv.h, src/io.h:
  Add some splint annotations.
  * src/connect.c: Fix memory leak.
  * src/connect.c: Remove some dead code and trivial bug fix.
  * src/cgi.c, src/certinfo.c:
  More changes for compilation warnings on a system where
  size_t!=int
  * src/wwwoffles.c:
  Defer de-initialisation of chunked or compressed sockets
  until end to ensure memory is freed.
  * src/certinfo.c: Free memory.
  * src/certificates.c:
  De-initialise gnutls data structures to free memory.
  * src/finger.c: Make code same as http.c for opening socket
  connection.
  * src/info.c:
  Fix problems with cached page contents info if it is being
  stored compressed.
  * src/iopriv.c: Fix comment error.
  * src/wwwoffled.c:
  Print message when ready to start after initialisation.
  * src/document.c: Free allocated memory.
  * src/io.c: Free memory at file close.
  * src/certificates.c: Free memory at exit.
  * src/errors.c: Don't truncate the log file when opening it.
  * src/version.h, doc/NEWS: Update for version 2.9c.
* Fri Mar 30 2007 ro@suse.de
- added flex to buildreq
* Mon Feb 19 2007 kssingvo@suse.de
- Upgrade to version 2.9b:
  * doc/FAQ: Updated question about https
  * doc/README.CONF: Change wording of lock-files description
  * src/monitor.c: Display a non-empty value in the hour-of-day
  field for default setting
  * src/spool.c, src/errors.c, src/purge.c, src/certificates.c:
  Make sure that files are truncated when opening them.
  * src/io.c: Make sure that buffer size is OK.
  * src/html.l, src/htmlmodify.l: Fix HTML parsing of '\'
  characters outside strings (in script tags).
  * src/html.l, src/htmlmodify.l: Fix HTML parsing of '\'
  characters within quoted strings (in script tags and quoted
  HTML attributes).
  * src/iochunk.c, src/iopriv.c, src/iopriv.h, src/iozlib.c,
  src/io.c: Changes to allow turning zlib and chunked encoding
  off and returning to plain text. Fixed most of the FIXMEs in
  io.c.
  * src/certificates.c:
  Handle expired certificates by deleting them and creating a new
  one. If the root certificate is changed then it will need to be
  reloaded into the browser.
  * src/wwwoffles.c, src/spool.c:
  Don't delete the lasttime cached spool file if the page is
  unchanged this time but new sometime in this session.
  * src/spool.c: Make sure that allocated strings are long enough.
  * NEW: Expired SSL certificates are deleted and replaced.
- adapted (removed) integrated patch of SUSE/Novell.
* Wed Aug 23 2006 kssingvo@suse.de
- Upgrade to version 2.9a:
  * Keep attribute values that contain '()' but no quote characters.
  * Make more functions return ssize_t types.
  * Replace global function FindLanguageFile() with static function find_language_file().
  * Make sure that static functions are defined as static.
  * Correct some comments.
  * Fix code that mixed ssize_t and int variable types.
  * Remove the latest new header to keep IIS servers happy.
  * Make sure that allocated strings are long enough.
  * Remove any spaces between the header keyword and the ':'.
  * Remove misleading warning message.
  * Delete the 'Keep-Alive' header if it is present.
  * Add a new header to keep the 'bad-behaviour' PHP script happy.
  * Handle the special case of compressed chunk body of zero length.
  * Fix mis-formatting in wwwoffle.conf manual page created from README.CONF.
  * Change the behaviour of wwwoffle-ls so that 'wwwoffle-ls http://foo/' lists
  just the one URL and 'wwwoffle-ls http/foo' lists the whole directory.
  * Make the error messages about using /etc/wwwoffle/wwwoffle.conf instead
  of /etc/wwwoffle.conf less confusing (especially if CONFDIR = /etc).
  * Fix bug where a forced refresh didn't force a reload.
  * If a URL is aliased show the information for the alias.
  * Add an option to disable all iframes in HTML output.
  * Fix bug with serving CA certificate.
* Fri Aug 11 2006 seife@suse.de
- fix buffer overflow on "wwwoffle -fetch"
* Fri Aug 11 2006 seife@suse.de
- fix ip-up.wwwoffle: /sbin is not in the path
* Wed Jul 19 2006 kssingvo@suse.de
- fixed 64bit problem: difference in ssize_t
* Thu Jul 13 2006 kssingvo@suse.de
- fixed problems in ip-up/ip-down [bugzilla#191395]
- upgrade to version wwwoffle-2.9:
  o bug fixes
  o internal code changes
  o add a new layer of buffering to avoid large number of small network writes.
  o add checkboxes to protocol indexes (e.g. /index/http) for deleting multiple.
  o add reset button (and more if javascript) to clear delete checkboxes.
  o add the ability to use the Hyper Estraier programs to search the cache.
  o improve the purge output, print more information about what is happening.
  o move the convert-cache and uncompress-cache functions into wwwoffle-tools
* Tue Feb 28 2006 hvogel@suse.de
- fix files list [#115165]
* Fri Feb 17 2006 hvogel@suse.de
- clean up %%files section
- mark all config files [#115165]
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 13 2006 mmj@suse.de
- Update to wwwoffle-2.8e
* Fri Oct 21 2005 mmj@suse.de
- Install wwwoffle control files in /etc/ppp/if-{up,down}.d [#129452]
* Tue Sep 06 2005 mmj@suse.de
- Make wwwoffle be able to use htdig if it's there [#115165]
* Tue Apr 26 2005 mmj@suse.de
- Allocate enough room for const char *str
* Mon Dec 20 2004 mmj@suse.de
- Update to 2.8d
* Mon Jun 14 2004 mmj@suse.de
- Update to 2.8c which is a bugfix release
* Fri Dec 05 2003 mmj@suse.de
- Update to 2.8a
* Thu Oct 16 2003 mmj@suse.de
- Don't build as root
- Clean the specfile
* Fri Sep 19 2003 mmj@suse.de
- Make it not segfault on amd64 [#31327]
* Thu Jul 31 2003 poeml@suse.de
- since the configuration file and spool directory are owned by
  user wwwrun, run as wwwrun by default
- new macros for stop/restart of services on rpm update/removal
- let /var/spool/wwwoffle/{html,search} be owned by root
* Mon Jun 02 2003 schwab@suse.de
- Fix manpages.
- Fix links in translated index pages.
* Tue May 13 2003 mmj@suse.de
- Remove unwanted files, and package some missed ones
* Wed Jan 22 2003 mmj@suse.de
- Up to 2.7h which is a bugfix release with focus on security.
- Moved the config file back to /etc/wwwoffle/ since it makes bet-
  ter sense there [#23005]
* Wed Dec 04 2002 mmj@suse.de
- Up to 2.7g which is another minor bugfix release.
* Wed Oct 02 2002 mmj@suse.de
- Up to 2.7f mainly a bugfix-release. Fixes [#20432]
* Tue Sep 17 2002 ro@suse.de
- removed bogus self-provides
* Thu Aug 15 2002 mmj@suse.de
- Correct PreReq:
* Mon Jul 22 2002 mmj@suse.de
- Added security patch to parse.c, to check length correctly
* Tue Jul 16 2002 mmj@suse.de
- Update to 2.7c, bugfix and minor feature addition
* Mon Jul 08 2002 mmj@suse.de
- Fixing to start with /etc/wwwoffle.conf not /etc/wwwoffle
- Removed rc.config call in the init script.
* Mon May 13 2002 mmj@suse.de
- Update to 2.7b - including lots of new docs and switch to
  autoconf/automake. Also cgi script handling improved.
* Fri Dec 14 2001 ro@suse.de
- removed START_WWWOFFLE
* Thu Oct 11 2001 grimmer@suse.de
- fixed return code of the wwwoffle.cron script (cron sent
  a failure notice "SCRIPT: wwwoffle exited with RETURNCODE = 3"
  if the wwwoffled daemon was not running) [#11492]
* Wed Sep 19 2001 grimmer@suse.de
- Use "startproc -q" in rc.wwwoffle to suppress misleading
  warning messages ("Failed to bind IPv4 server socket [Address
  already in use]") [#10791]
- removed "chown -R wwwrun.root" in install section to enable
  non-root users to build the package as well (file ownerships
  are being properly set in the file list anyway)
* Thu Jul 26 2001 grimmer@suse.de
- Update to 2.6d: bugfixes and new features (e.g. IPv6 support)
- enabled IPv6 support and added required patch to sockets6.c
* Mon Jul 23 2001 grimmer@suse.de
- Update to 2.6c
* Mon Apr 23 2001 grimmer@suse.de
- Updated init file according to new skeleton
* Wed Apr 04 2001 grimmer@suse.de
- update to 2.6b
- removed Makefile patches (obsolete)
- added cron script as a separate source file
* Sun Feb 11 2001 grimmer@suse.de
- update to 2.6a
- added sample ip-up.local file to documentation directory (#6254)
- added upgrade-config scripts to file list
* Tue Jan 16 2001 grimmer@suse.de
- removed "noreplace" from config file /etc/wwwoffle/wwwoffle.conf
  since wwwoffle segfaults with an old config file after an
  update (#4940)
* Mon Dec 18 2000 grimmer@suse.de
- fixed path to ht://dig binaries
* Wed Dec 06 2000 grimmer@suse.de
- removed dependency on htdig and removed daily cron job
- fixed some typos in init script and spec file
- made weekly cron job more robust
- updated wwwoffle.test
* Thu Nov 30 2000 grimmer@suse.de
- Update to 2.6
- created new init script and moved it to /etc/init.d
- added BuildRoot
- use some more RPM macros
- added some more files and cron jobs
* Mon Jun 19 2000 grimmer@suse.de
- Update to 2.5e
* Thu Mar 30 2000 grimmer@suse.de
- fixed init script (reload is a real reload now) (#2650)
* Fri Feb 25 2000 grimmer@suse.de
- added Group tag
* Mon Feb 21 2000 grimmer@suse.de
- Update to 2.5d
- removed obsolete patch for errors.c
- moved man pages to /usr/share/man
* Tue Jan 25 2000 uli@suse.de
- errors.c: fixed misuse of va_arg macro
* Sat Oct 02 1999 grimmer@suse.de
- Update to 2.5
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Mon Jul 05 1999 grimmer@suse.de
- Update to 2.4e
- added docu in multiple languages to $DOCDIR
* Mon May 31 1999 grimmer@suse.de
- update to version 2.4d
* Tue Apr 13 1999 grimmer@suse.de
- update to version 2.4b
- specfile updates
- updated rc-script
* Thu Mar 25 1999 ro@suse.de
- fixed rc-script
* Tue Dec 08 1998 ro@suse.de
- fixed typo in rc-script
* Fri Nov 06 1998 grimmer@suse.de
- update to version 2.3e
- implemented new init script
- fixed script bug (shutdown with password)
* Tue Jul 21 1998 grimmer@suse.de
- changed CONFDIR again to /etc/wwwoffle/
- minor fix in init script rc.wwwoffle
* Mon Jul 20 1998 grimmer@suse.de
- update to version 2.2c
- changed CONFDIR back to /var/spool/
* Fri Jul 03 1998 bs@suse.de
- changed gid of /var/spool/wwwoffle from nogroup to root.
* Wed Jul 01 1998 grimmer@suse.de
- update to version 2.2
- updated init-script (reload, status)
- updated specfile (spoolfile,tools)
- changed CONFDIR to /etc
* Fri Apr 03 1998 bs@suse.de
- changed gid from nogroup to wwwadmin
* Tue Feb 17 1998 ro@suse.de
- update to version 2.0 (bb@suse.de)
* Fri Nov 14 1997 ro@suse.de
- fixed specfile (installation of docfiles)
* Mon Nov 03 1997 bb@suse.de
  new package!
openSUSE Build Service is sponsored by