File libunicap.spec of Package libunicap

#
# spec file for package libunicap
#
# Copyright (c) 2012 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 _use_internal_dependency_generator 0
%{expand:%%define prev__find_provides %{__find_provides}}
%define __find_provides sh %{SOURCE1} %{prev__find_provides}
%{expand:%%define prev__find_requires %{__find_requires}}
%define __find_requires sh %{SOURCE1} %{prev__find_requires}

Name:           libunicap
Version:        0.9.12
Release:        1
License:        GPL-2.0+
Summary:        Library to access different kinds of (video) capture devices
Url:            http://www.unicap-imaging.org/
Group:          Hardware/Camera
Source0:        %{name}-%{version}.tar.bz2
Source1:        libunicap-filter.sh
Source2:        baselibs.conf
# PATCH-FIX-OPENSUSE openSUSE puts the videodev headers somewhere different in 12.1
Patch1:         libunicap-0.9.12-find_videodev.patch
# PATCH-FIX-UPSTREAM uses the reserved keyword "private" https://bugs.launchpad.net/unicap/+bug/656229
Patch2:         libunicap_0912_fixPrivate.patch
# PATCH-FIX-UPSTREAM libunicap-udev.patch bnc726471 https://bugs.launchpad.net/unicap/+bug/959626 sbrabec@suse.cz -- port rules to the new udev
Patch3:         libunicap-udev.patch
BuildRequires:  alsa-lib-devel
BuildRequires:  gettext
BuildRequires:  gtk-doc >= 1.4
BuildRequires:  intltool
BuildRequires:  libogg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtheora-devel
BuildRequires:  libvorbis-devel
BuildRequires:  perl(XML::Parser)
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-libICE-devel
BuildRequires:  xorg-x11-libXext-devel
BuildRequires:  xorg-x11-libXv-devel
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(pango)
%if 0%{?suse_version} >= 1210
BuildRequires:  libv4l-devel >= 0.8.4
%else
BuildRequires:  kernel-devel
BuildRequires:  libv4l-devel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Unicap provides a uniform interface to video capture devices. It allows
applications to use any supported video capture device via a single API.
The included ucil library provides easy to use functions to render text
and graphic overlays onto video images.

%package -n libunicap2

Summary:        Library to access different kinds of (video) capture devices
Group:          Hardware/Camera
Provides:       unicap = %{version}
Obsoletes:      unicap < %{version}

%description -n libunicap2
Unicap provides a uniform interface to video capture devices. It allows
applications to use any supported video capture device via a single API.
The included ucil library provides easy to use functions to render text
and graphic overlays onto video images.

%package devel

Summary:        Development files for the unicap library
Group:          Development/Libraries/C and C++
Requires:       libunicap2 = %{version}
Requires:       pkgconfig

%description devel
This package includes header files and libraries necessary for
developing programs which use the unicap, unicapgtk, and ucil libraries. It
contains the API documentation of the library, too.

%prep
%setup -q -n %{name}-%{version}
%if 0%{?suse_version} >= 1210
%patch1
%endif
%patch2 -p 1
%patch3 -p 1

%build
%configure --disable-rpath --enable-gtk-doc --enable-libv4l

%install
%make_install

# Don't install any static .a and libtool .la files
rm -f %{buildroot}%{_libdir}/{,unicap2/cpi/}*.{a,la}

%find_lang unicap

%post   -n libunicap2 -p /sbin/ldconfig

%postun -n libunicap2 -p /sbin/ldconfig

%files -n libunicap2 -f unicap.lang
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING README
%{_libdir}/*.so.*
%{_libdir}/unicap2
%config %{_sysconfdir}/udev/rules.d/50-euvccam.rules

%files devel
%defattr(-,root,root)
%{_datadir}/gtk-doc/html/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/unicap

%changelog