File privoxy.spec of Package privoxy

#
# spec file for package privoxy (Version 3.0.13.90.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           privoxy
BuildRequires:  pcre-devel w3m zlib-devel
Url:            http://www.privoxy.org/
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Proxy
Provides:       ijb junkbuster
Obsoletes:      ijb junkbuster
AutoReqProv:    on
PreReq:         %fillup_prereq %insserv_prereq /usr/sbin/useradd /usr/sbin/groupadd
#this define could be drop, in next stable realease
%define package_version 3.0.14
Version:        3.0.13.90.1
Release:        3
Summary:        The Internet Junkbuster - HTTP Proxy Server
Source:         privoxy-%{package_version}-beta-src.tar.bz2
Source1:        privoxy.logrotate
Patch:          %{name}-%{package_version}-init.patch
Patch1:         %{name}-%{package_version}-config.patch
Patch2:         %{name}-%{package_version}-utf8.patch
Patch3:         %{name}-%{package_version}-networkmanager.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       logrotate cron
%define chroot /var/lib/privoxy

%description
The Internet Junkbuster - HTTP Proxy Server: A non-caching HTTP proxy
server that runs between a web browser and a web server and filters
contents as described in the configuration files.



Authors:
--------
    Privoxy Developers <developers@privoxy.org>

%package doc
Group:          Productivity/Networking/Web/Proxy
License:        GPL v2 or later
Summary:        The documentation of Privoxy
Requires:       %{name} = %{version}

%description doc
Documentation files for the Privoxy: The Internet Junkbuster - HTTP
Proxy Server. A non-caching HTTP proxy server that runs between a web
browser and a web server and filters contents as described in the
configuration files.



Authors:
--------
    Privoxy Developers <developers@privoxy.org>

%prep
%setup -q -n privoxy-%package_version-beta
%patch -p1
%patch1
%patch2 -p0
%patch3

%build
autoreconf -fiv
%configure --enable-zlib
make

%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/%chroot/etc
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/%chroot/log
mkdir -p $RPM_BUILD_ROOT/%chroot/var/log
mkdir -p $RPM_BUILD_ROOT/%chroot/var/run
mkdir -p $RPM_BUILD_ROOT/%chroot/%_lib
mkdir -p $RPM_BUILD_ROOT%_mandir/man1
mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
cp -a templates $RPM_BUILD_ROOT/%chroot/etc
install -m 644 config *.action *.filter trust $RPM_BUILD_ROOT/%chroot/etc
install -m 755 privoxy.init.suse $RPM_BUILD_ROOT/etc/init.d/privoxyd
install -m 755 privoxy $RPM_BUILD_ROOT/usr/sbin
install -m 755 privoxy_nm $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/privoxyd
install -m 644 privoxy.1 $RPM_BUILD_ROOT%_mandir/man1
ln -sf ../../etc/init.d/privoxyd $RPM_BUILD_ROOT/usr/sbin/rcprivoxyd
ln -sf ../../etc/init.d/privoxyd $RPM_BUILD_ROOT/usr/sbin/rcprivoxy
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/privoxy
ln -s ../../log $RPM_BUILD_ROOT/%chroot/var/log/privoxy
ln -sf %chroot/etc/ $RPM_BUILD_ROOT/etc/privoxy

%pre
/usr/sbin/groupadd -r privoxy 2> /dev/null ||:
/usr/sbin/useradd -r -g privoxy -s /bin/false -c "Daemon user for privoxy" \
 -d /var/lib/privoxy privoxy 2> /dev/null ||:
exit 0

%post
%{fillup_and_insserv privoxyd}
# create logfiles if missing
for i in ./%chroot/log/logfile ./%chroot/log/jarfile; do
	if ! test -e $i; then touch $i; chown privoxy: $i; chmod 640 $i ; fi
done
exit 0

%preun
%stop_on_removal privoxyd

%postun
%restart_on_update privoxyd
%insserv_cleanup

%files
%defattr(-,root,root)
%doc AUTHORS LICENSE README ChangeLog
/usr/sbin/privoxy
/etc/NetworkManager/dispatcher.d/privoxyd
%dir /etc/NetworkManager
%dir /etc/NetworkManager/dispatcher.d
%doc %_mandir/man1/privoxy.1.gz
%config(noreplace) /etc/logrotate.d/privoxy
%dir /%chroot/etc
%config(noreplace) /%chroot/etc/config
%config(noreplace) /%chroot/etc/trust
%config                                    /%chroot/etc/match-all.action
%config            %attr(640,privoxy,root) /%chroot/etc/default.action
%config(noreplace) %attr(640,privoxy,root) /%chroot/etc/user.action
%config(noreplace) /%chroot/etc/*.filter
%dir %chroot
%chroot/etc/templates
%dir %attr(770,root,privoxy) %chroot/log
%chroot/var
%chroot/%_lib
%chroot/etc/regression-tests.action
%config /etc/init.d/privoxyd
/usr/sbin/rcprivoxyd
/usr/sbin/rcprivoxy
/etc/privoxy

%files doc
%defattr(-,root,root)
%doc doc/source

%changelog
openSUSE Build Service is sponsored by