File pwlib.spec of Package pwlib

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

# norootforbuild


Name:           pwlib
Summary:        Portable Windows Library from Equivalence Pty. Ltd
Version:        1.11.0
Release:        8
%define package_version v1_11_0
License:        MPL ..
Group:          System/Libraries
AutoReqProv:    on
Url:            http://openh323.sourceforge.net
# https://sourceforge.net/projects/openh323
Source:         %{name}-%{package_version}-src-tar.bz2
Source2:        baselibs.conf
Patch0:         %{name}-v1_11_0-PVXMLSession.patch
Patch1:         %{name}-v1_11_0-make.patch
Patch2:         %{name}-v1_11_0-pstring-fix.patch
Patch3:         %{name}-v1_11_0-ldap.patch
Patch4:         %{name}-v1_11_0-openssl.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  bison flex gcc-c++
BuildRequires:  SDL-devel
BuildRequires:  esound-devel
BuildRequires:  libdv-devel
BuildRequires:  libexpat-devel
BuildRequires:  openldap2-devel
Provides:       %{name}-plugins-alsa %{name}-plugins-oss %{name}-plugins-v4l
Obsoletes:      %{name}-plugins-alsa %{name}-plugins-oss %{name}-plugins-v4l

%define debug_package_requires libpt1_11 = %{version}-%{release}

%description
PWLib 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 was supposed to have a Macintosh
port as well but this never happened.

It is used for the OpenH323 project, see www.openh323.org for details.

%package -n libpt1_11
License:        MPL ..
Summary:        The pwlib shared libs
Group:          System/Libraries
Requires:       %{name} = %{version}

%description -n libpt1_11
This package includes the PWLIB library.

%package devel
License:        MPL ..
Summary:        The pwlib package for developers (includes headers and scripts)
Group:          Development/Libraries/C and C++
Requires:       libpt1_11 = %{version}
Requires:       SDL-devel libexpat-devel openldap2-devel openssl-devel

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


%package plugins-v4l2
License:        MPL ..
Summary:        V4L2 support for pwlib
Group:          System/Libraries
Provides:       pwlib-video-plugin
#obsolete, replaced by this package but not the same thing.
Obsoletes:      %{name}-plugins-avc
Obsoletes:      %{name}-plugins-dc

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


%prep
%setup -q -n %{name}_%{package_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if 0%{?suse_version} > 1120
%patch4 -p1
%endif

%build
#autoreconf --force --install
autoconf --force
aclocal
cd plugins
autoconf --force
aclocal
cd ..
#automake --force-missing
%{?suse_update_config:%{suse_update_config -f}}
PWINSTDIR=%{_datadir}/%{name} X11LIBDIR=/usr/X11R6/%_lib ./configure \
	--prefix=/usr \
	--libdir=%{_libdir} \
	--mandir=%{_mandir} \
	--enable-plugins\
	--enable-v4l2\
	--disable-avc\
	--disable-dc\
	--enable-vidfile\
	--enable-alsa
#	--enable-sockagg\
#	--enable-exceptions

make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fstack-protector" %{?jobs:-j %jobs}

%install
make install DESTDIR=$RPM_BUILD_ROOT

%post -n libpt1_11 -p /sbin/ldconfig

%postun -n libpt1_11 -p /sbin/ldconfig

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc mpl-1.0.htm History.txt
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/devices
%dir %{_libdir}/%{name}/devices/sound
%dir %{_libdir}/%{name}/devices/videoinput
%{_libdir}/%{name}/devices/sound/alsa_pwplugin.so
%{_libdir}/%{name}/devices/sound/oss_pwplugin.so
%{_libdir}/%{name}/devices/videoinput/v4l_pwplugin.so

%files -n libpt1_11
%defattr(-,root,root)
%{_libdir}/libpt.so.*

%files devel
%defattr(-,root,root)
%doc ReadMe.txt ReadMe_QOS.txt
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%attr (0644, root, root) %{_includedir}/ptbuildopts.h
%attr (0644, root, root) %{_includedir}/ptlib.h
%dir %{_includedir}/ptlib
%dir %{_includedir}/ptlib/unix
%dir %{_includedir}/ptlib/unix/ptlib
%attr (0644, root, root) %{_includedir}/ptlib/*.h
%attr (0644, root, root) %{_includedir}/ptlib/*.inl
%attr (0644, root, root) %{_includedir}/ptlib/unix/ptlib/*.h
%attr (0644, root, root) %{_includedir}/ptlib/unix/ptlib/*.inl
%dir %{_includedir}/ptclib
%attr (0644, root, root) %{_includedir}/ptclib/*.h
#%{_bindir}/asnparser
%{_bindir}/ptlib-config
%{_libdir}/libpt.so

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

%changelog