File libpt2.spec of Package libpt2

#
# spec file for package libpt2 (Version 2.6.7)
#
# 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/
#


%define build_avc 0
%define build_dc 0

Name:           libpt2
%define _name   ptlib
Version:        2.6.7
Release:        3
# FIXME: when upgrading, check if the dc plugin builds with the current version of libdc1394
%define _version 2_6_7
License:        MPLv1.0
Summary:        Portable Windows Library from Equivalence Pty. Ltd. version 2
Url:            http://www.opalvoip.org/
Group:          System/Libraries
# https://sourceforge.net/projects/opalvoip
Source:         %{_name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM %{_name}-pkg_config.patch sf#3041093 reddwarf@opensuse.org -- Put extra libraries in Libs.private and remove unneeded cflags
Patch0:         %{_name}-pkg_config.patch
# PATCH-FIX-UPSTREAM %{_name}-missing_links.patch sf#3082616 reddwarf@opensuse.org -- Link plugins against main library
Patch1:         %{name}-2.6.7-missing_links.patch
BuildRequires:  SDL-devel
BuildRequires:  bison
BuildRequires:  esound-devel
BuildRequires:  flex
BuildRequires:  gcc-c++
%if %{build_avc}
BuildRequires:  libavc1394-devel
%endif
%if %{build_dc}
BuildRequires:  libdc1394-devel
%endif
BuildRequires:  libdv-devel
BuildRequires:  libexpat-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libv4l-devel
BuildRequires:  openldap2-devel
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This is a moderately large class library that was created many years
ago as a method to produce applications that run on both Microsoft
Windows and the X Window System.

%package -n libpt%{_version}

License:        MPLv1.0
Summary:        Portable Windows Library from Equivalence Pty. Ltd. version 2
Group:          System/Libraries
# This used to be a subpackage
Provides:       libpt2-plugins-v4l2 = %{version}
Obsoletes:      libpt2-plugins-v4l2 < %{version}
%if ! %{build_avc}
Obsoletes:      libpt%{_version}-plugins-avc <= %{version}
%endif
%if ! %{build_dc}
Obsoletes:      libpt%{_version}-plugins-dc <= %{version}
%endif

%description -n libpt%{_version}
This is a moderately large class library that was created many years
ago as a method to produce applications that run on both Microsoft
Windows and the X Window System.

%package -n libpt-devel
License:        MPLv1.0
Summary:        Development files for %{name} (includes headers and scripts)
Group:          Development/Libraries/C and C++
Requires:       libpt%{_version} = %{version}
Conflicts:      pwlib-devel
# libpt2-devel was last used in openSUSE 11.3
Provides:       libpt2-devel = %{version}
Obsoletes:      libpt2-devel < %{version}

%description -n libpt-devel
This package includes header files and scripts needed for developers
using the %{name} library.

%package -n libpt%{_version}-plugins-esd

License:        MPLv1.0
Summary:        ESD plugin for %{name}
Group:          System/Libraries
Requires:       libpt%{_version} = %{version}
# No idea about why this provides is here. Feel free to remove it if you think
# is the best thing to do... or to add an explanation about why it is useful.
Provides:       libpt2-audio-plugin

%description -n libpt%{_version}-plugins-esd
This plugin enables ESD (Enlightened Sound Daemon) support in %{name}.

%if %{build_avc}

%package -n libpt%{_version}-plugins-avc

License:        MPLv1.0
Summary:        AVC plugin for %{name}
Group:          System/Libraries
Requires:       libpt%{_version} = %{version}
Provides:       libpt2-video-plugin
# Package name that was last used in openSUSE 11.3
Provides:       libpt2-plugins-avc = %{version}
Obsoletes:      libpt2-plugins-avc < %{version}

%description -n libpt%{_version}-plugins-avc
This plugin enables AVC (firewire control for digital video cameras)
support in %{name}.
%endif

%if %{build_dc}

%package -n libpt%{_version}-plugins-dc

License:        MPLv1.0
Summary:        DC plugin for %{name}
Group:          System/Libraries
Requires:       libpt%{_version} = %{version}
Provides:       libpt2-video-plugin
# Package name that was last used in openSUSE 11.3
Provides:       libpt2-plugins-dc = %{version}
Obsoletes:      libpt2-plugins-dc < %{version}

%description -n libpt%{_version}-plugins-dc
This plugin enables DC control (via firewire for digital video cameras)
for %{name}.
%endif

%package -n libpt%{_version}-plugins-v4l

License:        MPLv1.0
Summary:        V4L support for %{name}
Group:          System/Libraries
Requires:       libpt%{_version} = %{version}
Provides:       libpt2-video-plugin

%description -n libpt%{_version}-plugins-v4l
This plugin enables 'video for linux' (version 1) support (e.g. for USB
cameras) for %{name}.

%prep
%setup -q -n %{_name}-%{version}
%patch0
%patch1

%build
%configure \
	--enable-esd \
	--enable-oss \
	--enable-v4l \
	--enable-avc
make %{?_smp_mflags} V=1

%install
%makeinstall
rm -f %{buildroot}%{_libdir}/libpt_s.a

%post -n libpt%{_version} -p /sbin/ldconfig

%postun -n libpt%{_version} -p /sbin/ldconfig

%files -n libpt%{_version}
%defattr(-,root,root)
%doc mpl-1.0.htm History.txt
%{_libdir}/libpt.so.2*
# We explicitly list the plugins that are shipped by default to make sure we
# don't lose any without noticing it
%dir %{_libdir}/%{_name}-%{version}
%dir %{_libdir}/%{_name}-%{version}/devices
%dir %{_libdir}/%{_name}-%{version}/devices/sound
%dir %{_libdir}/%{_name}-%{version}/devices/videoinput
%{_libdir}/%{_name}-%{version}/devices/sound/alsa_pwplugin.so
%{_libdir}/%{_name}-%{version}/devices/sound/oss_pwplugin.so
%{_libdir}/%{_name}-%{version}/devices/videoinput/v4l2_pwplugin.so

%files -n libpt-devel
%defattr(0644,root,root,0755)
%doc ReadMe.txt ReadMe_QOS.txt
%{_datadir}/ptlib/
%attr(0755, root, root) %{_datadir}/ptlib/make/ptlib-config
%{_includedir}/ptbuildopts.h
%{_includedir}/ptlib.h
%{_includedir}/ptlib/
%{_includedir}/ptclib/
%{_bindir}/ptlib-config
%{_libdir}/libpt.so
%{_libdir}/pkgconfig/ptlib.pc

%files -n libpt%{_version}-plugins-esd
%defattr(-,root,root)
%{_libdir}/%{_name}-%{version}/devices/sound/esd_pwplugin.so

%if %{build_avc}

%files -n libpt%{_version}-plugins-avc
%defattr(-,root,root)
%{_libdir}/%{_name}-%{version}/devices/videoinput/avc_pwplugin.so
%endif

%if %{build_dc}

%files -n libpt%{_version}-plugins-dc
%defattr(-,root,root)
%{_libdir}/%{_name}-%{version}/devices/videoinput/dc_pwplugin.so
%endif

%files -n libpt%{_version}-plugins-v4l
%defattr(-,root,root)
%{_libdir}/%{_name}-%{version}/devices/videoinput/v4l_pwplugin.so

%changelog
openSUSE Build Service is sponsored by