File snap-photobooth.spec of Package snap-photobooth

#
# spec file for package snap-photobooth
#
# Copyright (c) 2017 SUSE LINUX 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:           snap-photobooth
Version:        0.3.0.1
Release:        0
Summary:        A camera application
License:        GPL-3.0
Group:          Productivity/Multimedia/Other
Url:            https://launchpad.net/snap-elementary
Source:         https://launchpad.net/snap-elementary/0.3.x/%{version}/+download/%{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  elementary-icon-theme
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  vala >= 0.28.0
BuildRequires:  pkgconfig(clutter-gst-3.0)
BuildRequires:  pkgconfig(clutter-gtk-1.0)
BuildRequires:  pkgconfig(gdk-x11-3.0)
BuildRequires:  pkgconfig(gee-0.8)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-pbutils-1.0)
BuildRequires:  pkgconfig(gstreamer-video-1.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(gudev-1.0)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(zeitgeist-2.0)
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%glib2_gsettings_schema_requires

%description
Camera application designed for Elementary OS.

%lang_package

%prep
%setup -q

%build
%cmake \
    -DGSETTINGS_COMPILE=OFF

make %{?_smp_mflags}

%install
%cmake_install

# Workaround https://bugzilla.opensuse.org/show_bug.cgi?id=561846
pushd %{buildroot}
for _icon in $(find -name \*.desktop* | xargs sed -n '/Icon/s/^.*\=//p'); do
    _icon=${_icon##*/}
    if ! find -name "$_icon" | grep -q .; then
        _icon=$(find %{_datadir}/icons -name "${_icon%.*}.svg" | sort | head -n1)
        install -Dm0644 \
            "$_icon" ".%{_datadir}/icons/hicolor/scalable/apps/${_icon##*/}"
    else
        echo "Found: $_icon"
        exit 1
    fi
done
popd

%suse_update_desktop_file -r org.pantheon.snap GTK AudioVideo Recorder
%fdupes %{buildroot}%{_datadir}
%find_lang %{name}

%post
%icon_theme_cache_post
%desktop_database_post
%glib2_gsettings_schema_post

%postun
%icon_theme_cache_post
%desktop_database_postun
%glib2_gsettings_schema_postun

%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/%{name}
%{_datadir}/applications/org.pantheon.snap.desktop
%{_datadir}/icons/hicolor/*/apps/accessories-camera.??g
%{_datadir}/glib-2.0/schemas/org.pantheon.snap.gschema.xml
%{_datadir}/appdata/org.pantheon.snap.appdata.xml
%dir %{_datadir}/appdata

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by