%global md5() {$(echo -n %1 | md5sum | awk '{print$1}')}

Name:           deepin-wallpapers
Version:        1.7.8.1
Release:        1%{?dist}.02
Summary:        Deepin Wallpapers provides wallpapers of dde
License:        GPLv3
URL:            https://github.com/linuxdeepin/deepin-wallpapers
Source0:        %{name}_%{version}.orig.tar.xz
BuildArch:      noarch
BuildRequires:  dde-api

%description
%{summary}.

%prep
%setup -q -n %{name}-%{version}
sed -i 's|lib|libexec|' Makefile
sed -i 's|lib|libexec|' blur_image.sh

%build
%make_build

%install
install -d %{buildroot}%{_datadir}/wallpapers/deepin/
cp deepin/* %{buildroot}%{_datadir}/wallpapers/deepin/

install -d %{buildroot}%{_var}/cache/
cp -ar image-blur %{buildroot}%{_var}/cache/

install -d %{buildroot}%{_datadir}/backgrounds/
#ln -sv ../../wallpapers/deepin/Hummingbird_by_Shu_Le.jpg \
#  %{buildroot}%{_datadir}/backgrounds/deepin/desktop.jpg
#ln -sv %{md5 %{_datadir}/wallpapers/deepin/Hummingbird_by_Shu_Le.jpg}.jpg \
#  %{buildroot}%{_var}/cache/image-blur/%{md5 %{_datadir}/backgrounds/deepin/desktop.jpg}.jpg
ln -sv ../wallpapers/deepin/desktop.jpg %{buildroot}%{_datadir}/backgrounds/default_background.jpg
%files
%doc README.md
#%license LICENSE
%{_datadir}/backgrounds/
%{_datadir}/wallpapers/deepin/
%{_var}/cache/image-blur/

%changelog
* Tue Jun 14 2022 uoser <uoser@uniontech.com> - 1.7.8.1-1.02
- update: update to 1.7.8.1-1.02
