diff --git a/appstore-frontend.spec b/appstore-frontend.spec index 4f236b4dfa73fb547d77c083b37d160ab056dd6c..08d54f807f51a96334202486aa702216acfe92db 100644 --- a/appstore-frontend.spec +++ b/appstore-frontend.spec @@ -2,7 +2,7 @@ Name: appstore-frontend Version: 0.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: PyQt6 frontend for the OpenCloudOS application store License: GPL-2.0-or-later @@ -10,6 +10,8 @@ URL: https://gitee.com/OpenCloudOS/appstore Source0: %{name}-%{version}.tar.gz Source1: softcenter.desktop Source2: appstore-frontend +Source3: softcenter-opencloudos.svg +Source4: softcenter-tencentos.svg ExclusiveArch: x86_64 aarch64 @@ -25,6 +27,7 @@ Requires: python3-websocket-client Requires: flatpak Requires: appstore-backend Requires: PackageKit +Requires: hicolor-icon-theme %description appstore-frontend is the PyQt6 graphical frontend for the OpenCloudOS @@ -47,19 +50,54 @@ install -Dpm 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name} install -Dpm 0644 %{SOURCE1} \ %{buildroot}%{_datadir}/applications/softcenter.desktop +# Ship both distribution branding icons. A single build serves both +# OpenCloudOS and TencentOS 4, so the matching one is linked to the fixed +# softcenter.svg name at install time in %post. +install -Dpm 0644 %{SOURCE3} \ + %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/softcenter-opencloudos.svg +install -Dpm 0644 %{SOURCE4} \ + %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/softcenter-tencentos.svg + %check desktop-file-validate %{SOURCE1} export PYTHONPATH="$PWD" export QT_QPA_PLATFORM=offscreen %{python3} -m pytest -q +%post +# Select the distribution branding icon from the installed system identity. +. /etc/os-release 2>/dev/null || true +case "${ID:-}" in + tencentos*) icon=softcenter-tencentos.svg ;; + *) icon=softcenter-opencloudos.svg ;; +esac +ln -sf "$icon" %{_datadir}/icons/hicolor/scalable/apps/softcenter.svg + +# The symlink above is not shipped in the package, so the hicolor file trigger +# does not cover it; refresh the cache explicitly. +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache -f %{_datadir}/icons/hicolor 2>/dev/null || : +fi + +%postun +# Drop the symlink generated in %post when the package is erased for good. +if [ $1 -eq 0 ]; then + rm -f %{_datadir}/icons/hicolor/scalable/apps/softcenter.svg +fi + %files %doc README.md Changlog.txt PARITY.md docs/ %{_bindir}/%{name} %{_datadir}/%{name}/ %{_datadir}/applications/softcenter.desktop +%{_datadir}/icons/hicolor/scalable/apps/softcenter-opencloudos.svg +%{_datadir}/icons/hicolor/scalable/apps/softcenter-tencentos.svg %changelog +* Tue Sep 22 2026 hobili - 0.1.1-3 +- [Type] sync +- [DESC] Add distribution-branded desktop icon and set Icon in the desktop entry + * Wed Jul 15 2026 Xinlong Chen - 0.1.1-2 - [Type] sync - [DESC] only support x86_64 and aarch64 diff --git a/softcenter-opencloudos.svg b/softcenter-opencloudos.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d92a0c7810f5dde8b537ce5a7e076ba64df7562 --- /dev/null +++ b/softcenter-opencloudos.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/softcenter-tencentos.svg b/softcenter-tencentos.svg new file mode 100644 index 0000000000000000000000000000000000000000..34f7113a439d3c95987558e5bebe21aebbf34695 --- /dev/null +++ b/softcenter-tencentos.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/softcenter.desktop b/softcenter.desktop index 0a41be3b84884cba40c03f59b179faf87d4f1a73..d7487128b3cb66a71ef3e20b9470e8bd7434da92 100644 --- a/softcenter.desktop +++ b/softcenter.desktop @@ -4,6 +4,7 @@ Name=Software Store Name[zh_CN]=软件商店 Comment=Browse, install, and update applications Comment[zh_CN]=浏览、安装和更新应用 +Icon=softcenter Exec=appstore-frontend TryExec=appstore-frontend Terminal=false