File pantheon-files.spec of Package pantheon-files

#
# spec file for package pantheon-files
#
# 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/
#


%define sover 0
Name:           pantheon-files
Version:        0.3.5
Release:        0
Summary:        Simple file manager from Elementary
License:        GPL-3.0+
Group:          Productivity/File utilities
Url:            https://launchpad.net/pantheon-files
Source:         https://launchpad.net/pantheon-files/0.3.x/%{version}/+download/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM -- Fix vala compiler errors (#262)
Patch0:         pantheon-files-0.3.5-vala-0.4.patch
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  vala >= 0.28.0
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(dbusmenu-glib-0.4)
BuildRequires:  pkgconfig(gconf-2.0)
BuildRequires:  pkgconfig(gdk-3.0)
BuildRequires:  pkgconfig(gee-1.0)
BuildRequires:  pkgconfig(gio-2.0) >= 2.0
BuildRequires:  pkgconfig(glib-2.0) >= 2.32
BuildRequires:  pkgconfig(granite) >= 0.4
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.0.3
BuildRequires:  pkgconfig(libcanberra) >= 0.30
BuildRequires:  pkgconfig(libnotify) >= 0.7.2
BuildRequires:  pkgconfig(pango) >= 1.1.2
#BuildRequires:  pkgconfig(unity) >= 4.0.0 # TODO fix libgee conflicts
BuildRequires:  pkgconfig(plank)
BuildRequires:  pkgconfig(polkit-gobject-1)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(zeitgeist-2.0)
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%glib2_gsettings_schema_requires

%description
Pantheon Files is a modern file manager originally designed for the
Pantheon desktop environment, now used with Elementary OS.

%package -n     lib%{name}-core%{sover}
Summary:        The core library for %{name}
Group:          System/Libraries

%description -n lib%{name}-core%{sover}
Files is a simple file manager from Elementary.

This package contains the shared library used by plugins or for embedding
parts of %{name} into other applications.

%package -n     lib%{name}-widgets%{sover}
Summary:        The core library for %{name}
Group:          System/Libraries

%description -n lib%{name}-widgets%{sover}
Files is a simple file manager from Elementary.

This package contains a shared library containing some of the custom
widgets used by %{name}.

%package -n     lib%{name}-core-devel
Summary:        Core development files for the "Files" file manager
Group:          Development/Libraries/GNOME
Requires:       lib%{name}-core%{sover} = %{version}

%description -n lib%{name}-core-devel
Files is a simple file manager from Elementary.

This package contains the development files for %{name}.

%package -n     lib%{name}-widgets-devel
Summary:        Widget development files for the "Files" file manager
Group:          Development/Libraries/GNOME
Requires:       lib%{name}-widgets%{sover} = %{version}

%description -n lib%{name}-widgets-devel
Files is a simple file manager from Elementary.

This package contains the development files for %{name}.

%lang_package

%prep
%setup -q
%patch0 -p1

find -name \*.pc* -exec sed -i '/libdir/s/\(=\).*\//\1/' {} +

%build
%cmake \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" \
    -DCMAKE_SKIP_BUILD_RPATH=ON \
    -DGSETTINGS_COMPILE=OFF

make %{?_smp_mflags}

%install
%cmake_install

%suse_update_desktop_file org.pantheon.files
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}%{_datadir}

%post
%glib2_gsettings_schema_post
%desktop_database_post
%icon_theme_cache_post

%postun
%glib2_gsettings_schema_postun
%desktop_database_postun
%icon_theme_cache_postun

%post   -n lib%{name}-core%{sover} -p /sbin/ldconfig
%postun -n lib%{name}-core%{sover} -p /sbin/ldconfig
%post   -n lib%{name}-widgets%{sover} -p /sbin/ldconfig
%postun -n lib%{name}-widgets%{sover} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYING HACKING README
%{_bindir}/%{name}
%{_bindir}/%{name}-daemon
%{_bindir}/%{name}-pkexec
%{_libdir}/%{name}/
%{_libdir}/gtk-3.0/modules/libpantheon-filechooser-module.so
%{_datadir}/applications/org.pantheon.files.desktop
%{_datadir}/dbus-1/services/*%{name}*.service
%{_datadir}/glib-2.0/schemas/org.pantheon.files.gschema.xml
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}/
%{_datadir}/polkit-1/actions/net.launchpad.%{name}.policy
%{_datadir}/appdata/org.pantheon.files.appdata.xml
%dir %{_datadir}/appdata

%files -n lib%{name}-core%{sover}
%defattr(-,root,root)
%{_libdir}/lib%{name}-core.so.*

%files -n lib%{name}-widgets%{sover}
%defattr(-,root,root)
%{_libdir}/lib%{name}-widgets.so.*

%files -n lib%{name}-core-devel
%defattr(-,root,root)
%{_includedir}/%{name}-core/
%{_datadir}/vala/vapi/%{name}-core-C.vapi
%{_datadir}/vala/vapi/%{name}-core.deps
%{_datadir}/vala/vapi/%{name}-core.vapi
%{_libdir}/lib%{name}-core.so
%{_libdir}/pkgconfig/%{name}-core.pc

%files -n lib%{name}-widgets-devel
%defattr(-,root,root)
%{_includedir}/%{name}-widgets/
%{_datadir}/vala/vapi/pantheon-files-widgets.deps
%{_datadir}/vala/vapi/pantheon-files-widgets.vapi
%{_libdir}/lib%{name}-widgets.so
%{_libdir}/pkgconfig/%{name}-widgets.pc

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

%changelog
openSUSE Build Service is sponsored by