File pjproject.spec of Package pjproject

#
# spec file for package pjproject
#
# Copyright (c) 2017 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:           pjproject
Version:        2.10
Release:        0
License:        GPL-2.0
Summary:        Free and open source multimedia communication library
Url:            http://www.pjsip.org
Group:          Productivity/Telephony/Servers
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  gcc-c++ libopenssl-devel alsa-devel libsrtp-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%package devel
Summary:        Development package for pjproject
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description
PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE.

%description devel
Development package for pjproject.

%prep
%setup -q

%build
# * WebRTC support is disabled because WebRTC module requires emmintrin.h which is not provided for ARM.
# * External SRTP is required to avoid the libsrtp.so conflict between libsrtp-devel and this.
%configure --enable-shared --disable-sdl --disable-ffmpeg --disable-v4l2 \
  --disable-openh264 --enable-ssl --disable-libwebrtc --with-external-srtp
# disable parallel build due to race condition
# %{?_smp_mflags}
make all

%install
# %{?_smp_mflags}
make DESTDIR=%{buildroot} install # %{?_smp_mflags}

%if "%{?_lto_cflags}"
# remove *.a files because these should not be shipped if LTO is enabled;
# see https://en.opensuse.org/openSUSE:LTO
rm -f %{buildroot}%{_libdir}/*.a
%define ARCHIVE_NOT_INSTALLED 1
%endif

%files
%defattr(-,root,root)
%doc README.txt COPYING
%{_libdir}/*.so.2

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%if "%{?_lto_cflags}"
%else
%{_libdir}/*.a
%endif
%{_includedir}/*
%{_libdir}/pkgconfig/*

%post
/sbin/ldconfig

%postun
/sbin/ldconfig
openSUSE Build Service is sponsored by