File ortp.spec of Package ortp

#
# spec file for package ortp
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Mariusz Fik <fisiu@opensuse.org>.
#
# 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/
#


%define soname  libortp
%define sover   12
Name:           ortp
Version:        0.27.0
Release:        0
Summary:        Real-time Transport Protocol Stack
License:        LGPL-2.1+
Group:          Productivity/Telephony/Utilities
Url:            http://linphone.org/eng/documentation/dev/ortp.html
Source:         https://github.com/BelledonneCommunications/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source4:        baselibs.conf
BuildRequires:  cmake >= 3.0
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(bctoolbox)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
oRTP is a LGPL licensed C library implementing the RTP protocol
(rfc1889).

%package -n %{soname}%{sover}
Summary:        Real-time Transport Protocol Stack
Group:          System/Libraries

%description -n %{soname}%{sover}
oRTP is a LGPL licensed C library implementing the RTP protocol
(rfc1889).

%package devel
Summary:        Headers, libraries and docs for the oRTP library
Group:          Development/Libraries/C and C++
Requires:       %{soname}%{sover} = %{version}
Requires:       cmake
Provides:       %{soname}-devel = %{version}
Obsoletes:      %{soname}-devel < %{version}

%description devel
oRTP is a LGPL licensed C library implementing the RTP protocol
(rfc1889).

This package contains header files and development libraries needed to
develop programs using the oRTP library.

%prep
%setup -q

%build
%cmake \
  -DENABLE_TESTS=yes \
  -DENABLE_STATIC=no \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo
make %{?_smp_mflags}

%install
%cmake_install
sed -i "s|%{_prefix}/lib|%{_libdir}|g" %{buildroot}%{_libdir}/pkgconfig/%{name}.pc

%post -n %{soname}%{sover} -p /sbin/ldconfig
%postun -n %{soname}%{sover} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING
%{_bindir}/mrtprecv
%{_bindir}/mrtpsend
%{_bindir}/rtprecv
%{_bindir}/rtpsend
%{_bindir}/rtpsend_stupid
%{_bindir}/test_timer
%{_bindir}/tevrtprecv
%{_bindir}/tevrtpsend

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

%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_datadir}/oRTP/
%{_includedir}/%{name}/
%{_libdir}/%{soname}.so
%{_libdir}/pkgconfig/%{name}.pc

%changelog
openSUSE Build Service is sponsored by