%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
%global pkgname Xfce-Theme-Manager

Name:		xfce-theme-manager
Version:	3.8
Release:	1
Summary:	A theme manager for Xfce
License:	GPLv3	
URL:		https://github.com/KeithDHedger/Xfce-Theme-Manager
Source0:        https://github.com/KeithDHedger/Xfce-Theme-Manager/archive/refs/tags/v%{version}.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  gcc-c++
BuildRequires:	autoconf
BuildRequires:	cairo-devel
BuildRequires:	desktop-file-utils
BuildRequires:	pkgconfig(gdk-2.0)
BuildRequires:	pkgconfig(glib-2.0)
BuildRequires:	pkgconfig(gtk+-2.0)
BuildRequires:	pkgconfig(libxfce4ui-2)

%description
A theme manager allowing easy configuration of themes,
window borders, controls, icons and cursors for Xfce

%prep
%autosetup -n %{pkgname}-%{version} -p1

%build
%configure
make %{?_smp_mflags} xfcethememanager_CFLAGS="%{optflags} -export-dynamic" xfcethememanager_CXXFLAGS="%{optflags} -export-dynamic -Wunused -Wunused-function -Wno-unused-result -fPIC"

%install
make install DESTDIR=%{buildroot} docfilesdir="%{_pkgdocdir}"
desktop-file-install	\
--delete-original	\
--dir=%{buildroot}%{_datadir}/applications	\
--remove-key=Categories	\
--add-category=GTK	\
--add-category=Settings	\
--add-category=DesktopSettings	\
--add-category=X-XFCE-SettingsDialog	\
--add-category=X-XFCE-PersonalSettings	\
--add-category=X-XFCE	\
--set-name="Xfce Theme Manager"	\
%{buildroot}/%{_datadir}/applications/%{pkgname}.desktop

%files
%doc  ChangeLog* Xfce-Theme-Manager/resources/docs/gpl-3.0.txt
%{_bindir}/%{name}
%{_datadir}/applications/%{pkgname}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/Xfce-Theme-Manager/scripts
%{_mandir}/man1/%{name}.1.*
%{_mandir}/*/man1/%{name}.1.*

%changelog
* Mon Jun 20 2022 lin.zhang <lin.zhang@turbolinux.com.cn> - 3.8-1
- update to 3.8

* Thu Aug 05 2021 lin.zhang <lin.zhang@turbolinux.com.cn> - 0.3.8-2
- Fix BuildRequires: pkgconfig(libxfce4ui-1)

* Mon Jul 27 2020 Dillon Chen <dillon.chen@turbolinux.com.cn> - 0.3.8-1
- Init package from fedora 33

