File pcmanfm-qt.spec of Package pcmanfm-qt

#
# spec file for package pcmanfm-qt
#
# 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 _qtver 5.10.0
Name:           pcmanfm-qt
Version:        @SERVICE@
Release:        0
Summary:        File manager and desktop icon manager
License:        GPL-2.0+
Group:          System/GUI/LXQt
Url:            http://www.lxqt.org
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake >= 3.0.2
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  lxqt-build-tools
BuildRequires:  pkgconfig
BuildRequires:  cmake(KF5WindowSystem)
BuildRequires:  pkgconfig(Qt5Core) >= %{_qtver}
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libfm-qt)
BuildRequires:  pkgconfig(libmenu-cache) >= 0.4.0
BuildRequires:  pkgconfig(lxqt)
Requires:       %{name}-branding = %{version}
Requires(post): desktop-file-utils
Requires(pre):  desktop-file-utils
Recommends:     %{name}-lang = %{version}-%{release}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
PCManFM-Qt is the Qt port of the LXDE file manager PCManFM

%lang_package

%prep
%setup -q

%package branding-upstream
Summary:        Upstream branding of %{name}
Group:          System/GUI/LXQt
Requires:       %{name} = %{version}
Supplements:    packageand(%{name}:branding-upstream)
Conflicts:      otherproviders(%{name}-branding)
Provides:       %{name}-branding = %{version}
BuildArch:      noarch

%description branding-upstream
This package provides the upstream look and feel for %{name}.

%build
%cmake
make %{?_smp_mflags}

%install
%cmake_install
%fdupes -s %{buildroot}%{_datadir}

install -Dm 0644 %{buildroot}%{_datadir}/%{name}/lxqt/settings.conf -t %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/
sed -i 's/^\(Archiver=\).*/\1lxqt-archiver/' \
    %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf
sed -i 's/^\(IconThemeName=\).*/\1breeze/' \
    %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf
sed -i '/^IconThemeName=/s/$/\nFallbackIconThemeName=oxygen/' \
    %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf
sed -i "s|^\(Wallpaper=\).*|\1%{_datadir}/wallpapers/openSUSEdefault/contents/images/1920x1080.jpg|" \
    %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf
if ! grep "DesktopShortcuts=" %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf ; then
    sed -i 's/\(\[Desktop\]\)/\1\nDesktopShortcuts=Home, Trash, Computer/' \
    %{buildroot}%{_sysconfdir}/xdg/%{name}/lxqt/settings.conf
fi

%find_lang %{name} --with-qt

%if 0%{?suse_version} < 1500
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%defattr(-,root,root)
%doc AUTHORS
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/lxqt/
%dir %{_sysconfdir}/xdg/autostart/
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%{_mandir}/man?/%{name}.?%{ext_man}
%{_sysconfdir}/xdg/autostart/lxqt-desktop.desktop
%{_datadir}/%{name}/lxqt/settings.conf

%files branding-upstream
%defattr(-,root,root,-)
%dir %{_sysconfdir}/xdg/%{name}/
%dir %{_sysconfdir}/xdg/%{name}/lxqt/
%config %{_sysconfdir}/xdg/%{name}/lxqt/settings.conf

%files lang -f %{name}.lang
%defattr(-,root,root)
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%if 0%{?sle_version}
%{_datadir}/%{name}/translations/%{name}_arn.qm
%{_datadir}/%{name}/translations/%{name}_ast.qm
%{_datadir}/%{name}/translations/%{name}_fil.qm
%endif

%changelog
openSUSE Build Service is sponsored by