1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/stun/stun.spec Fri Jan 09 00:45:56 2009 +0100 1.3 @@ -0,0 +1,124 @@ 1.4 +## 1.5 +## stun.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package version 1.28 +%define V_dist 0.96_Aug13 1.29 +%define V_opkg 0.96 1.30 + 1.31 +# package information 1.32 +Name: stun 1.33 +Summary: STUN Client & Server 1.34 +URL: http://www.vovida.org/applications/downloads/stun/ 1.35 +Vendor: Vovida 1.36 +Packager: OpenPKG Foundation e.V. 1.37 +Distribution: OpenPKG Community 1.38 +Class: EVAL 1.39 +Group: VoIP 1.40 +License: Open Source 1.41 +Version: %{V_opkg} 1.42 +Release: 20080101 1.43 + 1.44 +# list of sources 1.45 +Source0: http://switch.dl.sourceforge.net/stun/stund_%{V_dist}.tgz 1.46 +Source1: rc.stun 1.47 +Patch0: stun.patch 1.48 + 1.49 +# build information 1.50 +Prefix: %{l_prefix} 1.51 +BuildRoot: %{l_buildroot} 1.52 +BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc 1.53 +PreReq: OpenPKG, openpkg >= 20060823 1.54 +AutoReq: no 1.55 +AutoReqProv: no 1.56 + 1.57 +%description 1.58 + The STUN (Simple Traversal of UDP through NATs (Network Address 1.59 + Translation)) server is an implementation of the STUN protocol that 1.60 + enables STUN functionality in SIP-based systems. The STUN server 1.61 + tar ball also include a client API to enable STUN functionality in 1.62 + SIP endpoints. In addition there is a command line UNIX client and 1.63 + a graphical windows client that check what type of NAT the user is 1.64 + using. STUN is an application-layer protocol that can determine the 1.65 + public IP and nature of a NAT device that sits between the STUN 1.66 + client and STUN server. The current version of the code supports 1.67 + most of RFC 3489 except the ability to get OTPs from the server. 1.68 + 1.69 +%track 1.70 + prog stun = { 1.71 + version = %{V_dist} 1.72 + url = http://prdownloads.sourceforge.net/stun/ 1.73 + regex = stund_(.+?)\.tgz 1.74 + } 1.75 + 1.76 +%prep 1.77 + %setup -q -n stund 1.78 + %patch -p0 1.79 + 1.80 +%build 1.81 + %{l_make} %{l_mflags} \ 1.82 + CXX="%{l_cxx}" \ 1.83 + CXXFLAGS="%{l_cxxflags -O}" \ 1.84 + LDFLAGS="" 1.85 + 1.86 +%install 1.87 + rm -rf $RPM_BUILD_ROOT 1.88 + %{l_shtool} mkdir -f -p -m 755 \ 1.89 + $RPM_BUILD_ROOT%{l_prefix}/bin \ 1.90 + $RPM_BUILD_ROOT%{l_prefix}/sbin \ 1.91 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 1.92 + $RPM_BUILD_ROOT%{l_prefix}/var/stun 1.93 + %{l_shtool} install -c -s -m 755 \ 1.94 + client $RPM_BUILD_ROOT%{l_prefix}/bin/stun 1.95 + %{l_shtool} install -c -s -m 755 \ 1.96 + server $RPM_BUILD_ROOT%{l_prefix}/sbin/stund 1.97 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.98 + %{SOURCE rc.stun} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 1.99 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 1.100 + 1.101 +%files -f files 1.102 + 1.103 +%clean 1.104 + rm -rf $RPM_BUILD_ROOT 1.105 + 1.106 +%post 1.107 + if [ $1 -eq 1 ]; then 1.108 + # display final hints on initial installation 1.109 + ( echo "Before starting the STUN daemon, please set the configuration" 1.110 + echo "variables \"stun_bind_addr{1,2}\" in $RPM_INSTALL_PREFIX/etc/rc.conf" 1.111 + echo "to two *different* IP addresses bound to your host. STUN requires this." 1.112 + ) | %{l_rpmtool} msg -b -t notice 1.113 + fi 1.114 + 1.115 + # after upgrade, restart service 1.116 + [ $1 -eq 2 ] || exit 0 1.117 + eval `%{l_rc} stun status 2>/dev/null` 1.118 + [ ".$stun_active" = .yes ] && %{l_rc} stun restart 1.119 + exit 0 1.120 + 1.121 +%preun 1.122 + # before erase, stop service and remove log files 1.123 + [ $1 -eq 0 ] || exit 0 1.124 + %{l_rc} stun stop 2>/dev/null 1.125 + rm -f $RPM_INSTALL_PREFIX/var/stun/stun.pid >/dev/null 2>&1 || true 1.126 + exit 0 1.127 +