#
# spec file for package libosmo-sccp
#
# Copyright (c) 2013 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/
#


Name:           libosmo-sccp
Summary:        Osmocom library for the A-bis interface between BTS and BSC
License:        AGPL-3.0+ and GPL-2.0+
Group:          Development/Libraries/C and C++
Version:        0.0.6.3
Release:        0
Url:            http://openbsc.osmocom.org/

#Git-Clone:	git://git.osmocom.org/libosmo-sccp
#Snapshot:      0.0.6.3
Source:         %name-%version.tar.xz
Patch1:         0001-build-fixes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake >= 1.6
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  xz
BuildRequires:  pkgconfig(libosmocore) >= 0.3.0
BuildRequires:  pkgconfig(libosmogsm)
BuildRequires:  pkgconfig(talloc)

%description
Osmocom library for the A-bis interface between BTS and BSC.

%package -n libosmo-m2ua-0_0_6_3
Summary:        Osmocom Message Transfer Part 2 User Adaptation library
License:        AGPL-3.0+
Group:          System/Libraries

%description -n libosmo-m2ua-0_0_6_3
M2UA (RFC 3331) provides an SCTP (RFC 3873) adaptation layer for the
seamless backhaul of MTP Level 2 user messages and service interface
across an IP network.

%package -n libosmo-m2ua-devel
Summary:        Development files for the Osmocom M2UA library
License:        AGPL-3.0+
Group:          Development/Libraries/C and C++
Requires:       libosmo-m2ua-0_0_6_3 = %version

%description -n libosmo-m2ua-devel
M2UA provides an SCTP adaptation layer for MTP level 2 user messages
and service interface across an IP network.

This subpackage contains the development files for the Osmocom M2UA
library.

%package -n libosmo-mtp-0_0_6_3
Summary:        Osmocom Message Transfer Part library
License:        GPL-2.0+
Group:          System/Libraries

%description -n libosmo-mtp-0_0_6_3
The Message Transfer Part (MTP) is part of the Signaling System 7
(SS7) used for communication in Public Switched Telephone Networks.
MTP is responsible for reliable, unduplicated and in-sequence
transport of SS7 messages between communication partners.

%package -n libosmo-mtp-devel
Summary:        Development files for the Osmocom MTP library
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Requires:       libosmo-mtp-0_0_6_3 = %version

%description -n libosmo-mtp-devel
MTP is part of SS7 used for communication in Public Switched
Telephone Networks.

This subpackage contains the development files for the Osmocom MTP
library.

%package -n libosmo-sccp-0_0_6_3
Summary:        Osmocom Signalling Connection Control Part library
License:        GPL-2.0+
Group:          System/Libraries

%description -n libosmo-sccp-0_0_6_3
The Signalling Connection Control Part (SCCP) is a network layer
protocol that provides extended routing, flow control, segmentation,
connection-orientation, and error correction facilities in Signaling
System 7 telecommunications networks. SCCP relies on the services of
MTP for basic routing and error detection.

%package -n libosmo-sccp-devel
Summary:        Development files for the Osmocom SCCP library
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Requires:       libosmo-sccp-0_0_6_3 = %version

%description -n libosmo-sccp-devel
SCCP is a network layer protocol that provides routing, flow control,
segmentation, connection-orientation, and error correction facilities
in SS7 telecommunications networks.

This subpackage contains the development files for the Osmocom SCCP
library.

%prep
%setup -qn %name
%patch -P 1 -p1

%build
echo "%version" >.tarball-version
autoreconf -fiv
%configure --enable-shared --disable-static
make %{?_smp_mflags}

%install
b="%buildroot"
make %{?_smp_mflags} install DESTDIR="$b"
find "$b/%_libdir" -type f -name "*.la" -delete

%check
make %{?_smp_mflags} check

%post   -n libosmo-m2ua-0_0_6_3 -p /sbin/ldconfig
%postun -n libosmo-m2ua-0_0_6_3 -p /sbin/ldconfig
%post   -n libosmo-mtp-0_0_6_3 -p /sbin/ldconfig
%postun -n libosmo-mtp-0_0_6_3 -p /sbin/ldconfig
%post   -n libosmo-sccp-0_0_6_3 -p /sbin/ldconfig
%postun -n libosmo-sccp-0_0_6_3 -p /sbin/ldconfig

%files -n libosmo-m2ua-0_0_6_3
%defattr(-,root,root)
%_libdir/libosmo-m2ua-%version.so

%files -n libosmo-m2ua-devel
%defattr(-,root,root)
%dir %_includedir/osmocom
%_includedir/osmocom/m2ua/
%_libdir/libosmo-m2ua.so

%files -n libosmo-mtp-0_0_6_3
%defattr(-,root,root)
%_libdir/libosmo-mtp-%version.so

%files -n libosmo-mtp-devel
%defattr(-,root,root)
%dir %_includedir/osmocom
%_includedir/osmocom/mtp/
%_libdir/libosmo-mtp.so
%_libdir/pkgconfig/libosmo-mtp.pc

%files -n libosmo-sccp-0_0_6_3
%defattr(-,root,root)
%_libdir/libosmo-sccp.so
%_libdir/libosmo-sccp-%version.so

%files -n libosmo-sccp-devel
%defattr(-,root,root)
%dir %_includedir/osmocom
%_includedir/osmocom/sccp/
%_libdir/pkgconfig/libosmo-sccp.pc

%changelog