%global xfceversion 4.14

Name:           xfce4-screenshooter
Version:        1.9.7
Release:        1
Summary:        Screenshot utility for the Xfce desktop
License:        GPLv2+
#Group:          Development/Libraries
URL:            http://goodies.xfce.org/projects/applications/%{name}
Source0:        http://archive.xfce.org/src/apps/%{name}/1.9/%{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#BuildArch:      noarch
BuildRequires:  gcc-c++
BuildRequires:  exo-devel
BuildRequires:  libxfce4ui-devel >= %{xfceversion}
BuildRequires:  xfce4-panel-devel >= %{xfceversion}
BuildRequires:  libsoup-devel >= 2.26.0
BuildRequires:  libXext-devel >= 1.0.0
BuildRequires:  libXfixes-devel >= 4.0.0
BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  intltool
BuildRequires:  libappstream-glib
Requires:       xfce4-panel >= %{xfceversion}

%description
The Xfce Screenshooter utility allows you to capture the entire screen, the 
active window or a selected region. You can set the delay that elapses before 
the screenshot is taken and the action that will be done with the screenshot: 
save it to a PNG file, copy it to the clipboard, or open it using another 
application.  A panel plugin is provided too.

%prep
%autosetup

# KDE and GNOME have their own screenshot utils
echo "NotShowIn=KDE;GNOME;" >> src/xfce4-screenshooter.desktop.in.in

%build
%configure --disable-static
%make_build

%install
%make_install

# remove la file
find %{buildroot} -name '*.la' -exec rm -f {} ';'

# make sure debuginfo is generated properly
chmod -c +x %{buildroot}%{_libdir}/xfce4/panel/plugins/*.so

%find_lang %{name}

desktop-file-install \
        --dir %{buildroot}%{_datadir}/applications \
        --delete-original \
        %{buildroot}%{_datadir}/applications/%{name}.desktop

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

%files -f %{name}.lang
%doc AUTHORS ChangeLog NEWS README TODO
%license COPYING
%{_bindir}/%{name}
%{_libdir}/xfce4/panel/plugins/*.so
%{_datadir}/xfce4/panel/plugins/*.desktop
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/applets-screenshooter.png
%{_datadir}/icons/hicolor/scalable/apps/applets-screenshooter.svg
%{_datadir}/metainfo/xfce4-screenshooter.appdata.xml
%{_mandir}/man1/*.1.*

%changelog
* Fri Jul 17 2020 Dillon Chen <dillon.chen@turbolinux.com.cn> - 1.9.1-1
- Init package
