Switch to webp format by default for Fedora backgrounds

epel9
Luya Tshimbalanga 2 years ago
parent 09f1d208f4
commit 646882f6ff

@ -2,11 +2,11 @@
%global waves_version 0.1.2 %global waves_version 0.1.2
%global fedora_release_name f37 %global fedora_release_name f37
%global gnome_default default %global gnome_default default
%global picture_ext png %global picture_ext webp
Name: desktop-backgrounds Name: desktop-backgrounds
Version: 37.0.0 Version: 37.0.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: Desktop backgrounds Summary: Desktop backgrounds
License: LGPLv2 License: LGPLv2
@ -16,7 +16,7 @@ Source3: README.Propaganda
Source5: waves-%{waves_version}.tar.bz2 Source5: waves-%{waves_version}.tar.bz2
Source6: FedoraWaves-metadata.desktop Source6: FedoraWaves-metadata.desktop
BuildArch: noarch BuildArch: noarch
%if "x%{?picture_ext}" != "xpng" %if "x%{?picture_ext}" != "xwebp"
BuildRequires: ImageMagick BuildRequires: ImageMagick
BuildRequires: %{fedora_release_name}-backgrounds-base BuildRequires: %{fedora_release_name}-backgrounds-base
%endif %endif
@ -127,14 +127,14 @@ ln -s ../../../../backgrounds/waves/waves-normal-3-night.png 1600x1200.png
ln -s ../../../../backgrounds/waves/waves-wide-3-night.png 1920x1200.png ln -s ../../../../backgrounds/waves/waves-wide-3-night.png 1920x1200.png
) )
# Defalts for various desktops: # Defaults for various desktops:
# for GNOME # for GNOME
mkdir -p %{buildroot}%{_datadir}/glib-2.0/schemas mkdir -p %{buildroot}%{_datadir}/glib-2.0/schemas
/bin/echo '[org.gnome.desktop.background]' > \ /bin/echo '[org.gnome.desktop.background]' > \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override
/bin/echo "picture-uri='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-day.png'" >> \ /bin/echo "picture-uri='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-day.webp'" >> \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override
/bin/echo "picture-uri-dark='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-02-night.png'" >> \ /bin/echo "picture-uri-dark='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-night.webp'" >> \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.background.fedora.gschema.override
# Use the Fedora background on the GNOME lockscreen as well. Would be awesome to # Use the Fedora background on the GNOME lockscreen as well. Would be awesome to
# have a separate image here to complement the default Fedora background, rather # have a separate image here to complement the default Fedora background, rather
@ -142,36 +142,36 @@ mkdir -p %{buildroot}%{_datadir}/glib-2.0/schemas
# desktop backgrounds with GNOME lockscreens, and they just do not match at all. # desktop backgrounds with GNOME lockscreens, and they just do not match at all.
/bin/echo '[org.gnome.desktop.screensaver]' > \ /bin/echo '[org.gnome.desktop.screensaver]' > \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override
/bin/echo "picture-uri='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-day.png'" >> \ /bin/echo "picture-uri='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-day.webp'" >> \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override
/bin/echo "picture-uri-dark='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-02-night.png'" >> \ /bin/echo "picture-uri-dark='file://%{_datadir}/backgrounds/%{fedora_release_name}/%{gnome_default}/%{fedora_release_name}-01-night.webp'" >> \
%{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/10_org.gnome.desktop.screensaver.fedora.gschema.override
# for KDE, this is handled in kde-settings # for KDE, this is handled in kde-settings
# for XFCE, LXDE, etc. # for XFCE, LXDE, etc.
%if "x%{?picture_ext}" == "xpng" %if "x%{?picture_ext}" == "xwebp"
(cd %{buildroot}%{_datadir}/backgrounds/images; (cd %{buildroot}%{_datadir}/backgrounds/images;
ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.png\ ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.webp\
default.png default.webp
ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.png \ ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.webp \
default-5_4.png default-5_4.webp
ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.png \ ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.webp \
default-16_9.png default-16_9.webp
ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.png \ ln -s ../%{fedora_release_name}/default/%{fedora_release_name}.webp \
default-16_10.png default-16_10.webp
cd .. cd ..
ln -s ./%{fedora_release_name}/default/%{fedora_release_name}.png \ ln -s ./%{fedora_release_name}/default/%{fedora_release_name}.webp \
default.png default.webp
) )
%else %else
(cd %{buildroot}%{_datadir}/backgrounds/images; (cd %{buildroot}%{_datadir}/backgrounds/images;
convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\ convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\
-alpha off default.png -alpha off default.webp
convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\ convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\
-alpha off default-5_4.png -alpha off default-5_4.webp
convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\ convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\
-alpha off default-16_9.png -alpha off default-16_9.webp
convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\ convert %{_datadir}/backgrounds/%{fedora_release_name}/default/%{fedora_release_name}.%{picture_ext}\
-alpha off default-16_10.png -alpha off default-16_10.webp
) )
%endif %endif
@ -212,11 +212,14 @@ mkdir -p %{buildroot}%{_datadir}/glib-2.0/schemas
%files compat %files compat
%dir %{_datadir}/backgrounds/images/ %dir %{_datadir}/backgrounds/images/
%{_datadir}/backgrounds/images/default* %{_datadir}/backgrounds/images/default*
%{_datadir}/backgrounds/default.png %{_datadir}/backgrounds/default.webp
%{_datadir}/backgrounds/default.xml %{_datadir}/backgrounds/default.xml
%changelog %changelog
* Thu Aug 11 222 Luya Tshimbalanga <luya@fedoraproject.org> - 37.0.0-1 * Sun Sep 25 2022 Luya Tshimbalanga <luya@fedoraproject.org> - 37.0.0-2
- Switch to webp format by default for Fedora backgrounds
* Thu Aug 11 2022 Luya Tshimbalanga <luya@fedoraproject.org> - 37.0.0-1
- Enable F37 theme - Enable F37 theme
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 36.0.0-3 * Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 36.0.0-3

Loading…
Cancel
Save