Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package icons as subpackages #479

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 60 additions & 7 deletions rpm/patchmanager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Requires: grep
Requires: sed
Requires: sailfish-version >= 3.4.0
Requires: qml(Nemo.Configuration)
Requires: %{name}-icons
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Qml)
Expand All @@ -54,6 +55,22 @@ BuildRequires: qt5-qttools-linguist
BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(popt)

%package icons-silica
Summary: Icon files for %{name}
BuildArch: noarch
Requires: sailfish-version >= 4.6.0
Requires: %{name} >= %{version}
Provides: %{name}-icons
Conflicts: %{name}-icons-meegotouch
Obsoletes: %{name}-icons-meegotouch

%package icons-meegotouch
Summary: Icon files for %{name}
BuildArch: noarch
Requires: sailfish-version < 4.6.0
Requires: %{name} >= %{version}
Provides: %{name}-icons
Conflicts: %{name}-icons-silica

%package testcases
Summary: Provides test cases for Patchmanager
Expand All @@ -62,6 +79,20 @@ BuildArch: noarch
Requires: %{name}
Requires: libsailfishapp-launcher

%description icons-silica
Provides icons for Sailfish OS 4.6 and later
%if 0%{?_chum}
Title: Icons for Patchmanager
Type: addon
%endif

%description icons-meegotouch
Provides icons for Sailfish OS 4.5 and earlier
%if 0%{?_chum}
Title: Icons for Patchmanager
Type: addon
%endif

# This description section includes metadata for SailfishOS:Chum, see
# https://github.com/sailfishos-chum/main/blob/main/Metadata.md
# For the patchmanager-testcases, point directly to the GitHub bugtracker.
Expand Down Expand Up @@ -148,6 +179,27 @@ ln -s ../lipstick-patchmanager.service %{buildroot}/%{_userunitdir}/lipstick.ser

mkdir -p %{buildroot}%{_datadir}/%{name}/patches

# copy icons around.
# See https://github.com/sailfishos-patches/patchmanager/pull/472#issuecomment-2514204204
if [ -e %{buildroot}%{_datadir}/themes/sailfish-default/meegotouch/z1.0/icons ]; then
mkdir -p %{buildroot}%{_datadir}/themes/sailfish-default/silica
pushd %{buildroot}%{_datadir}/themes/sailfish-default/meegotouch
for d in z*; do
mkdir %{buildroot}%{_datadir}/themes/sailfish-default/silica/${d}
cp -r ${d}/icons %{buildroot}%{_datadir}/themes/sailfish-default/silica/${d}/icons
cp -r ${d}/icons %{buildroot}%{_datadir}/themes/sailfish-default/silica/${d}/icons-monochrome
done
popd
elif [ -e %{buildroot}%{_datadir}/themes/sailfish-default/silica/z1.0/icons ]; then
mkdir -p %{buildroot}%{_datadir}/themes/sailfish-default/meegotouch
pushd %{buildroot}%{_datadir}/themes/sailfish-default/silica
for d in z*; do
mkdir %{buildroot}%{_datadir}/themes/sailfish-default/meegotouch/${d}
cp -r ${d}/icons %{buildroot}%{_datadir}/themes/sailfish-default/meegotouch/${d}/icons
done
popd
fi
# end of icon shenanigans

%pre
export NO_PM_PRELOAD=1
Expand Down Expand Up @@ -288,15 +340,16 @@ exit 0
%{_datadir}/jolla-settings/pages/%{name}
%{_datadir}/jolla-settings/entries/%{name}.json
%{_datadir}/%{name}/icons/icon-m-patchmanager.png

# On SailfishOS < 4.6:
# /usr/share/themes/sailfish-default/meegotouch/zX.Y/icons/*.png
# On SailfishOS >= 4.6:
# /usr/share/themes/sailfish-default/silica/zX.Y/icons/*.png
# /usr/share/themes/sailfish-default/silica/zX.Y/icons-monochrome/*.png
%{_datadir}/themes/sailfish-default/*/z*/icons*/*.png
%{_datadir}/icons/hicolor/scalable/apps/*.svg

%files icons-silica
%{_datadir}/themes/sailfish-default/silica/z*/icons/*.png
%{_datadir}/themes/sailfish-default/silica/z*/icons-monochrome/*.png

%files icons-meegotouch
%{_datadir}/themes/sailfish-default/meegotouch/z*/icons/*.png


%changelog
* Thu Sep 9 1999 SailfishOS Patches <[email protected]> - 99.99.99
- See %{url}/releases