File opal.spec of Package opal

#
# spec file for package opal (Version 3.6.6)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           opal
BuildRequires:  capi4linux-devel
BuildRequires:  gcc-c++
BuildRequires:  libgsm-devel
BuildRequires:  libpt2-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libtheora-devel
BuildRequires:  speex-devel
BuildRequires:  swig
# FIXME: we're missing zrtp, ffmpeg, x264, CELT support (no packages for this).
# 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://openh323.sourceforge.net/
License:        MPL ..
Group:          System/Libraries
Version:        3.6.6
Release:        1
Source0:        %{name}-%{version}.tar.bz2
Patch0:         %{name}-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
# Require the version of libpt2 we used to build the package to avoid version
# missing symbols provided by newer versions. Newer versions do not bump the
# soversion if the API was only extended.
# Helps avoiding bugs like i.e. bnc#538176
Requires:       %(rpm -q --qf "%%{name} = %%{version}" libpt2)
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 devel
License:        MPL ..
Summary:        Development package for opal
Group:          Development/Libraries/C and C++
Requires:       opal = %{version} libpt2-devel

%description devel
Static libraries and header files for development with opal.



%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
# this subdir contains GPL - to avoid license issues delete it before build
rm -rf plugins/LID/VPB

%build
# PWlib versioncheck does not work properly
# Can support Voicetronix vpb
OPTCCFLAGS="$RPM_OPT_FLAGS"
%configure \
	--enable-zrtp \
	--enable-sbc \
	--enable-ixj \
	--enable-capi
make %{?jobs:-j%jobs}

%install
%makeinstall

%post -n opal -p /sbin/ldconfig

%postun -n opal -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc  mpl-1.0.htm Change*
%{_libdir}/*.so.*
%dir %{_libdir}/%{name}-%{version}
%dir %{_libdir}/%{name}-%{version}/codecs
%{_libdir}/%{name}-%{version}/codecs/audio
%{_libdir}/%{name}-%{version}/codecs/video
%{_libdir}/%{name}-%{version}/lid

%files devel
%defattr(-,root,root)
%{_includedir}/opal
%{_libdir}/*.so
%attr(644,root,root) %{_libdir}/*.a
%{_libdir}/pkgconfig/opal.pc

%changelog
openSUSE Build Service is sponsored by