Selaa lähdekoodia

new package: tinyproxy 1.6.2 (Tiny HTTP/HTTPS Proxy Daemon)

Ralf S. Engelschall 22 vuotta sitten
vanhempi
commit
553387013e
4 muutettua tiedostoa jossa 246 lisäystä ja 0 poistoa
  1. 55 0
      tinyproxy/rc.tinyproxy
  2. 62 0
      tinyproxy/tinyproxy.conf
  3. 13 0
      tinyproxy/tinyproxy.patch
  4. 116 0
      tinyproxy/tinyproxy.spec

+ 55 - 0
tinyproxy/rc.tinyproxy

@@ -0,0 +1,55 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.tinyproxy -- Run-Commands
+##
+
+%config
+    tinyproxy_enable="$openpkg_rc_def"
+    tinyproxy_log_prolog="true"
+    tinyproxy_log_epilog="true"
+    tinyproxy_log_numfiles="10"
+    tinyproxy_log_minsize="1M"
+    tinyproxy_log_complevel="9"
+
+%common
+    tinyproxy_pidfile="@l_prefix@/var/tinyproxy/tinyproxy.pid"
+    tinyproxy_logfile="@l_prefix@/var/tinyproxy/tinyproxy.log"
+    tinyproxy_signal () {
+        [ -f $tinyproxy_pidfile ] && kill -$1 `cat $tinyproxy_pidfile`
+    }
+
+%status -u @l_susr@ -o
+    tinyproxy_usable="unknown"
+    tinyproxy_active="no"
+    rcService tinyproxy enable yes && \
+        tinyproxy_signal 0 && tinyproxy_active="yes"
+    echo "tinyproxy_enable=\"$tinyproxy_enable\""
+    echo "tinyproxy_usable=\"$tinyproxy_usable\""
+    echo "tinyproxy_active=\"$tinyproxy_active\""
+
+%start -u @l_susr@
+    rcService tinyproxy enable yes || exit 0
+    rcService tinyproxy active yes && exit 0
+    @l_prefix@/sbin/tinyproxy
+
+%stop -u @l_susr@
+    rcService tinyproxy enable yes || exit 0
+    rcService tinyproxy active no  && exit 0
+    tinyproxy_signal TERM
+    sleep 2
+    rm -f $tinyproxy_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+    rcService tinyproxy enable yes || exit 0
+    rcService tinyproxy active no  && exit 0
+    rc tinyproxy stop start
+
+%daily -u @l_susr@
+    rcService tinyproxy enable yes || exit 0
+    shtool rotate -f \
+        -n ${tinyproxy_log_numfiles} -s ${tinyproxy_log_minsize} -d \
+        -z ${tinyproxy_log_complevel} -m 664 -o @l_nusr@ -g @l_ngrp@ \
+        -P "${tinyproxy_log_prolog}" \
+        -E "${tinyproxy_log_epilog} && rc tinyproxy restart" \
+        $tinyproxy_logfile
+

+ 62 - 0
tinyproxy/tinyproxy.conf

@@ -0,0 +1,62 @@
+##
+##  tinyproxy.conf -- Tinyproxy Daemon Configuration
+##
+
+#   run-time user/group
+User                 @l_nusr@
+Group                @l_ngrp@
+
+#   network management
+Port                 8888
+Listen               127.0.0.1
+#Bind                127.0.0.1
+Timeout              600
+
+#   daemon management
+PidFile              "@l_prefix@/var/tinyproxy/tinyproxy.pid"
+Logfile              "@l_prefix@/var/tinyproxy/tinyproxy.log"
+LogLevel             Info
+MaxClients           100
+MinSpareServers      5
+StartServers         10
+MaxSpareServers      20
+MaxRequestsPerChild  0
+
+#   error handling
+#ErrorFile           404 "@l_prefix@/share/tinyproxy/404.html"
+#ErrorFile           400 "@l_prefix@/share/tinyproxy/400.html"
+#ErrorFile           503 "@l_prefix@/share/tinyproxy/503.html"
+#ErrorFile           403 "@l_prefix@/share/tinyproxy/403.html"
+#ErrorFile           408 "@l_prefix@/share/tinyproxy/408.html"
+DefaultErrorFile     "@l_prefix@/share/tinyproxy/default.html"
+StatFile             "@l_prefix@/share/tinyproxy/stats.html"
+
+#   upstream proxy support
+#upstream            testproxy:8008 ".example.com"
+#upstream            testproxy:8008 "192.168.128.0/255.255.254.0"
+#no upstream         ".internal.example.com"
+#no upstream         "www.example.com"
+#no upstream         "10.0.0.0/8"
+#no upstream         "192.168.0.0/255.255.254.0"
+#no upstream         "."
+#upstream            default.example.com:80
+
+#   access control
+#Allow               127.0.0.1/8
+#Allow               192.168.1.0/24
+ConnectPort          443
+ConnectPort          563
+
+#   HTTP header management
+#Anonymous           Host
+#Anonymous           Authorization
+#XTinyproxy          example.com
+#ViaProxyName        tinyproxy
+
+#   HTTP URL filtering
+#Filter              "@l_prefix@/etc/tinyproxy/tinyproxy.filter"
+#FilterURLs          On
+#FilterExtended      On
+#FilterCaseSensitive On     
+#FilterDefaultDeny   Yes
+

+ 13 - 0
tinyproxy/tinyproxy.patch

@@ -0,0 +1,13 @@
+Index: doc/default.html
+--- doc/default.html.orig	2003-03-13 22:35:58.000000000 +0100
++++ doc/default.html	2004-01-08 20:40:54.000000000 +0100
+@@ -1,7 +1,7 @@
+ <html><head><title>{cause}</title></head>
+ <body>
+-<font size=\+2\>Cache Error!</font><br>
++<font size="+2">Cache Error!</font><br>
+ The following error has occured: {detail}
+ <hr>
+-<font size=\-1\><em>Generated by {package} ({version})</em></font>
++<font size="-1"><em>Generated by {package} ({version})</em></font>
+ </body></html>

+ 116 - 0
tinyproxy/tinyproxy.spec

@@ -0,0 +1,116 @@
+##
+##  tinyproxy.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:         tinyproxy
+Summary:      Tiny HTTP/HTTPS Proxy Daemon
+URL:          http://tinyproxy.sourceforge.net/
+Vendor:       S. Young & R.J. Kaes
+Packager:     The OpenPKG Project
+Distribution: OpenPKG [EVAL]
+Group:        Network
+License:      GPL
+Version:      1.6.2
+Release:      20040108
+
+#   list of sources
+Source0:      http://osdn.dl.sourceforge.net/sourceforge/tinyproxy/tinyproxy-%{version}.tar.gz
+Source1:      tinyproxy.conf
+Source2:      rc.tinyproxy
+Patch0:       tinyproxy.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20030103, openssl, flex, bison
+PreReq:       OpenPKG, openpkg >= 20030103, openssl
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    Tinyproxy is a lightweight HTTP proxy. Designed from the ground up
+    to be fast and yet small, it is an ideal solution for sites where
+    a full-featured HTTP proxy is required, but the system resources
+    required to run a more demanding HTTP proxy are unavailable.
+
+%prep
+    %setup -q
+    %patch -p0
+
+    #   remove incorrectly pre-generated files
+    rm -f src/grammar.c
+    rm -f src/scanner.c
+
+%build
+    #   configure program
+    CC="%{l_cc}" \
+    CFLAGS="%{l_cflags -O}" \
+    CPPFLAGS="%{l_cppflags}" \
+    LDFLAGS="%{l_ldflags}" \
+    ./configure \
+        --prefix=%{l_prefix} \
+        --with-config=%{l_prefix}/etc/tinyproxy/tinyproxy.conf \
+        --enable-xtinyproxy
+
+    #   build program
+    %{l_make} %{l_mflags -O}
+
+%install
+    #   install program
+    rm -rf $RPM_BUILD_ROOT
+    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+    #   post-adjust installation
+    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/share/tinyproxy/*.dist
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/tinyproxy/tinyproxy.conf*
+
+    #   install default configuration
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/tinyproxy
+    %{l_shtool} install -c -m 755 %{l_value -s -a} \
+        %{SOURCE tinyproxy.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/tinyproxy/
+
+    #   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.tinyproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   create state directory
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/var/tinyproxy
+
+    #   determine installation files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %{l_prefix}/etc/tinyproxy/tinyproxy.conf' \
+        '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/tinyproxy'
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+