File libpt2.spec of Package libpt2

#
# spec file for package libpt2 (Version 2.4.2)
#
# Copyright (c) 2008 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:           libpt2
%define	_name	ptlib
Version:        2.4.2
Release:        2
BuildRequires:  SDL-devel bison esound-devel flex gcc-c++ libavc1394-devel libdc1394_control12-devel libdv-devel libexpat-devel libstdc++-devel openldap2-devel
Url:            http://www.openh323.org/
License:        MOZILLA PUBLIC LICENSE (MPL/NPL)
Group:          System/Libraries
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
AutoReqProv:    on
Summary:        Portable Windows Library from Equivalence Pty. Ltd. version 2
# https://sourceforge.net/projects/openh323
Source:         %{_name}-%{version}.tar.bz2
Patch:          %{_name}-%{version}.diff
Patch1:         %{_name}-soname.diff

%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. It is used for the opal project, see
www.openh323.org for details.



Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%package devel
License:        MOZILLA PUBLIC LICENSE (MPL/NPL)
Requires:       %{name} = %{version} SDL-devel libexpat-devel openldap2-devel openssl-devel
Conflicts:      pwlib-devel 
Summary:        Development files for libpt2 (includes headers and scripts)
Group:          Development/Libraries/C and C++

%description devel
This package includes header files and scripts needed for developers
using the libpt2 library.



Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%package plugins-avc
License:        MOZILLA PUBLIC LICENSE (MPL/NPL)
Provides:       libpt2-video-plugin
Summary:        AVC plugin for libpt2
Requires:       %{name} = %{version}
Group:          System/Libraries

%description plugins-avc
This plugin enables AVC (firewire control for digital video cameras)
support in libpt2.



Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%package plugins-dc
License:        MOZILLA PUBLIC LICENSE (MPL/NPL)
Provides:       libpt2-video-plugin
Summary:        DC plugin for libpt
Requires:       %{name} = %{version}
Group:          System/Libraries

%description plugins-dc
This plugin enables DC control (via firewire for digital video cameras)
for libpt2.



Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%package plugins-v4l2
License:        MOZILLA PUBLIC LICENSE (MPL/NPL)
Provides:       libpt2-video-plugin
Summary:        V4L2 support for libpt2
Requires:       %{name} = %{version}
Group:          System/Libraries

%description plugins-v4l2
This plugin enables 'video for linux' (version 2) support (e.g. for USB
cameras) for libpt2.



Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%prep
%setup -q -n %{_name}-%{version}
%patch
%patch1 -p1

%build
cp include/ptbuildopts.h.in include/ptbuildopts.h.in.save
autoreconf --force --install
aclocal
cd plugins
autoreconf --force --install
aclocal
cd ..
%{?suse_update_config:%{suse_update_config -f}}
mv include/ptbuildopts.h.in.save include/ptbuildopts.h.in 
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fstack-protector"
export OBJ_SUFFIX=2
PWINSTDIR=/usr/share/pwlib X11LIBDIR=/usr/X11R6/%_lib ./configure \
	--prefix=/usr \
	--libdir=%{_libdir} \
 	--mandir=%{_mandir} \
	--enable-plugins\
	--enable-v4l\
	--enable-v4l2\
	--enable-avc\
	--enable-dc\
	--enable-vidfile\
	--enable-oss\
	--enable-alsa
#	--enable-sockagg\
#	--enable-exceptions
make %{?jobs:-j %jobs}

%install
export OBJ_SUFFIX=2
make install DESTDIR=$RPM_BUILD_ROOT

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

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

%files
%defattr(-,root,root)
%doc mpl-1.0.htm History.txt ChangeLog*
%dir %{_libdir}/%{_name}-%{version}
%dir %{_libdir}/%{_name}-%{version}/devices
%dir %{_libdir}/%{_name}-%{version}/devices/sound
%dir %{_libdir}/%{_name}-%{version}/devices/videoinput
%{_libdir}/libpt2*.2*
%{_libdir}/%{_name}-%{version}/devices/sound/alsa_pwplugin.so
%{_libdir}/%{_name}-%{version}/devices/sound/oss_pwplugin.so
%{_libdir}/%{_name}-%{version}/devices/videoinput/v4l_pwplugin.so

%files devel
%defattr(-,root,root)
%doc ReadMe.txt ReadMe_QOS.txt
%dir /usr/share/ptlib
/usr/share/ptlib/*
%attr (0644, root, root) /usr/include/ptbuildopts.h
%attr (0644, root, root) /usr/include/ptlib.h
%dir /usr/include/ptlib
%dir /usr/include/ptlib/unix
%dir /usr/include/ptlib/unix/ptlib
%attr (0644, root, root) /usr/include/ptlib/*.h
%attr (0644, root, root) /usr/include/ptlib/*.inl
%attr (0644, root, root) /usr/include/ptlib/unix/ptlib/*.h
%attr (0644, root, root) /usr/include/ptlib/unix/ptlib/*.inl
%dir /usr/include/ptclib
%attr (0644, root, root) /usr/include/ptclib/*.h
#%{_bindir}/asnparser
%{_bindir}/ptlib-config
%{_libdir}/libpt2.so
%{_libdir}/libpt2_s.a
%attr (0644, root, root) %{_libdir}/pkgconfig/ptlib.pc

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

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

%files plugins-v4l2
%defattr(-,root,root)
%dir %{_libdir}/%{_name}-%{version}/devices/videoinput
%{_libdir}/%{_name}-%{version}/devices/videoinput/v4l2_pwplugin.so

%changelog
* Thu Nov 06 2008 kkeil@suse.de
- do not create include/ptbuildopts.h.in from scratch
  This caused configuration errors in ekiga (bnc#440869)
* Sun Oct 26 2008 kkeil@suse.de
- update to bugfix release 2.4.2
  * Fix static linking for mingw
  * Move the defaults so we can overwrite them depending on the
  platform
  * Finally fix static and dynamic plugins on mingw
  * Fixed being able to pass a ip%%interface form of address string
  to a PIPSocket::Address and it still works correctly, using the
  ip part if there
  * Fixed correct upper/lower case comparisons as per RFC952
  * Make vfw configurable
  * STUN was not working with Open NAT
  * Fixed incorrect port displayed in trace log for STUN
  * Make sure CreateSocketPair also works with open nat
  * Allow video file output device to work with new files
  * Fixed problem with PSafeCollection destructor deleting objects
  even if they still have a PSafePtr referencing them
  * Fix compilation without vfw
* Mon Oct 20 2008 kkeil@suse.de
- remove windows build files to avoid license issues (bnc#436929)
* Mon Oct 13 2008 kkeil@suse.de
- add version 2.4.1 needed for ekiga 3.0 (bnc#428117)
  this is the successor of pwlib, but with new API version 2
  so it does not replace pwlib yet
openSUSE Build Service is sponsored by