File webcam-tools.spec of Package webcam-tools

# spec file for webcam-tools 
# Copyright (c) spec 2012 Bjørn Lie, Bryne, Norway.
# 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

Name:           webcam-tools
%define _name libwebcam
Version:        0.2.2
Release:        1
License:        LGPL-3.0+ 
Summary:        V4L2 userspace webcam library / controller
Source:         %_name-src-%version.tar.gz
# PATCH-FIX-OPENSUSE libwebcam-silence-uvcdynctrl.patch  -- Turn of debug output, taken from fedora
Patch0:         libwebcam-silence-uvcdynctrl.patch
Group:          Hardware/Camera
BuildRequires:  kernel-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  gengetopt
BuildRequires:  libv4l2-0
BuildRoot:      %{_tmppath}/%{_name}-src-%{version}

libwebcam / uvcdynctrl - user space and udev support for UVC cameras

%package -n libwebcam0
Version:        0.2.2
Summary:        V4L2 / UVC userspace library
%description -n libwebcam0
Shared library to support configuration and control of cameras

%package -n libwebcam-devel
Version:        0.2.2
Requires:       libwebcam0 = %{version}
Group:          Development/Tools/Other
Summary:        V4L2 / UVC userspace development files
%description -n libwebcam-devel
V4L2 / UVC userspace webcam library development headers

%package -n uvcdynctrl
Version:        0.2.2
Summary:        Camera control utility
%description -n uvcdynctrl
For setup and manipulation of extended camera controls, with udev support

%setup -q -n %{_name}-src-%version
%patch0 -p1

%__mkdir build
pushd build

%ifarch x86_64


%__mkdir -p $RPM_BUILD_ROOT/usr/include
%__install -m 0644 common/include/webcam.h $RPM_BUILD_ROOT/usr/include/webcam.h
%__install -m 0644 common/include/dynctrl-logitech.h $RPM_BUILD_ROOT/usr/include/dynctrl-logitech.h
cd build
rm $RPM_BUILD_ROOT%{_libdir}/libwebcam.a

%post -n libwebcam0

%postun -n libwebcam0

%files -n libwebcam0
%defattr(0755, root, root)

%files -n libwebcam-devel
%defattr(0644, root, root)

%files -n uvcdynctrl
%defattr(0755, root, root)
%dir /lib/udev
%defattr(0644, root, root)
%dir /lib/udev/rules.d
%doc %{_mandir}/man1/uvc*.1%{?ext_man}