File vanessa_socket.spec of Package vanessa_socket

#
# spec file for package vanessa_socket
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%bcond_with renamed_pkgconfig

Name:           vanessa_socket

%define libname   lib%{name}
%define libsoname %{libname}2

Summary:        Simplify TCP/IP socket operations
Version:        0.0.12
Release:        1
License:        LGPL-2.1+
Group:          System/Libraries
Url:            http://www.vergenet.net/linux/vanessa/
Source0:        http://horms.net/projects/vanessa/download/vanessa_socket/%{version}/vanessa_socket-%{version}.tar.bz2
Source2:        baselibs.conf
Patch0:         %{name}-0.0.12-pkgconfig_DATA.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{with renamed_pkgconfig}
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
%endif
BuildRequires:  gcc-c++
BuildRequires:  pkg-config
BuildRequires:  popt-devel
BuildRequires:  vanessa_logger-devel

%description
Library to simplify TCP/IP socket operations. Includes code to
open a socket to a server as a client, to listen on socket for
clients as a server and to pipe information between sockets.

%package -n %{libsoname}
Summary:        Shared libraries for simplifying TCP/IP socket operations
Group:          System/Libraries

%description -n %{libsoname}
This package contains the shared libraries needed by programs built
with vanessa_socket

Library to simplify TCP/IP socket operations. Includes code to
open a socket to a server as a client, to listen on socket for
clients as a server and to pipe information between sockets.

%package devel
Summary:        Headers and static libraries for development
Group:          Development/Libraries/C and C++
Requires:       %{libsoname} = %{version}
Requires:       vanessa_logger-devel

%description devel
Headers and static libraries required to develop against libvanessa_socket.

%package pipe
License:        GPLv2+
Summary:        Trivial TCP/IP pipe build using libvanessa_adt
Group:          Productivity/Networking/Other

%description pipe
A TCP/IP pipe is a user space programme that listens for TCP/IP connections on
port on the local host and when a client connects makes a connection to a
TCP/IP port, possibly on another host. Once both connections are established
data sent on one connection is relayed to the other, hence forming a
bi-directional pipe.

Uses include enabling connections to specific ports on hosts behind a
packet filter.

This code is intended primarily as an example of how many of the
features of libvanessa_socket work.

%prep
set -x
%setup -q
%if %{with renamed_pkgconfig}
%patch0 -p1
mv vanessa-socket.pc.in %{name}.pc.in
%endif

%build
%if %{with renamed_pkgconfig}
autoreconf -vif
%endif
%configure --disable-static --disable-silent-rules
make %{?_smp_mflags}

%install
make install DESTDIR="%{buildroot}"

%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig

%clean
%{__rm} -rf %{buildroot}

%files -n %{libsoname}
%defattr(-,root,root)
%{_libdir}/%{libname}.so.*

%files devel
%defattr(-,root,root)
%{_libdir}/%{libname}.la
%{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*.h
%doc AUTHORS ChangeLog COPYING NEWS README TODO

%files pipe
%defattr(-,root,root)
%{_bindir}/vanessa_socket_pipe
%{_mandir}/man1/vanessa_socket_pipe.*
%doc vanessa_socket_pipe/COPYING

%changelog
openSUSE Build Service is sponsored by