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: 31-Aug-2006 10:30:19 Branch: HEAD Handle: 2006083109301800 Added files: openpkg-src/siproxd fsl.siproxd rc.siproxd siproxd.conf siproxd.patch siproxd.spec Log: new package: siproxd 0.5.13 (SIP/RTP Proxy Server) Summary: Revision Changes Path 1.1 +16 -0 openpkg-src/siproxd/fsl.siproxd 1.1 +55 -0 openpkg-src/siproxd/rc.siproxd 1.1 +54 -0 openpkg-src/siproxd/siproxd.conf 1.1 +57 -0 openpkg-src/siproxd/siproxd.patch 1.1 +157 -0 openpkg-src/siproxd/siproxd.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/siproxd/fsl.siproxd ============================================================================ $ cvs diff -u -r0 -r1.1 fsl.siproxd --- /dev/null 2006-08-31 10:30:13 +0200 +++ fsl.siproxd 2006-08-31 10:30:18 +0200 @@ -0,0 +1,16 @@ +## +## fsl.siproxd -- OSSP fsl configuration +## + +ident .*(siproxd)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/siproxd/siproxd.log", + perm=0664 + ) + } +}; + @@ . patch -p0 <<'@@ .' Index: openpkg-src/siproxd/rc.siproxd ============================================================================ $ cvs diff -u -r0 -r1.1 rc.siproxd --- /dev/null 2006-08-31 10:30:13 +0200 +++ rc.siproxd 2006-08-31 10:30:18 +0200 @@ -0,0 +1,55 @@ [EMAIL PROTECTED]@/bin/openpkg rc +## +## rc.siproxd -- Run-Commands +## + +%config + siproxd_enable="$openpkg_rc_def" + siproxd_flags="" + siproxd_log_prolog="true" + siproxd_log_epilog="true" + siproxd_log_numfiles="10" + siproxd_log_minsize="1M" + siproxd_log_complevel="9" + +%common + siproxd_pidfile="@l_prefix@/var/siproxd/siproxd.pid" + siproxd_signal () { + [ -f $siproxd_pidfile ] && kill -$1 `cat $siproxd_pidfile` + } + +%status -u @l_susr@ -o + siproxd_usable="no" + siproxd_active="no" + rcService siproxd enable yes && \ + siproxd_signal 0 && siproxd_active="yes" + echo "siproxd_enable=\"$siproxd_enable\"" + echo "siproxd_usable=\"$siproxd_usable\"" + echo "siproxd_active=\"$siproxd_active\"" + +%start -p 100 -u @l_susr@ + rcService siproxd enable yes || exit 0 + rcService siproxd active yes && exit 0 + @l_prefix@/sbin/siproxd ${siproxd_flags} + +%stop -p 900 -u @l_susr@ + rcService siproxd enable yes || exit 0 + rcService siproxd active no && exit 0 + siproxd_signal TERM + sleep 2 + rm -f $siproxd_pidfile >/dev/null 2>&1 || true + +%restart -p 100 -u @l_susr@ + rcService siproxd enable yes || exit 0 + rcService siproxd active no && exit 0 + rc siproxd stop start + +%daily -u @l_susr@ + rcService siproxd enable yes || exit 0 + shtool rotate -f \ + -n ${siproxd_log_numfiles} -s ${siproxd_log_minsize} -d \ + -z ${siproxd_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \ + -P "${siproxd_log_prolog}" \ + -E "${siproxd_log_epilog}; rc siproxd restart" \ + @l_prefix@/var/siproxd/siproxd.log + @@ . patch -p0 <<'@@ .' Index: openpkg-src/siproxd/siproxd.conf ============================================================================ $ cvs diff -u -r0 -r1.1 siproxd.conf --- /dev/null 2006-08-31 10:30:13 +0200 +++ siproxd.conf 2006-08-31 10:30:18 +0200 @@ -0,0 +1,54 @@ +## +## siproxd.conf - siproxd configuration file +## + +# PROCESS +silence_log = 0 +log_calls = 1 +user = @l_nusr@ +pid_file = @l_prefix@/var/siproxd/siproxd.pid +daemonize = 1 +debug_level = 0x0000ffff +debug_port = 0 + +# TOPOLOGY +if_inbound = eth0 +if_outbound = ppp0 +#host_outbound = sip-proxy.example.com +#mask_host = 10.0.0.42 +#masked_host = sip-proxy.example.com + +# ACCESS CONTROL +hosts_allow_reg = 10.0.0.0/8 +hosts_allow_sip = 0.0.0.0/0 +#proxy_auth_realm = Example SIP Proxy Authentication +#proxy_auth_pwfile = @l_prefix@/etc/siproxd.passwd + +# REGISTRATION +registration_file = @l_prefix@/var/siproxd/siproxd_registrations +autosave_registrations = 300 +default_expires = 600 + +# SERVICES +sip_listen_port = 5060 +rtp_proxy_enable = 1 +rtp_port_low = 7070 +rtp_port_high = 7089 +rtp_timeout = 300 +rtp_dscp = 46 + +# QUICK DIAL +# *01 -> FWD Echo Test +# *02 -> SIPphone Echo Test +pi_shortdial_enable = 1 +pi_shortdial_akey = *00 +pi_shortdial_entry = 000393613 +pi_shortdial_entry = 17474743246 + +# UPSTREAM PROXY +#outbound_proxy_host = sip-proxy2.upstream.example.com +#outbound_proxy_port = 5060 +#outbound_domain_name = foo.example.com +#outbound_domain_host = sip-proxy.foo.example.com +#outbound_domain_port = 5060 + @@ . patch -p0 <<'@@ .' Index: openpkg-src/siproxd/siproxd.patch ============================================================================ $ cvs diff -u -r0 -r1.1 siproxd.patch --- /dev/null 2006-08-31 10:30:13 +0200 +++ siproxd.patch 2006-08-31 10:30:18 +0200 @@ -0,0 +1,57 @@ +Index: src/plugin_shortdial.c +--- src/plugin_shortdial.c.orig 2006-05-20 13:48:53 +0200 ++++ src/plugin_shortdial.c 2006-08-31 08:25:58 +0200 +@@ -22,6 +22,7 @@ + + #include <stdio.h> + #include <string.h> ++#include <unistd.h> + #include <netinet/in.h> + + #include <osipparser2/osip_parser.h> +Index: src/siproxd.c +--- src/siproxd.c.orig 2006-06-18 18:28:43 +0200 ++++ src/siproxd.c 2006-08-31 08:25:58 +0200 +@@ -28,6 +28,7 @@ + #include <signal.h> + #include <netinet/in.h> + #include <arpa/inet.h> ++#include <syslog.h> + + #ifdef HAVE_GETOPT_H + #include <getopt.h> +@@ -97,6 +98,7 @@ + char *pidfilename=NULL; + struct sigaction act; + ++ openlog("siproxd", LOG_NDELAY, LOG_DAEMON); + log_set_stderr(1); + + /* +@@ -177,11 +179,16 @@ + /* + * Init stuff + */ +- INFO(PACKAGE"-"VERSION"-"BUILDSTR" "UNAME" starting up"); +- + /* read the config file */ + if (read_config(configfile, config_search) == STS_FAILURE) exit(1); + ++ /* Don't log to stderr if daemonizing is intended. */ ++ if (configuration.daemonize) { ++ log_set_stderr(0); ++ } ++ ++ INFO(PACKAGE"-"VERSION"-"BUILDSTR" "UNAME" starting up"); ++ + /* if a debug level > 0 has been given on the commandline use its + value and not what is in the config file */ + if (cmdline_debuglevel != 0) { +@@ -212,7 +219,6 @@ + setsid(); + if (fork()!=0) exit(0); + +- log_set_stderr(0); + INFO("daemonized, pid=%i", getpid()); + } + @@ . patch -p0 <<'@@ .' Index: openpkg-src/siproxd/siproxd.spec ============================================================================ $ cvs diff -u -r0 -r1.1 siproxd.spec --- /dev/null 2006-08-31 10:30:13 +0200 +++ siproxd.spec 2006-08-31 10:30:19 +0200 @@ -0,0 +1,157 @@ +## +## siproxd.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/> +## Copyright (c) 2000-2006 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: siproxd +Summary: SIP/RTP Proxy Server +URL: http://siproxd.sourceforge.net/ +Vendor: Thomas Ries +Packager: OpenPKG +Distribution: OpenPKG +Class: EVAL +Group: Network +License: GPL +Version: 0.5.13 +Release: 20060831 + +# package options +%option with_fsl yes + +# list of sources +Source0: http://switch.dl.sourceforge.net/siproxd/siproxd-%{version}.tar.gz +Source1: siproxd.conf +Source2: rc.siproxd +Source3: fsl.siproxd +Patch0: siproxd.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc +PreReq: OpenPKG, openpkg >= 20040130 +BuildPreReq: osip >= 2.2.3 +PreReq: osip >= 2.2.3 +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl >= 1.2.0 +PreReq: fsl >= 1.2.0 +%endif +AutoReq: no +AutoReqProv: no + +%description + Siproxd is a proxy/masquerading daemon for the Session Initiation + Protocol (SIP) Voice over IP (VoIP) protocol. It handles + registrations of SIP clients on a private IP network and performs + rewriting of the SIP message bodies to make SIP connections work via + an masquerading firewall (NAT). It allows SIP software or hardware + clients to work behind an IP masquerading firewall or NAT router. + +%track + prog siproxd = { + version = %{version} + url = http://prdownloads.sourceforge.net/siproxd/ + regex = siproxd-(__VER__)\.tar\.gz + } + +%prep + %setup -q + %patch -p0 + +%build + # configure program + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ + LIBS="%{l_fsl_libs}" \ + ./configure \ + --prefix=%{l_prefix} \ + --sysconfdir=%{l_prefix}/etc/siproxd \ + --with-libosip-prefix=%{l_prefix} + + # build program + %{l_make} %{l_mflags -O} + +%install + rm -rf $RPM_BUILD_ROOT + + # install program + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + + # strip down installation + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/siproxd/* + + # install default configuration + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE siproxd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/siproxd/ + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/siproxd + + # 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.siproxd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install OSSP fsl configuration + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.siproxd} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %{l_prefix}/etc/siproxd/*' \ + '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/siproxd' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + if [ $1 -eq 1 ]; then + # display final hints on initial installation + ( echo "You have to configure your particular network interfaces via" + echo "\"if_inbound\" and \"if_outbound\" in the configuration file" + echo "$RPM_INSTALL_PREFIX/etc/siproxd/siproxd.conf" + echo "before you can run siproxd in a reasonable way!" + ) | %{l_rpmtool} msg -b -t notice + fi + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} siproxd status 2>/dev/null` + [ ".$siproxd_active" = .yes ] && %{l_rc} siproxd restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} siproxd stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/siproxd/* >/dev/null 2>&1 || true + exit 0 + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org