|
|
|
##
|
|
|
|
## delegate.spec -- OpenPKG RPM Specification
|
|
|
|
## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
|
|
|
|
## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
|
|
|
|
## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
|
|
|
|
##
|
|
|
|
## Permission to use, copy, modify, and distribute this software for
|
|
|
|
## any purpose with or without fee is hereby granted, provided that
|
|
|
|
## the above copyright notice and this permission notice appear in all
|
|
|
|
## copies.
|
|
|
|
##
|
|
|
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
|
## CONTRIBUTORS 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.
|
|
|
|
##
|
|
|
|
|
|
|
|
# package information
|
|
|
|
Name: delegate
|
|
|
|
Summary: Multi-purpose Application-Level Network Gateway
|
|
|
|
URL: http://www.delegate.org/
|
|
|
|
Vendor: Yutaka Sato
|
|
|
|
Packager: The OpenPKG Project
|
|
|
|
Distribution: OpenPKG [BASE]
|
|
|
|
Group: Network
|
|
|
|
License: Freely distributable
|
|
|
|
Version: 8.7.8
|
|
|
|
Release: 20040108
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
Source0: ftp://ftp:openpkg-dev%40openpkg.org@ftp.delegate.org/pub/DeleGate/delegate%{version}.tar.gz
|
|
|
|
Source1: rc.delegate
|
|
|
|
Source2: delegated.cf
|
|
|
|
|
|
|
|
# build information
|
|
|
|
Prefix: %{l_prefix}
|
|
|
|
BuildRoot: %{l_buildroot}
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20021230
|
|
|
|
PreReq: OpenPKG, openpkg >= 20021230
|
|
|
|
AutoReq: no
|
|
|
|
AutoReqProv: no
|
|
|
|
|
|
|
|
%description
|
|
|
|
DeleGate is a multi-purpose application level gateway, or a proxy
|
|
|
|
server. It mediates communication of various protocols (HTTP, FTP,
|
|
|
|
NNTP, POP, Telnet, etc.), applying cache and conversion for mediated
|
|
|
|
data, controlling access from clients and routing toward servers. It
|
|
|
|
translates protocols between clients and servers, merging several
|
|
|
|
servers into a single server view with aliasing and filtering.
|
|
|
|
Besides proxy, DeleGate can be used as a simple origin server for
|
|
|
|
some protocols (HTTP, FTP and NNTP).
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n delegate%{version}
|
|
|
|
%{l_shtool} subst \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_OWNER[ ]\{1,\}=\).*$;\1 "%{l_rusr}/%{l_rgrp}"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_ETCDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/etc/delegate"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_CONFIG[ ]\{1,\}=\).*$;\1 "%{l_prefix}/etc/delegate/delegated.cf"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_DGROOT[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_VARDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_ACTDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/act"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_PIDFILE[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/delegate.pid"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_LOGDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_ABORTLOG[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log/abort.log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_LOGFILE[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log/common.log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_ERRORLOG[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log/error.log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_PROTOLOG[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log/proto.log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_TRACELOG[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/log/trace.log"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_WORKDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/work"\;;' \
|
|
|
|
-e 's;^\([ ]*char[ ]\{1,\}\*DELEGATE_TMPDIR[ ]\{1,\}=\).*$;\1 "%{l_prefix}/var/delegate/tmp"\;;' \
|
|
|
|
src/conf.c
|
|
|
|
|
|
|
|
%build
|
|
|
|
( %{l_shtool} echo -e "ADMIN = %u@%h%d"
|
|
|
|
echo "CC = %{l_cc}"
|
|
|
|
echo "CFLAGS = %{l_cflags -O}"
|
|
|
|
) >src/DELEGATE_CONF
|
|
|
|
%{l_make} %{l_mflags -O}
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
# install DeleGate files
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/delegate \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/sbin \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/delegate
|
|
|
|
%{l_shtool} mkdir -f -p -m 700 \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/act \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/adm \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/cache \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/log \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/work \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/delegate/tmp
|
|
|
|
%{l_shtool} install -c -s -m 755 \
|
|
|
|
src/delegated $RPM_BUILD_ROOT%{l_prefix}/sbin/
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
doc/Manual.htm $RPM_BUILD_ROOT%{l_prefix}/share/delegate/manual.html
|
|
|
|
|
|
|
|
# install default configuration
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
%{SOURCE delegated.cf} $RPM_BUILD_ROOT%{l_prefix}/etc/delegate/
|
|
|
|
|
|
|
|
# install run-command script
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
|
|
|
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
|
%{SOURCE rc.delegate} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
|
|
|
|
'%config %{l_prefix}/etc/delegate/*' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/act' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/adm' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/cache' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/log' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/work' \
|
|
|
|
'%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/delegate/tmp'
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%post
|
|
|
|
# after upgrade, restart service
|
|
|
|
[ $1 -eq 2 ] || exit 0
|
|
|
|
eval `%{l_rc} delegate status 2>/dev/null`
|
|
|
|
[ ".$delegate_active" = .yes ] && %{l_rc} delegate restart
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%preun
|
|
|
|
# before erase, stop service
|
|
|
|
[ $1 -eq 0 ] || exit 0
|
|
|
|
%{l_rc} delegate stop 2>/dev/null
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/delegate/*.log* >/dev/null 2>&1 || true
|
|
|
|
exit 0
|
|
|
|
|