File stun.spec of Package stun

Summary:        STUN server and client
Name:           stun
Version:        0.96
Release:        0
License:        BSD
Group:          Productivity/Telephony
URL:            http://www.vovida.org/applications/downloads/stun/
Source0:        http://prdownloads.sourceforge.net/stun/stund_%{version}_Aug13.tar.bz2
Source1:        stun-server.init
Source2:        stun-server.sysconfig
Patch0:         stund-0.94-mdk_conf.diff
Patch1:         stund-0.96-x86_64.diff
Patch2:         stun-checkinit.diff
BuildRequires:	dos2unix
BuildRequires:	gcc-c++
BuildRequires:	openssl-devel
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%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.

%package         server
Summary:         STUN server
Group:           Productivity/Telephony/Servers

%description     server
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.

This package contains the STUN server.

%package        client
Summary:        STUN client
Group:          Productivity/Telephony/Clients

%description    client
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.

This package contains the STUN client.

%prep

%setup -q -n stund
%patch0 -p1
%patch1 -p0
%patch2 -p0

# strip away annoying ^M
find -type f -exec dos2unix -U {} \;

cp %{SOURCE1} stun-server.init
cp %{SOURCE2} stun-server.sysconfig

%build

make CXXFLAGS="%{optflags}"

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_initrddir}

install -m0755 stun-server %{buildroot}%{_sbindir}/stun-server
install -m0755 stun-client %{buildroot}%{_sbindir}/stun-client 

install -m0755 stun-server.init %{buildroot}%{_initrddir}/stun-server
ln -sf ../../etc/init.d/stun-server $RPM_BUILD_ROOT/usr/sbin/rcstun-server
install -m0644 stun-server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/stun-server

%post server
%{fillup_and_insserv -s stun-server START_STUND }
#%_post_service stun-server

%preun server
%stop_on_removal stun-server
#%_preun_service stun-server

%postun
%restart_on_update stun-server
%{insserv_cleanup}


%clean
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

%files server
%defattr(-,root,root,-)
%doc nattest nattestwarning.txt rfc3489.txt
%attr(0755,root,root) %{_initrddir}/stun-server
%attr(0755,root,root) %{_sbindir}/rcstun-server
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/stun-server
%attr(0755,root,root) %{_sbindir}/stun-server

%files client
%defattr(-,root,root,-)
%attr(0755,root,root) %{_sbindir}/stun-client 


%changelog
* Mon Mar 26 2007 Oden Eriksson <oeriksson@mandriva.com> 0.96-2mdv2007.1
+ Revision: 148937
- added p2 by  Christofer Edvardsen "The server did not check the return
- status of stunInitServer before forking to background. This caused the
- server to silently die after start instead of failing on startup when
- for example a faulty ip address was supplied."

* Tue Oct 17 2006 Stefan van der Eijk <stefan@mandriva.org> 0.96-1mdv2007.0
+ Revision: 66058
- 0.96
+ Nicolas Lécureuil <neoclust@mandriva.org>
- 0.94-6mdv2007.0
- Import stun

* Wed Nov 30 2005 Oden Eriksson <oeriksson@mandriva.com> 0.94-5mdk
- rebuilt against openssl-0.9.8a

* Wed Oct 19 2005 Nicolas L�cureuil <neoclust@mandriva.org> 0.94-4mdk
- Fix PreReq

* Wed Oct 19 2005 Nicolas L�cureuil <neoclust@mandriva.org> 0.94-3mdk
- Fix BuildRequires

* Thu May 12 2005 Oden Eriksson <oeriksson@mandriva.com> 0.94-2mdk
- make it compile on x86_64 (P1)
- use better anti ^M stripper

* Thu Apr 28 2005 Oden Eriksson <oeriksson@mandriva.com> 0.94-1mdk
- initial Mandriva package
openSUSE Build Service is sponsored by