File thunar.spec of Package thunar

# spec file for package thunar
# Copyright (c) 2020 SUSE LLC
# 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

%define libname libthunarx-3-0
%bcond_with git
Name:           thunar
Version:        1.8.14
Release:        0
Summary:        File Manager for the Xfce Desktop Environment
License:        GPL-2.0-or-later
Group:          Productivity/File utilities
Source100:      %{name}-rpmlintrc
BuildRequires:  appstream-glib
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  perl-XML-Parser
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  xfconf
BuildRequires:  pkgconfig(exo-2) >= 0.12.0
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gio-unix-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0) >= 1.30.0
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.22.0
BuildRequires:  pkgconfig(gtk-doc)
BuildRequires:  pkgconfig(gudev-1.0)
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(libpcre)
BuildRequires:  pkgconfig(libstartup-notification-1.0)
BuildRequires:  pkgconfig(libxfce4kbd-private-3) >= 4.12.0
BuildRequires:  pkgconfig(libxfce4panel-2.0) >= 4.12.0
BuildRequires:  pkgconfig(libxfce4ui-2) >= 4.12.0
BuildRequires:  pkgconfig(libxfce4util-1.0) >= 4.12.0
BuildRequires:  pkgconfig(libxfconf-0) >= 4.12.0
BuildRequires:  pkgconfig(sm)
BuildRequires:  pkgconfig(x11)
%if %{with git}
BuildRequires:  xfce4-dev-tools
# uses exo-desktop-item-edit, exo-open
Requires:       exo-tools
Recommends:     %{name}-lang = %{version}
Recommends:     gvfs
Recommends:     thunar-volman
Recommends:     tumbler
Recommends:     catfish
Provides:       thunar-doc = %{version}
Obsoletes:      thunar-doc <= 1.2.3

Thunar is a file manager for the Xfce desktop environment. Its
functionality can be extended through plugins. Thunar can also be
extended by writing scripts to be placed in the context menu for
various file types.

%package -n %{libname}
Summary:        Thunar Extension Library
Group:          System/Libraries

%description  -n %{libname}
This package contains the Thunar extension library.

%package devel
Summary:        Development Files for Thunar
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}
Requires:       %{name} = %{version}
Provides:       thunar-devel-doc = %{version}
Obsoletes:      thunar-devel-doc < %{version}

%description devel
This package provides the development files needed for developing extensions for

%package -n typelib-1_0-Thunarx-3_0
Summary:        Thunar Extension Library -- Introspection bindings
Group:          System/Libraries

%description -n typelib-1_0-Thunarx-3_0
This package provides the GObject Introspection bindings for the Thunar extension library %{libname}.



%if %{with git}
%configure \
    --enable-maintainer-mode \
    --with-helper-path-prefix=%{_libexecdir} \
    --docdir=%{_datadir}/xfce4/thunar \
    --enable-dbus \
    --enable-exif \
    --enable-startup-notification \
    --enable-pcre \
    --enable-gtk-doc \
%configure \
    --with-helper-path-prefix=%{_libexecdir} \
    --docdir=%{_datadir}/xfce4/thunar \
    --enable-dbus \
    --enable-exif \
    --enable-startup-notification \
    --enable-pcre \
    --enable-gtk-doc \


rm -f %{buildroot}%{_libdir}/*.la \
    %{buildroot}%{_libdir}/thunarx-3/*.la \

# add a lowercase manpage symlink
( cd %{buildroot}%{_mandir}/man1/ && ln -sf Thunar.1* \
    $(printf "%%s\n" Thunar.1* | tr [:upper:] [:lower:]) )

# these files are placed under %%{_defaultdocdir}/%%{name} instead
rm -f %{buildroot}%{_datadir}/xfce4/thunar/README.*

# do not allow to Thunar to run as root via pkexec
rm -f %{buildroot}%{_datadir}/polkit-1/actions/org.xfce.thunar.policy

%suse_update_desktop_file -i thunar System Utility Core GTK FileManager
%suse_update_desktop_file -i thunar-bulk-rename System Utility Core GTK Filesystem
%suse_update_desktop_file thunar-settings

%find_lang thunar %{?no_lang_C}

%fdupes %{buildroot}%{_datadir}

appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%license COPYING
%dir %{_sysconfdir}/xdg/Thunar
%config %{_sysconfdir}/xdg/Thunar/uca.xml
%dir %{_libexecdir}/Thunar

%files -n %{libname}

%files -n typelib-1_0-Thunarx-3_0

%files devel
%doc %{_datadir}/gtk-doc/html/thunarx
%dir %{_includedir}/thunarx-3
%dir %{_includedir}/thunarx-3/thunarx

%files lang -f thunar.lang