diff -r 64165e101f08 -r d42d557c7a5a stun/stun.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stun/stun.spec Fri Jan 09 00:45:56 2009 +0100 @@ -0,0 +1,124 @@ +## +## stun.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## 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 version +%define V_dist 0.96_Aug13 +%define V_opkg 0.96 + +# package information +Name: stun +Summary: STUN Client & Server +URL: http://www.vovida.org/applications/downloads/stun/ +Vendor: Vovida +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: VoIP +License: Open Source +Version: %{V_opkg} +Release: 20080101 + +# list of sources +Source0: http://switch.dl.sourceforge.net/stun/stund_%{V_dist}.tgz +Source1: rc.stun +Patch0: stun.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc +PreReq: OpenPKG, openpkg >= 20060823 +AutoReq: no +AutoReqProv: no + +%description + The STUN (Simple Traversal of UDP through NATs (Network Address + Translation)) server is an implementation of the STUN protocol that + enables STUN functionality in SIP-based systems. The STUN server + tar ball also include a client API to enable STUN functionality in + SIP endpoints. In addition there is a command line UNIX client and + a graphical windows client that check what type of NAT the user is + using. STUN is an application-layer protocol that can determine the + public IP and nature of a NAT device that sits between the STUN + client and STUN server. The current version of the code supports + most of RFC 3489 except the ability to get OTPs from the server. + +%track + prog stun = { + version = %{V_dist} + url = http://prdownloads.sourceforge.net/stun/ + regex = stund_(.+?)\.tgz + } + +%prep + %setup -q -n stund + %patch -p0 + +%build + %{l_make} %{l_mflags} \ + CXX="%{l_cxx}" \ + CXXFLAGS="%{l_cxxflags -O}" \ + LDFLAGS="" + +%install + rm -rf $RPM_BUILD_ROOT + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/bin \ + $RPM_BUILD_ROOT%{l_prefix}/sbin \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/var/stun + %{l_shtool} install -c -s -m 755 \ + client $RPM_BUILD_ROOT%{l_prefix}/bin/stun + %{l_shtool} install -c -s -m 755 \ + server $RPM_BUILD_ROOT%{l_prefix}/sbin/stund + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.stun} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + if [ $1 -eq 1 ]; then + # display final hints on initial installation + ( echo "Before starting the STUN daemon, please set the configuration" + echo "variables \"stun_bind_addr{1,2}\" in $RPM_INSTALL_PREFIX/etc/rc.conf" + echo "to two *different* IP addresses bound to your host. STUN requires this." + ) | %{l_rpmtool} msg -b -t notice + fi + + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} stun status 2>/dev/null` + [ ".$stun_active" = .yes ] && %{l_rc} stun restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} stun stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/stun/stun.pid >/dev/null 2>&1 || true + exit 0 +