File libv4l.spec of Package libv4l

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



Name:           libv4l
Summary:        Collection of video4linux support libraries
Version:        0.6.4
Release:        4
Group:          System/Libraries
License:        LGPLv2.0+
Url:            http://people.atrpms.net/~hdegoede/
Source0:        http://people.atrpms.net/~hdegoede/%{name}-%{version}.tar.gz
Source2:        baselibs.conf
Patch0:         libv4l-nonvoid_return.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  kernel-headers pkg-config

%define debug_package_requires libv4l1-0 = %{version}-%{release}
%define debug_package_requires libv4l2-0 = %{version}-%{release}
%define debug_package_requires libv4lconvert0 = %{version}-%{release}

%description
libv4l is a collection of libraries which adds a thin abstraction layer
on top of video4linux2 devices. The purpose of this (thin) layer is to
make it easy for application writers to support a wide variety of
devices without having to write separate code for different devices in
the same class. libv4l consists of 3 different libraries:
libv4lconvert, libv4l1 and libv4l2.

libv4lconvert offers functions to convert from any (known) pixelformat
to V4l2_PIX_FMT_BGR24 or V4l2_PIX_FMT_YUV420.

libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices,
independent of the drivers for those devices supporting v4l1
compatibility (which many v4l2 drivers do not).

libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for
the application transparent libv4lconvert conversion where necessary.

%package -n libv4l1-0
License:        LGPLv2.0+
Summary:        The libv4l1-0 shared lib
Group:          System/Libraries
Requires:       %{name}

%description -n libv4l1-0
This package contains shared lib for packages that
use libv4l1.so.0

%package -n libv4l2-0
License:        LGPLv2.0+
Summary:        The libv4l2-0 shared lib
Group:          System/Libraries
Requires:       %{name}

%description -n libv4l2-0
This package contains shared lib for packages that
use libv4l2.so.0

%package -n libv4lconvert0
License:        LGPLv2.0+
Summary:        The libv4lconvert0 shared lib
Group:          System/Libraries
Requires:       %{name}

%description -n libv4lconvert0
This package contains shared lib for packages that
use libv4lconvert.so.0

%package        devel
License:        LGPLv2.0+
Summary:        The libv4l devel headers
Group:          Development/Libraries/C and C++
Requires:       libv4l1-0 = %{version}
Requires:       libv4l2-0 = %{version}
Requires:       libv4lconvert0 = %{version}

%description    devel
The libv4l-devel package contains libraries and header files for
developing applications that use libv4l.

%prep
%setup -q
%patch0

%build
%{__make} CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}

%install
make PREFIX=%{_prefix} LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT install

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n libv4l1-0 -p /sbin/ldconfig

%postun -n libv4l1-0 -p /sbin/ldconfig

%post -n libv4l2-0 -p /sbin/ldconfig

%postun -n libv4l2-0 -p /sbin/ldconfig

%post -n libv4lconvert0 -p /sbin/ldconfig

%postun -n libv4lconvert0 -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING.LIB README TODO
%{_libdir}/%{name}

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

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

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

%files devel
%defattr(-,root,root,-)
%doc README.multi-threading
%{_includedir}/libv4l*.h
%{_libdir}/libv4l*.so
%{_libdir}/pkgconfig/*.pc

%changelog