From 0b878e7937432444a86485a8101bc6411b96157f Mon Sep 17 00:00:00 2001 From: olf Date: Thu, 13 Jun 2024 01:51:58 +0200 Subject: [PATCH] [rpm/meecast.spec] Fix writing dconf key, license etc. Addresses issue #50 --- rpm/meecast.spec | 76 ++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/rpm/meecast.spec b/rpm/meecast.spec index d0710a8d1..ff28c8d31 100644 --- a/rpm/meecast.spec +++ b/rpm/meecast.spec @@ -1,7 +1,3 @@ -# -# Do not Edit! Generated by: -# spectacle version 0.18 -# %{!?qtc_qmake:%define qtc_qmake %qmake} %{!?qtc_qmake5:%define qtc_qmake5 %qmake5} %{!?qtc_make:%define qtc_make make} @@ -12,7 +8,7 @@ Summary: Weather forecast application for SailfishOS Version: 1.1.39 Release: 1 Group: Utility -License: GPLv2.1 +License: LGPL-2.1-only URL: https://github.com/Meecast/meecast Source0: %{name}-%{version}.tar.bz2 #Temporary @@ -38,8 +34,8 @@ BuildRequires: libkeepalive-devel BuildRequires: mlite-qt5-devel BuildRequires: pkgconfig(Qt5Concurrent) #BuildRequires: libqt-devel -BuildRequires: qt5-qtpositioning-devel -BuildRequires: qml(Sailfish.Silica) +BuildRequires: qt5-qtpositioning-devel +BuildRequires: qml(Sailfish.Silica) #Requires: qt5-qtpositioning #Requires: sailfishsilica-qt5 #Requires: qt5-qtdeclarative-import-models2 @@ -54,10 +50,10 @@ Type: desktop-application Categories: - Science - News -DeveloperName: Uladzislau Vasilyeu and Omweather team +DeveloperName: Uladzislau Vasilyeu and OMWeather team Custom: - - Repo: https://github.com/meecast/meecast -Icon: https://github.com/Meecast/meecast/blob/master/meecast/core/data/desktop/Icon/128/meecast.png?raw=true + - Repo: %{url} +Icon: %{url}/raw/master/meecast/core/data/desktop/Icon/128/meecast.png %endif @@ -65,9 +61,10 @@ Icon: https://github.com/Meecast/meecast/blob/master/meecast/core/data/desktop/I Version: 1.10 Release: 1 Summary: Daemon for Weather forecast application MeeCast on SailfishOS -Group: Utility -License: GPLv2.1 -Requires: harbour-meecast +Group: Utility +License: LGPL-2.1-only +Requires: harbour-meecast +Requires: systemd BuildRequires: pkgconfig(contentaction5) %description daemon MeeCast daemon for multiplatform highly customizable open source weather forecast client based on OMWeather code @@ -75,20 +72,21 @@ MeeCast daemon for multiplatform highly customizable open source weather forecas %package lockscreen Version: 0.5 Summary: Lockscreen Widget for Weather forecast application MeeCast on SailfishOS -Group: Utility -License: GPLv2.1 +Group: Utility +License: LGPL-2.1-only Requires: harbour-meecast Requires: harbour-meecast-daemon => 0.3 Requires: patchmanager +Requires: systemd %description lockscreen MeeCast Lockscreen widget for multiplatform highly customizable open source weather forecast client based on OMWeather code %package event Version: 1.1 -Release: 2 +Release: 3 Summary: Event Widget for Weather forecast application MeeCast on SailfishOS -Group: Utility -License: GPLv2.1 +Group: Utility +License: LGPL-2.1-only Requires: harbour-meecast Requires: harbour-meecast-daemon => 0.9 # Detect missing Lipstick Weather Widget on SailfishOS > 4.6.0.0 @@ -98,6 +96,10 @@ Requires: harbour-meecast-daemon => 0.9 # Require Lipstick Weather Widget on SailfishOS > 4.6.0.0 %if 0%{?add_weather_widget} Require: lipstick-jolla-home-qt5-weather-widget-settings +# Require these to be able to set a dconf key of the primary user +Requires: coreutils +Requires: systemd +Requires: dconf %endif %description event MeeCast event widget for multiplatform highly customizable open source weather forecast client based on OMWeather code @@ -128,27 +130,28 @@ rm -rf %{buildroot} #make INSTALL_ROOT=%{buildroot} install #rm %{buildroot}/opt/com.meecast.omweather/lib/libomweather-core.a # << install post -desktop-file-install --delete-original \ - --dir %{buildroot}%{_datadir}/applications \ +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ %{buildroot}%{_datadir}/applications/*.desktop %pre lockscreen -if [ -f /usr/sbin/patchmanager ]; then - /usr/sbin/patchmanager -u sailfishos-lockscreen-meecast-patch || true +if [ -f %{_sbindir}/patchmanager ]; then + %{_sbindir}/patchmanager -u sailfishos-lockscreen-meecast-patch || true fi %pre daemon %preun daemon +# Removal if [ "$1" = "0" ]; then systemctl-user disable meecastd.service systemctl-user stop meecastd.service fi %preun lockscreen -if [ -f /usr/sbin/patchmanager ]; then - /usr/sbin/patchmanager -u sailfishos-lockscreen-meecast-patch || true +if [ -f %{_sbindir}/patchmanager ]; then + %{_sbindir}/patchmanager -u sailfishos-lockscreen-meecast-patch || true fi %postun daemon @@ -159,8 +162,10 @@ fi %postun event %if 0%{?add_weather_widget} -if [ "$1" = "0" ] # Removal -then dconf write /desktop/lipstick-jolla-home/force_weather_loading false || true +# Removal +if [ "$1" = "0" ] +# then su --login "$(loginctl --no-legend list-sessions | grep -F seat0 | tr -s ' ' | cut -f 4 -d ' ')" --command='dconf write /desktop/lipstick-jolla-home/force_weather_loading false' || true +then su --login "$(loginctl --no-legend list-sessions | grep -F seat0 | tr -s ' ' | cut -f 4 -d ' ')" --command='dconf reset /desktop/lipstick-jolla-home/force_weather_loading' || true fi %endif @@ -168,33 +173,34 @@ fi if ps -A | grep "meecastd" ; then killall meecastd ; fi systemctl-user enable meecastd.service systemctl-user start meecastd.service +exit 0 %post lockscreen if ps -A | grep "meecastd" ; then killall meecastd ; fi systemctl-user enable meecastd.service systemctl-user start meecastd.service +exit 0 %post event # Activate Lipstick Weather Widget on SFOS > 4.6.0.0 %if 0%{?add_weather_widget} -dconf write /desktop/lipstick-jolla-home/force_weather_loading true -exit 0 +su --login "$(loginctl --no-legend list-sessions | grep -F seat0 | tr -s ' ' | cut -f 4 -d ' ')" --command='dconf write /desktop/lipstick-jolla-home/force_weather_loading true' || true %endif %files %defattr(-,root,root,-) -/usr/share/applications/harbour-meecast.desktop -/usr/bin/harbour-meecast +%{_datadir}/applications/harbour-meecast.desktop +%{_bindir}/harbour-meecast /usr/share/harbour-meecast -#/usr/share/iconsets -/usr/share/icons/hicolor +#%{_datadir}/iconsets +%{_datadir}/icons/hicolor #/opt/com.meecast.omweather/share %files daemon %defattr(-,root,root,-) -/usr/bin/meecastd -/usr/bin/meecast_predaemon -/usr/lib/systemd/user/meecastd.service +%{_bindir}/meecastd +%{_bindir}/meecast_predaemon +%{_userunitdir}/meecastd.service %{_libdir}/qt5/qml/org/meecast/data %files lockscreen