File guvcview.spec of Package guvcview
#
# spec file for package guvcview
#
# Copyright (c) 2012 Malcolm J Lewis <malcolmlewis@opensuse.org>
# Copyright (c) 2013 Marguerite Su <marguerite@opensuse.org>
#
# 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.links2linux.org/
#
%define sover 2_0-2
Name: guvcview
Version: 2.0.4
Release: 0
License: GPL-3.0
# Reference to GPL-2.0 in some files?
Summary: GTK+ UVC Viewer and Capturer
Url: http://guvcview.sourceforge.net/
Group: Productivity/Multimedia/Video/Players
Source0: http://sourceforge.net/projects/guvcview/files/source/guvcview-src-%{version}.tar.gz
Patch3: guvcview-2.0.4_ffmpeg-3.0.patch
BuildRequires: alsa-devel
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: gsl-devel
BuildRequires: gtk3-devel
BuildRequires: intltool
BuildRequires: libpng-devel
BuildRequires: libpulse-devel
BuildRequires: libudev-devel
BuildRequires: libusb-1_0-devel
BuildRequires: libv4l-devel
BuildRequires: pkg-config
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(sdl2)
BuildRequires: portaudio-devel
BuildRequires: update-desktop-files
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%package -n libgviewaudio-%{sover}
Summary: GTK+ UVC Viewer and Capturer
Group: System/Libraries
%description -n libgviewaudio-%{sover}
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%package -n libgviewencoder-%{sover}
Summary: GTK+ UVC Viewer and Capturer
Group: System/Libraries
%description -n libgviewencoder-%{sover}
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%package -n libgviewrender-%{sover}
Summary: GTK+ UVC Viewer and Capturer
Group: System/Libraries
%description -n libgviewrender-%{sover}
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%package -n libgviewv4l2core-%{sover}
Summary: GTK+ UVC Viewer and Capturer
Group: System/Libraries
%description -n libgviewv4l2core-%{sover}
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%package devel
Summary: GTK+ UVC Viewer and Capturer
Group: Development/Libraries/C and C++
Requires: libgviewaudio-%{sover} = %{version}-%{release}
Requires: libgviewencoder-%{sover} = %{version}-%{release}
Requires: libgviewrender-%{sover} = %{version}-%{release}
Requires: libgviewv4l2core-%{sover} = %{version}-%{release}
Requires: portaudio-devel
Requires: alsa-devel
Requires: glibc-devel
Requires: libpulse-devel
Requires: pkgconfig(libavcodec)
Requires: pkgconfig(libavutil)
Requires: gsl-devel
Requires: libSDL2-devel
Requires: libv4l-devel
Requires: libudev-devel
Requires: libusb-1_0-devel
Requires: libpng-devel
%description devel
A GTK interface for capturing and viewing video from devices
supported by the Linux UVC driver, although it should also work with
any v4l2 compatible device.
%lang_package
%prep
%setup -q -n %{name}-src-%{version}
%patch3 -p1
chmod -x ChangeLog
%build
%configure --disable-debian-menu \
--disable-desktop
make %{?_smp_mflags}
%install
%make_install
# Remove installed documentation
pushd %{buildroot}%{_datadir}/doc
rm -rf %{name}
popd
# Create desktop file as disabled during build
%suse_update_desktop_file -c %{name} "A video viewer and capturer for the linux uvc driver" %{name} %{name} %{name} AudioVideo AudioVideoEditing
pushd %{buildroot}%{_datadir}/pixmaps
cp %{name}/%{name}.png .
popd
%find_lang %{name} %{?no_lang_C}
%find_lang gview_v4l2core %{name}.lang %{?no_lang_C}
%fdupes %{buildroot}
rm -f %{buildroot}%{_libdir}/*.{la,a}
%if 0%{?suse_version} > 1130
%post
%desktop_database_post
%endif
%if 0%{?suse_version} > 1130
%postun
%desktop_database_postun
%endif
%post -n libgviewaudio-%{sover} -p /sbin/ldconfig
%postun -n libgviewaudio-%{sover} -p /sbin/ldconfig
%post -n libgviewencoder-%{sover} -p /sbin/ldconfig
%postun -n libgviewencoder-%{sover} -p /sbin/ldconfig
%post -n libgviewrender-%{sover} -p /sbin/ldconfig
%postun -n libgviewrender-%{sover} -p /sbin/ldconfig
%post -n libgviewv4l2core-%{sover} -p /sbin/ldconfig
%postun -n libgviewv4l2core-%{sover} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING README.md
%{_bindir}/%{name}
%dir %{_datadir}/pixmaps/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/pixmaps/%{name}/*.png
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/*.gz
%files -n libgviewaudio-%{sover}
%defattr(-,root,root)
%{_libdir}/libgviewaudio-*.so.*
%files -n libgviewencoder-%{sover}
%defattr(-,root,root)
%{_libdir}/libgviewencoder-*.so.*
%files -n libgviewrender-%{sover}
%defattr(-,root,root)
%{_libdir}/libgviewrender-*.so.*
%files -n libgviewv4l2core-%{sover}
%defattr(-,root,root)
%{_libdir}/libgviewv4l2core-*.so.*
%files devel
%defattr(-,root,root)
%dir %{_includedir}/guvcview-2
%dir %{_includedir}/guvcview-2/libgviewaudio
%dir %{_includedir}/guvcview-2/libgviewencoder
%dir %{_includedir}/guvcview-2/libgviewrender
%dir %{_includedir}/guvcview-2/libgviewv4l2core
%{_includedir}/guvcview-2/libgviewaudio/gviewaudio.h
%{_includedir}/guvcview-2/libgviewencoder/gviewencoder.h
%{_includedir}/guvcview-2/libgviewrender/gviewrender.h
%{_includedir}/guvcview-2/libgviewv4l2core/gview.h
%{_includedir}/guvcview-2/libgviewv4l2core/gviewv4l2core.h
%{_libdir}/libgviewaudio.so
%{_libdir}/libgviewencoder.so
%{_libdir}/libgviewrender.so
%{_libdir}/libgviewv4l2core.so
%{_libdir}/pkgconfig/libgviewaudio.pc
%{_libdir}/pkgconfig/libgviewencoder.pc
%{_libdir}/pkgconfig/libgviewrender.pc
%{_libdir}/pkgconfig/libgviewv4l2core.pc
%files lang -f %{name}.lang
%changelog