OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 23-Jul-2005 23:10:36
Branch: HEAD Handle: 2005072322103500
Added files:
openpkg-src/dante dante.spec rc.dante sockd.conf socks.conf
Log:
new package: dante 1.1.17 (SOCKS Proxy Toolkit)
Summary:
Revision Changes Path
1.1 +141 -0 openpkg-src/dante/dante.spec
1.1 +56 -0 openpkg-src/dante/rc.dante
1.1 +59 -0 openpkg-src/dante/sockd.conf
1.1 +25 -0 openpkg-src/dante/socks.conf
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/dante/dante.spec
============================================================================
$ cvs diff -u -r0 -r1.1 dante.spec
--- /dev/null 2005-07-23 23:10:25 +0200
+++ dante.spec 2005-07-23 23:10:35 +0200
@@ -0,0 +1,141 @@
+##
+## dante.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.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: dante
+Summary: SOCKS Proxy Toolkit
+URL: http://www.inet.no/dante/
+Vendor: Inferno Nettverk A/S
+Packager: OpenPKG
+Distribution: OpenPKG
+Class: EVAL
+Group: Network
+License: BSD/CMU-type
+Version: 1.1.17
+Release: 20050723
+
+# list of sources
+Source0: ftp://ftp.inet.no/pub/socks/dante-%{version}.tar.gz
+Source1: sockd.conf
+Source2: socks.conf
+Source3: rc.dante
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130
+PreReq: OpenPKG, openpkg >= 20040130
+AutoReq: no
+AutoReqProv: no
+
+%description
+ Dante is a RFC1928 (SOCKS v5) based circuit-level firewall/proxy
+ that can be used to provide convenient and secure network
+ connectivity to a wide range of hosts while requiring only the
+ server Dante runs on to have external network connectivity. Dante
+ relays TCP and UDP both from outside the network to inside, and
+ from inside to outside.
+
+%track
+ prog dante = {
+ version = %{version}
+ url = ftp://ftp.inet.no/pub/socks/
+ regex = dante-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q
+
+%build
+ # configure
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --with-socks-conf=%{l_prefix}/etc/dante/socks.conf \
+ --with-sockd-conf=%{l_prefix}/etc/dante/sockd.conf \
+ --with-pidfile=%{l_prefix}/var/dante/sockd.pid \
+ --disable-libwrap
+
+ # build
+ %{l_make} %{l_mflags -O}
+
+%install
+ # install
+ rm -rf $RPM_BUILD_ROOT
+ %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+ # strip down installation
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libsocks.so*
+ %{l_shtool} subst \
+ -e 's;^\(dlname=.\).*\(.\);\1\2;' \
+ -e 's;^\(library_names=.\).*\(.\);\1\2;' \
+ $RPM_BUILD_ROOT%{l_prefix}/lib/libsocks.la
+
+ # install default configurations
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/dante
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE sockd.conf} %{SOURCE socks.conf} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/dante/
+
+ # 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.dante} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # create run-time directory
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/var/dante/tmp
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/dante/*'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ # after upgrade, restart service
+ [ $1 -eq 2 ] || exit 0
+ eval `%{l_rc} dante status 2>/dev/null`
+ [ ".$dante_active" = .yes ] && %{l_rc} dante restart
+ exit 0
+
+%preun
+ # before erase, stop service and remove log files
+ [ $1 -eq 0 ] || exit 0
+ %{l_rc} dante stop 2>/dev/null
+ rm -f $RPM_INSTALL_PREFIX/var/dante/sockd.log >/dev/null 2>&1 || true
+ rm -f $RPM_INSTALL_PREFIX/var/dante/sockd.pid >/dev/null 2>&1 || true
+ rm -f $RPM_INSTALL_PREFIX/var/dante/tmp/* >/dev/null 2>&1 || true
+ exit 0
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dante/rc.dante
============================================================================
$ cvs diff -u -r0 -r1.1 rc.dante
--- /dev/null 2005-07-23 23:10:25 +0200
+++ rc.dante 2005-07-23 23:10:35 +0200
@@ -0,0 +1,56 @@
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+## rc.dante -- Run-Commands
+##
+
+%config
+ dante_enable="$openpkg_rc_def"
+ dante_log_prolog="true"
+ dante_log_epilog="true"
+ dante_log_numfiles="10"
+ dante_log_minsize="1M"
+ dante_log_complevel="9"
+
+%common
+ dante_logfile="@l_prefix@/var/dante/sockd.log"
+ dante_pidfile="@l_prefix@/var/dante/sockd.pid"
+ dante_signal () {
+ [ -f $dante_pidfile ] && kill -$1 `cat $dante_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ dante_usable="unknown"
+ dante_active="no"
+ rcService dante enable yes && \
+ dante_signal 0 && dante_active="yes"
+ echo "dante_enable=\"$dante_enable\""
+ echo "dante_usable=\"$dante_usable\""
+ echo "dante_active=\"$dante_active\""
+
+%start -u @l_susr@
+ rcService dante enable yes || exit 0
+ rcService dante active yes && exit 0
+ export [EMAIL PROTECTED]@/var/dante/tmp
+ @l_prefix@/sbin/sockd -D
+
+%stop -u @l_susr@
+ rcService dante enable yes || exit 0
+ rcService dante active no && exit 0
+ dante_signal TERM
+ sleep 2
+ rm -f $dante_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+ rcService dante enable yes || exit 0
+ rcService dante active no && exit 0
+ rc dante stop start
+
+%daily -u @l_susr@
+ rcService dante enable yes || exit 0
+ shtool rotate -f \
+ -n ${dante_log_numfiles} -s ${dante_log_minsize} -d \
+ -z ${dante_log_complevel} -m 664 -o @l_susr@ -g @l_mgrp@ \
+ -P "${dante_log_prolog}" \
+ -E "${dante_log_epilog}; rc dante restart" \
+ ${dante_logfile}
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dante/sockd.conf
============================================================================
$ cvs diff -u -r0 -r1.1 sockd.conf
--- /dev/null 2005-07-23 23:10:25 +0200
+++ sockd.conf 2005-07-23 23:10:36 +0200
@@ -0,0 +1,59 @@
+##
+## sockd.conf -- Dante SOCKS Daemon Configuration
+##
+
+user.privileged: root
+user.notprivileged: @l_nusr@
+
+logoutput: @l_prefix@/var/dante/sockd.log
+
+external: 192.168.0.1
+internal: 127.0.0.1 port = 1080
+
+method: none
+
+#
+# client access rules
+#
+
+client pass {
+ from: 127.0.0.1/8 # internal network
+ to: 0.0.0.0/0
+ log: connect disconnect
+}
+
+#
+# server operation rules
+#
+
+# allow bind to ports greater than 1023
+pass {
+ from: 0.0.0.0/0
+ to: 0.0.0.0/0 port gt 1023
+ command: bind
+ log: connect disconnect
+}
+
+# allow outgoing connections (TCP and UDP)
+pass {
+ from: 0.0.0.0/0
+ to: 0.0.0.0/0
+ command: connect udpassociate
+ log: connect disconnect
+}
+
+# allow replies to bind, and incoming UDP packets
+pass {
+ from: 0.0.0.0/0
+ to: 0.0.0.0/0
+ command: bindreply udpreply
+ log: connect error
+}
+
+# blok and log anything else
+block {
+ from: 0.0.0.0/0
+ to: 0.0.0.0/0
+ log: connect error
+}
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dante/socks.conf
============================================================================
$ cvs diff -u -r0 -r1.1 socks.conf
--- /dev/null 2005-07-23 23:10:25 +0200
+++ socks.conf 2005-07-23 23:10:36 +0200
@@ -0,0 +1,25 @@
+##
+## socks.conf -- Dante SOCKS Client Configuration
+##
+
+# forwarding of IP based connections
+route {
+ from: 0.0.0.0/0
+ to: 0.0.0.0/0
+ via: 127.0.0.1 port = 1080
+ proxyprotocol: socks_v5
+ proxyprotocol: socks_v4
+ proxyprotocol: http_v1.0
+ proxyprotocol: msproxy_v2
+}
+
+# forwarding of name based connections
+route {
+ from: 0.0.0.0/0
+ to: .
+ via: 127.0.0.1 port = 1080
+ proxyprotocol: socks_v5
+ proxyprotocol: http_v1.0
+ proxyprotocol: msproxy_v2
+}
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]