File opal.spec of Package opal

#
# spec file for package opal (Version 3.6.8)
#
# Copyright (c) 2010 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 ffmpeg
%bcond_with x264

Name:           opal
BuildRequires:  capi4linux-devel
BuildRequires:  gcc-c++
BuildRequires:  libgsm-devel
BuildRequires:  ilbc
BuildRequires:  libcelt-devel
%if %{with ffmpeg}
BuildRequires:  libffmpeg-devel
%endif
BuildRequires:  libopenssl-devel
BuildRequires:  libpt-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libtheora-devel
%if %{with x264}
BuildRequires:  libx264-devel
%endif
BuildRequires:  pkg-config
BuildRequires:  speex-devel
BuildRequires:  swig
# FIXME: ZRTP is implemented through libzrtp. Its webpage says it's AGPL, but I
# was unable to find a copy with that license. srtp is in Contrib, it should be
# moved back to support it here.
# FIXME: the spandsp library we have is too recent for opal, with not the
# expected API.
#BuildRequires:  spandsp-devel
Summary:        Open Phone Abstraction Library
Url:            http://www.opalvoip.org/
License:        MPLv1.0
Group:          System/Libraries
Version:        3.6.8
Release:        3
# FIXME: we should probably list all plugins in %files to make sure we don't lose some when updating the package.
%define _version 3_6_8
Source0:        %{name}-%{version}.tar.bz2
Patch0:         opal-3.4.2.diff
# PATCH-FIX-UPSTREAM opal-system-libgsm.patch vuntz@novell.com -- Fix detection of system libgsm
Patch1:         opal-system-libgsm.patch
# PATCH-FIX-UPSTREAM opal-fix-ambiguous.patch vuntz@novell.com -- Fix ambiguous code
Patch2:         opal-fix-ambiguous.patch
# PATCH-FIX-UPSTREAM opal-3.6.6-non_void.patch bgo#611561 ro@novell.com -- Fix no-return-in-non-void-function.
Patch3:         opal-3.6.6-non_void.patch
# PATCH-FIX-UPSTREAM %{name}-pkg_config.patch sf#3041093 reddwarf@opensuse.org -- Put extra libraries in Libs.private and remove unneeded cflags
Patch4:         %{name}-pkg_config.patch
# PATCH-FIX-UPSTREAM %{name}-codecs.patch sf#3041295 reddwarf@opensuse.org -- Fix ffmpeg and x264 runtime detection
Patch5:         %{name}-codecs.patch
# PATCH-FIX-UPSTREAM %{name}-x264.patch bgo#596006 reddwarf@opensuse.org -- Makes H.264 work, but the quality is worse than should. Check the bug from time to time for a better fix.
Patch6:         %{name}-x264.patch
# PATCH-FIX-UPSTREAM %{name}-missing_links.patch sf#3082716 reddwarf@opensuse.org -- Fix underlinking and makes IxJ plugin installable
Patch7:         %{name}-missing_links.patch
# PATCH-FIX-UPSTREAM opal-new-celt.patch vuntz@opensuse.org -- Fix build with recent version of celt, taken from PLD Linux, http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/opal/opal-celt.patch
Patch8:         opal-new-celt.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Open Phone Abstraction Library, implementation of the ITU H.323
teleconferencing protocol, and successor of the openh323 library. It
supports the H.323 protocol as well as SIP and IAX2.



%package -n lib%{name}%{_version}


License:        MPLv1.0
Summary:        Open Phone Abstraction Library
Group:          System/Libraries

%description -n lib%{name}%{_version}
Open Phone Abstraction Library, implementation of the ITU H.323
teleconferencing protocol, and successor of the openh323 library. It
supports the H.323 protocol as well as SIP and IAX2.



%package -n lib%{name}-devel


License:        MPLv1.0
Summary:        Development package for %{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{_version} = %{version} libpt-devel
# opal-devel was last used in openSUSE 11.3
Provides:       opal-devel = %{version}
Obsoletes:      opal-devel < %{version}

%description -n lib%{name}-devel
Static libraries and header files for development with opal.



%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3
%patch4
%patch5
%patch6 -p1
%patch7
%if 0%{?suse_version} > 1130
%patch8 -p1
%endif
# this subdir contains GPL - to avoid license issues delete it before build
rm -rf plugins/LID/VPB

%build
%if %{with ffmpeg} || %{with x264}
cd plugins
autoreconf -fi
cd ..
%endif
# Can support Voicetronix vpb
%configure \
	--enable-sbc \
	--enable-ixj \
	--enable-capi
make %{?_smp_mflags} VERBOSE=1

%install
%makeinstall
rm -f %{buildroot}%{_libdir}/lib%{name}_s.a

%post -n lib%{name}%{_version} -p /sbin/ldconfig

%postun -n lib%{name}%{_version} -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -n lib%{name}%{_version}
%defattr(-,root,root)
%doc  mpl-1.0.htm Change*
%{_libdir}/*.so.*
# FIXME: we should probably list all plugins to make sure we don't
# lose some when updating the package.
%{_libdir}/%{name}-%{version}/

%files -n lib%{name}-devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc

%changelog
openSUSE Build Service is sponsored by