Name:           breeze-icon-theme
Version:        5.97.0
Release:        1
Summary:        Breeze icon theme

License:        LGPLv3+
URL:            https://api.kde.org/frameworks-api/frameworks-apidocs/frameworks/breeze-icons/html/

Source0:        http://download.kde.org/stable/frameworks/5.97/breeze-icons-%{version}.tar.xz

BuildArch:      noarch

BuildRequires:  extra-cmake-modules kf5-rpm-macros qt5-qtbase-devel hardlink time

Requires:       hicolor-icon-theme

Provides:       breeze-icons = %{version}-%{release} kf5-breeze-icons = %{version}-%{release}

Obsoletes:      breeze-icon-theme < 5.17.0

%description
Breeze icon theme.

%package rcc
Summary:        breeze Qt resource files

Requires:       %{name} = %{version}-%{release}

%description rcc
breeze Qt resource files.

%prep
%autosetup -p1 -n breeze-icons-%{version}

sed -i -e "s|%{version}|5.59.0|g" CMakeLists.txt

%build
mkdir %{_target_platform}
cd %{_target_platform}
%{cmake_kf5} ..
cd -

%make_build -C %{_target_platform}


%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}

hardlink -c -v %{buildroot}%{_datadir}/icons/

touch %{buildroot}%{_kf5_datadir}/icons/breeze/icon-theme.cache
touch %{buildroot}%{_kf5_datadir}/icons/breeze-dark/icon-theme.cache

%check

%filetriggerin -- %{_datadir}/icons/breeze
touch %{_datadir}/icons/breeze &> /dev/null || :

%filetriggerin -- %{_datadir}/icons/breeze-dark
touch %{_datadir}/icons/breeze-dark &> /dev/null || :

%transfiletriggerin -- %{_datadir}/icons/breeze
gtk-update-icon-cache %{_datadir}/icons/breeze &>/dev/null || :

%transfiletriggerin -- %{_datadir}/icons/breeze-dark
gtk-update-icon-cache %{_datadir}/icons/breeze-dark &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/breeze &> /dev/null || :
touch --no-create %{_datadir}/icons/breeze-dark &> /dev/null || :
fi

%transfiletriggerpostun -- %{_datadir}/icons/breeze
gtk-update-icon-cache %{_datadir}/icons/breeze &>/dev/null || :

%transfiletriggerpostun -- %{_datadir}/icons/breeze-dark
gtk-update-icon-cache %{_datadir}/icons/breeze-dark &>/dev/null || :

%files
%license COPYING-ICONS
%doc README.md
%ghost %{_datadir}/icons/breeze/icon-theme.cache
%ghost %{_datadir}/icons/breeze-dark/icon-theme.cache
%{_datadir}/icons/breeze/
%{_datadir}/icons/breeze-dark/
%exclude %{_datadir}/icons/{breeze/breeze-icons.rcc,breeze-dark/breeze-icons-dark.rcc}

%files rcc
%{_datadir}/icons/{breeze/breeze-icons.rcc,breeze-dark/breeze-icons-dark.rcc}


%changelog
* Mon Oct 24 2022 misaka00251 <misaka00251@misakanet.cn> - 5.97.0-1
- Upgrade package to 5.97.0

* Sat Jul 25 2020 Senlin <xisenlin1@huawei.com> - 5.50.0-3
- modify the usage of hardlink: hardlink is provided by util-linux

* Thu Mar 5 2020 dingyiming <dingyiming3@huawei.com> - 5.50.0-2
- Package init
