From 78de7a4521338bb41789e27451d62e5e999e2b4f Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 20 Nov 2018 17:30:49 +0100 Subject: [PATCH 01/64] New upstream release (0.99.9) - Drop unneccessary patch to fix udev events access - Fix daemon lockdown issues (keyboard backlight, AC status changes) - Out-of-tree build fixes and documentation fixes --- .gitignore | 1 + ...wer-not-having-access-to-udev-events.patch | 32 ------------------- sources | 2 +- upower.spec | 15 ++++++--- 4 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 0001-daemon-Fix-upower-not-having-access-to-udev-events.patch diff --git a/.gitignore b/.gitignore index f8ff88c..6be58d6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.6.tar.xz /upower-0.99.7.tar.xz /upower-0.99.8.tar.xz +/upower-0.99.9.tar.xz diff --git a/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch b/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch deleted file mode 100644 index 31aea08..0000000 --- a/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch +++ /dev/null @@ -1,32 +0,0 @@ -From fe356951a9d45fee73036aaa72661f0319dffba3 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 21 Aug 2018 13:30:44 +0200 -Subject: [PATCH] daemon: Fix upower not having access to udev events - -PrivateNetwork=true will cut off upower from the udev netlink socket, so -it's not what we want to use, as we want those events. - -See https://lists.freedesktop.org/archives/systemd-devel/2018-July/041000.html - -Closes: #68 ---- - src/upower.service.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/upower.service.in b/src/upower.service.in -index 835529a..8838655 100644 ---- a/src/upower.service.in -+++ b/src/upower.service.in -@@ -17,7 +17,8 @@ ProtectHome=true - PrivateTmp=true - - # Network --PrivateNetwork=true -+# PrivateNetwork=true would block udev's netlink socket -+RestrictAddressFamilies=AF_UNIX AF_NETLINK - - # Execute Mappings - MemoryDenyWriteExecute=true --- -2.19.0 - diff --git a/sources b/sources index 275704c..6cd3b01 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.8.tar.xz) = dfd2960cae382195dfc7a703a02af298d9de55bc626cde2a1f97e7983842191ba9d99eb2044190214e792539e7d6c9d8e00b5aed17e5e86b04544e9ab90278b1 +SHA512 (upower-0.99.9.tar.xz) = 45eb587b0e5ffcce88bad8c56bc5efa30559748913016a55d58313280f5159378e5fbb4a9842c3a6409257bb97822d235f96b03704268b8471455c93eb05fe2f diff --git a/upower.spec b/upower.spec index 965e17e..f5f7223 100644 --- a/upower.spec +++ b/upower.spec @@ -1,13 +1,12 @@ +%global commit 2282c7c0e53fb31816b824c9d1f547e8 Summary: Power Management Service Name: upower -Version: 0.99.8 -Release: 3%{?dist} +Version: 0.99.9 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://upower.freedesktop.org/ -Source0: https://gitlab.freedesktop.org/upower/upower/uploads/9125ab7ee96fdc4ecc68cfefb50c1cab/%{name}-%{version}.tar.xz -# Backported from upstream -Patch0: 0001-daemon-Fix-upower-not-having-access-to-udev-events.patch +Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz BuildRequires: sqlite-devel BuildRequires: libtool @@ -109,6 +108,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Nov 20 2018 Christian Kellner - 0.99.9-1 +- New upstream release +- Drop unneccessary patch to fix udev events access +- Fix daemon lockdown issues (keyboard backlight, AC status changes) +- Out-of-tree build fixes and documentation fixes + * Sun Oct 07 2018 Kalev Lember - 0.99.8-3 - Backport an upstream fix for upower not having access to udev events From 98fd83d55e42303f88b13e0a21b2a593a9e99d39 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 20 Nov 2018 17:30:49 +0100 Subject: [PATCH 02/64] New upstream release (0.99.9) - Drop unneccessary patch to fix udev events access - Fix daemon lockdown issues (keyboard backlight, AC status changes) - Out-of-tree build fixes and documentation fixes --- .gitignore | 1 + ...wer-not-having-access-to-udev-events.patch | 32 ------------------- sources | 2 +- upower.spec | 15 ++++++--- 4 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 0001-daemon-Fix-upower-not-having-access-to-udev-events.patch diff --git a/.gitignore b/.gitignore index f8ff88c..6be58d6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.6.tar.xz /upower-0.99.7.tar.xz /upower-0.99.8.tar.xz +/upower-0.99.9.tar.xz diff --git a/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch b/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch deleted file mode 100644 index 31aea08..0000000 --- a/0001-daemon-Fix-upower-not-having-access-to-udev-events.patch +++ /dev/null @@ -1,32 +0,0 @@ -From fe356951a9d45fee73036aaa72661f0319dffba3 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 21 Aug 2018 13:30:44 +0200 -Subject: [PATCH] daemon: Fix upower not having access to udev events - -PrivateNetwork=true will cut off upower from the udev netlink socket, so -it's not what we want to use, as we want those events. - -See https://lists.freedesktop.org/archives/systemd-devel/2018-July/041000.html - -Closes: #68 ---- - src/upower.service.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/upower.service.in b/src/upower.service.in -index 835529a..8838655 100644 ---- a/src/upower.service.in -+++ b/src/upower.service.in -@@ -17,7 +17,8 @@ ProtectHome=true - PrivateTmp=true - - # Network --PrivateNetwork=true -+# PrivateNetwork=true would block udev's netlink socket -+RestrictAddressFamilies=AF_UNIX AF_NETLINK - - # Execute Mappings - MemoryDenyWriteExecute=true --- -2.19.0 - diff --git a/sources b/sources index 275704c..6cd3b01 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.8.tar.xz) = dfd2960cae382195dfc7a703a02af298d9de55bc626cde2a1f97e7983842191ba9d99eb2044190214e792539e7d6c9d8e00b5aed17e5e86b04544e9ab90278b1 +SHA512 (upower-0.99.9.tar.xz) = 45eb587b0e5ffcce88bad8c56bc5efa30559748913016a55d58313280f5159378e5fbb4a9842c3a6409257bb97822d235f96b03704268b8471455c93eb05fe2f diff --git a/upower.spec b/upower.spec index 965e17e..f5f7223 100644 --- a/upower.spec +++ b/upower.spec @@ -1,13 +1,12 @@ +%global commit 2282c7c0e53fb31816b824c9d1f547e8 Summary: Power Management Service Name: upower -Version: 0.99.8 -Release: 3%{?dist} +Version: 0.99.9 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://upower.freedesktop.org/ -Source0: https://gitlab.freedesktop.org/upower/upower/uploads/9125ab7ee96fdc4ecc68cfefb50c1cab/%{name}-%{version}.tar.xz -# Backported from upstream -Patch0: 0001-daemon-Fix-upower-not-having-access-to-udev-events.patch +Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz BuildRequires: sqlite-devel BuildRequires: libtool @@ -109,6 +108,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Nov 20 2018 Christian Kellner - 0.99.9-1 +- New upstream release +- Drop unneccessary patch to fix udev events access +- Fix daemon lockdown issues (keyboard backlight, AC status changes) +- Out-of-tree build fixes and documentation fixes + * Sun Oct 07 2018 Kalev Lember - 0.99.8-3 - Backport an upstream fix for upower not having access to udev events From f9f9f1cb9ba9fa974f370867f243c722c9ec8bbf Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:29 +0100 Subject: [PATCH 03/64] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- upower.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/upower.spec b/upower.spec index f5f7223..d568b55 100644 --- a/upower.spec +++ b/upower.spec @@ -4,7 +4,6 @@ Name: upower Version: 0.99.9 Release: 1%{?dist} License: GPLv2+ -Group: System Environment/Libraries URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -35,7 +34,6 @@ line tools for managing power devices attached to the system. %package devel Summary: Headers and libraries for UPower -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel From 40090bb74592030ffefd2696df29ef87067383b4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 10:54:03 +0000 Subject: [PATCH 04/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index d568b55..e4fc896 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.9 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -106,6 +106,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 0.99.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Nov 20 2018 Christian Kellner - 0.99.9-1 - New upstream release - Drop unneccessary patch to fix udev events access From 6b4b36ec188a5b2d2ef8228fab8ff4237b175861 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 20 Feb 2019 15:38:50 +0100 Subject: [PATCH 05/64] New upstream release (0.99.10) - Set 'pending-charge' for DisplayDevice if at least one battery is in the 'pending-charge' state - Map pending-charge to fully-charged when charge is 100% --- .gitignore | 1 + sources | 2 +- upower.spec | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6be58d6..b66659e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.7.tar.xz /upower-0.99.8.tar.xz /upower-0.99.9.tar.xz +/upower-0.99.10.tar.xz diff --git a/sources b/sources index 6cd3b01..e357a5c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.9.tar.xz) = 45eb587b0e5ffcce88bad8c56bc5efa30559748913016a55d58313280f5159378e5fbb4a9842c3a6409257bb97822d235f96b03704268b8471455c93eb05fe2f +SHA512 (upower-0.99.10.tar.xz) = aefe1b2ff5a390f1ea9676fe7e753750bebc56034365a9183e946a8463904047da0a4ac71340eb2efedc16bce6f6d9ef4609ddca37dc1fc31b56bcdbfbbfa59d diff --git a/upower.spec b/upower.spec index e4fc896..f8cb3d8 100644 --- a/upower.spec +++ b/upower.spec @@ -1,8 +1,8 @@ -%global commit 2282c7c0e53fb31816b824c9d1f547e8 +%global commit c438511024b9bc5a904f8775cfc8e4c4 Summary: Power Management Service Name: upower -Version: 0.99.9 -Release: 2%{?dist} +Version: 0.99.10 +Release: 1%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -106,6 +106,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Feb 20 2019 Christian Kellner - 0.99.10-1 +- New upstream release with the following changes: +- Set 'pending-charge' for DisplayDevice if at least one battery is in + the 'pending-charge' state +- Map pending-charge to fully-charged when charge is 100% + * Sun Feb 03 2019 Fedora Release Engineering - 0.99.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From cb64a0b9960115b8e595949b99114bf0672726ca Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 20 Feb 2019 15:38:50 +0100 Subject: [PATCH 06/64] New upstream release (0.99.10) - Set 'pending-charge' for DisplayDevice if at least one battery is in the 'pending-charge' state - Map pending-charge to fully-charged when charge is 100% --- .gitignore | 1 + sources | 2 +- upower.spec | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6be58d6..b66659e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.7.tar.xz /upower-0.99.8.tar.xz /upower-0.99.9.tar.xz +/upower-0.99.10.tar.xz diff --git a/sources b/sources index 6cd3b01..e357a5c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.9.tar.xz) = 45eb587b0e5ffcce88bad8c56bc5efa30559748913016a55d58313280f5159378e5fbb4a9842c3a6409257bb97822d235f96b03704268b8471455c93eb05fe2f +SHA512 (upower-0.99.10.tar.xz) = aefe1b2ff5a390f1ea9676fe7e753750bebc56034365a9183e946a8463904047da0a4ac71340eb2efedc16bce6f6d9ef4609ddca37dc1fc31b56bcdbfbbfa59d diff --git a/upower.spec b/upower.spec index f5f7223..2e8bc28 100644 --- a/upower.spec +++ b/upower.spec @@ -1,7 +1,7 @@ -%global commit 2282c7c0e53fb31816b824c9d1f547e8 +%global commit c438511024b9bc5a904f8775cfc8e4c4 Summary: Power Management Service Name: upower -Version: 0.99.9 +Version: 0.99.10 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries @@ -108,6 +108,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Feb 20 2019 Christian Kellner - 0.99.10-1 +- New upstream release with the following changes: +- Set 'pending-charge' for DisplayDevice if at least one battery is in + the 'pending-charge' state +- Map pending-charge to fully-charged when charge is 100% + * Tue Nov 20 2018 Christian Kellner - 0.99.9-1 - New upstream release - Drop unneccessary patch to fix udev events access From 31cd624cd64594d91f8295e64889c6fb11697573 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 17 Jun 2019 14:40:20 +0200 Subject: [PATCH 07/64] CI: execute integration test suite Test the installed package by executing the integration test suite. --- .gitignore | 4 ++++ tests/run-it.sh | 18 ++++++++++++++++++ tests/tests.yml | 23 +++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100755 tests/run-it.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index b66659e..e9a3704 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +#testing +tests/artifacts/ +tests/source/ + upower-0.9.5.tar.bz2 /upower-0.9.6.tar.bz2 /upower-0.9.7.tar.bz2 diff --git a/tests/run-it.sh b/tests/run-it.sh new file mode 100755 index 0000000..5db3a05 --- /dev/null +++ b/tests/run-it.sh @@ -0,0 +1,18 @@ +#!/usr/bin/bash +set -u + +# main script +IT="${1:-source/src/linux/integration-test}" + +# check if we need to install additional packages +# which is the case if we are on RHEL 8 +source /etc/os-release || exit 1 + +if [[ "$ID" = *"rhel"* ]] && [[ "$VERSION_ID" == *"8"* ]]; then + dnf config-manager -y --add-repo umockdev.repo + dnf install -y umockdev-devel python3-gobject-base + pip3 install python-dbusmock +fi + +# execute the integration test via umockdev-wrapper +exec umockdev-wrapper "$IT" diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..627611a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,23 @@ +--- +- hosts: localhost + roles: + - role: standard-test-source + tags: + - always + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - upower + - pygobject3-devel + - python3-dbus + - python3-dbusmock + - umockdev-devel + tests: + - smoke: + dir: smoke + run: upower -d + - integration: + dir: . + run: ./run-it.sh source/src/linux/integration-test From 7481cb0a9d12b2f0ed8c459e307f76131bb90951 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 02:35:34 +0000 Subject: [PATCH 08/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index f8cb3d8..26028c1 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.10 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -106,6 +106,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 0.99.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Wed Feb 20 2019 Christian Kellner - 0.99.10-1 - New upstream release with the following changes: - Set 'pending-charge' for DisplayDevice if at least one battery is in From 8a7fe7d60ef7f8700bf8cbd6da2d324ff067fdd5 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 3 Sep 2019 22:48:08 +0200 Subject: [PATCH 09/64] New upstream release (0.99.11) Following changes to the package: - Intltool has been replaced by gettext - D-Bus configuration moved from sysconfdir to datadir - systemd is creating /var/lib/upower, so 'ghost' the dir --- .gitignore | 1 + sources | 2 +- upower.spec | 17 +++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e9a3704..cc5db30 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.8.tar.xz /upower-0.99.9.tar.xz /upower-0.99.10.tar.xz +/upower-0.99.11.tar.xz diff --git a/sources b/sources index e357a5c..e475161 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.10.tar.xz) = aefe1b2ff5a390f1ea9676fe7e753750bebc56034365a9183e946a8463904047da0a4ac71340eb2efedc16bce6f6d9ef4609ddca37dc1fc31b56bcdbfbbfa59d +SHA512 (upower-0.99.11.tar.xz) = 67219a0beb98c97ac4512e4fe8ba83fc80a1035d1edb5367dda6911da50c672b047051f2f528e8703be29ab47547d92b6c71a7ef695226a1bdb5bc33e6d18803 diff --git a/upower.spec b/upower.spec index 26028c1..197faeb 100644 --- a/upower.spec +++ b/upower.spec @@ -1,15 +1,14 @@ -%global commit c438511024b9bc5a904f8775cfc8e4c4 +%global commit 93cfe7c8d66ed486001c4f3f55399b7a Summary: Power Management Service Name: upower -Version: 0.99.10 -Release: 2%{?dist} +Version: 0.99.11 +Release: 1%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz BuildRequires: sqlite-devel BuildRequires: libtool -BuildRequires: intltool BuildRequires: gettext BuildRequires: libgudev1-devel %ifnarch s390 s390x @@ -75,11 +74,11 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %license COPYING %doc NEWS AUTHORS HACKING README %{_libdir}/libupower-glib.so.* -%{_sysconfdir}/dbus-1/system.d/*.conf +%{_datadir}/dbus-1/system.d/*.conf %ifnarch s390 s390x /usr/lib/udev/rules.d/*.rules %endif -%dir %{_localstatedir}/lib/upower +%ghost %dir %{_localstatedir}/lib/upower %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf %{_bindir}/* @@ -106,6 +105,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Sep 3 2019 Christian Kellner - 0.99.11-1 +- New upstream release 0.99.11 +- Intltool has been replaced by gettext +- D-Bus configuration moved from sysconfdir to datadir +- Systemd is creating /var/lib/upower, so 'ghost' the dir + * Sat Jul 27 2019 Fedora Release Engineering - 0.99.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 9d5dd938ee236d7670882032bb879fa6c594b60a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 4 Sep 2019 14:49:06 +0200 Subject: [PATCH 10/64] Add systemd snippets and use macros for paths Add the required systemd snippets[1] and use macros for the udev rules and unit directories. Also mark "%{_datadir}/gtk-doc" as directory as to avoid warnings about duplicated entries, e.g: "warning: File listed twice: /usr/share/gtk-doc/html/UPower" [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#Systemd --- upower.spec | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/upower.spec b/upower.spec index 197faeb..1ddfebe 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -69,6 +69,15 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %ldconfig_scriptlets +%post +%systemd_post upower.service + +%preun +%systemd_preun upower.service + +%postun +%systemd_postun_with_restart upower.service + %files -f upower.lang %{!?_licensedir:%global license %%doc} %license COPYING @@ -76,7 +85,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_libdir}/libupower-glib.so.* %{_datadir}/dbus-1/system.d/*.conf %ifnarch s390 s390x -/usr/lib/udev/rules.d/*.rules +%{_udevrulesdir}/*.rules %endif %ghost %dir %{_localstatedir}/lib/upower %dir %{_sysconfdir}/UPower @@ -88,7 +97,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_mandir}/man7/* %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service -/usr/lib/systemd/system/*.service +%{_unitdir}/*.service %files devel %{_datadir}/dbus-1/interfaces/*.xml @@ -100,11 +109,16 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_includedir}/libupower-glib/upower.h %files devel-docs -%{_datadir}/gtk-doc +%dir %{_datadir}/gtk-doc %dir %{_datadir}/gtk-doc/html/UPower %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Sep 4 2019 Christian Kellner - 0.99.11-2 +- Add systemd service snippets +- Use macros for _unitdir and _udevrulesdir +- Mark _datadir/gtk-doc as directory + * Tue Sep 3 2019 Christian Kellner - 0.99.11-1 - New upstream release 0.99.11 - Intltool has been replaced by gettext From c6195fd4aa9a045ca60d0bec8ec0b034b8ffeaf5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 02:42:06 +0000 Subject: [PATCH 11/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index 1ddfebe..5dd5062 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -114,6 +114,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 0.99.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Sep 4 2019 Christian Kellner - 0.99.11-2 - Add systemd service snippets - Use macros for _unitdir and _udevrulesdir From 9b230b03d9987e17fe69e9e1e00ffa8c46637e9c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 16 Jun 2020 23:56:09 -0700 Subject: [PATCH 12/64] Fix imobiledevice support with new libplist, rebuild for soname bumps --- upower-0.99.11-libplist-2.0.patch | 11 +++++++++++ upower.spec | 14 +++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 upower-0.99.11-libplist-2.0.patch diff --git a/upower-0.99.11-libplist-2.0.patch b/upower-0.99.11-libplist-2.0.patch new file mode 100644 index 0000000..854cc52 --- /dev/null +++ b/upower-0.99.11-libplist-2.0.patch @@ -0,0 +1,11 @@ +--- upower-0.99.11/configure.ac 2019-07-07 01:29:27.000000000 -0700 ++++ upower-0.99.11/configure.ac.new 2020-06-16 23:53:21.290122829 -0700 +@@ -203,7 +203,7 @@ + AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), + with_idevice=$withval,with_idevice=yes) + AS_IF([test "x$with_idevice" != "xno"], +- [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist >= 0.12, have_idevice=yes, have_idevice=no)], ++ [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist-2.0 >= 0.12, have_idevice=yes, have_idevice=no)], + [have_idevice=no]) + AS_IF([test "x$have_idevice" = "xyes"], + [AC_DEFINE(HAVE_IDEVICE, 1, [Define to 1 if iDevice is going to be built])]) diff --git a/upower.spec b/upower.spec index 5dd5062..71248ec 100644 --- a/upower.spec +++ b/upower.spec @@ -2,10 +2,13 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz +# update libplist test in configure.ac for 2.2.0 +# not upstreamed yet as it needs to be smarter +Patch0: upower-0.99.11-libplist-2.0.patch BuildRequires: sqlite-devel BuildRequires: libtool @@ -19,6 +22,11 @@ BuildRequires: glib2-devel >= 2.6.0 BuildRequires: gobject-introspection-devel BuildRequires: gtk-doc BuildRequires: systemd +# Only required while we're patching configure.ac +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel + Requires: udev Requires: gobject-introspection @@ -50,6 +58,7 @@ Developer documentation for for libupower-glib. %autosetup -p1 %build +autoreconf -i %configure \ --enable-gtk-doc \ --disable-static \ @@ -114,6 +123,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Jun 16 2020 Adam Williamson - 0.99.11-4 +- Fix imobiledevice support with new libplist, rebuild for soname bumps + * Fri Jan 31 2020 Fedora Release Engineering - 0.99.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 1ae24937d0375c22a66a382bcae1807f2ffcba54 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 17 Jun 2020 12:18:35 +0200 Subject: [PATCH 13/64] Use upstreamed libplist patch --- ...ld-Use-a-newer-libplist-if-available.patch | 28 +++++++ ...-Add-support-for-iPhone-XR-XS-models.patch | 76 +++++++++++++++++++ upower.spec | 16 ++-- 3 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 0001-build-Use-a-newer-libplist-if-available.patch create mode 100644 0001-linux-Add-support-for-iPhone-XR-XS-models.patch diff --git a/0001-build-Use-a-newer-libplist-if-available.patch b/0001-build-Use-a-newer-libplist-if-available.patch new file mode 100644 index 0000000..3e9e3b6 --- /dev/null +++ b/0001-build-Use-a-newer-libplist-if-available.patch @@ -0,0 +1,28 @@ +From 694207d3f08bdd2095f01eee09eb523363800825 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 16 Jun 2020 14:04:25 +0200 +Subject: [PATCH] build: Use a newer libplist if available + +--- + configure.ac | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index a96b794..5f08d91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -202,8 +202,10 @@ if test x$with_backend = xlinux; then + PKG_CHECK_MODULES(USB, [libusb-1.0 >= 1.0.0]) + AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), + with_idevice=$withval,with_idevice=yes) ++ LIBPLIST_DEP=libplist ++ PKG_CHECK_EXISTS(libplist-2.0, LIBPLIST_DEP=libplist-2.0) + AS_IF([test "x$with_idevice" != "xno"], +- [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist >= 0.12, have_idevice=yes, have_idevice=no)], ++ [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 $LIBPLIST_DEP, have_idevice=yes, have_idevice=no)], + [have_idevice=no]) + AS_IF([test "x$have_idevice" = "xyes"], + [AC_DEFINE(HAVE_IDEVICE, 1, [Define to 1 if iDevice is going to be built])]) +-- +2.26.2 + diff --git a/0001-linux-Add-support-for-iPhone-XR-XS-models.patch b/0001-linux-Add-support-for-iPhone-XR-XS-models.patch new file mode 100644 index 0000000..08654a1 --- /dev/null +++ b/0001-linux-Add-support-for-iPhone-XR-XS-models.patch @@ -0,0 +1,76 @@ +From 97185bae75b16bea48d532aa5511417e485b1c06 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 17 Jun 2020 10:51:09 +0200 +Subject: [PATCH] linux: Add support for iPhone XR, XS models + +Modifying the udev serial to be acceptable as an hyphened UDID, as the +usbmux stack expects. + +Closes: #114 +--- + src/linux/up-device-idevice.c | 28 ++++++++++++++++++++++++++-- + 1 file changed, 26 insertions(+), 2 deletions(-) + +diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c +index a808269..d2fa0a1 100644 +--- a/src/linux/up-device-idevice.c ++++ b/src/linux/up-device-idevice.c +@@ -203,6 +203,28 @@ out: + return G_SOURCE_CONTINUE; + } + ++static char * ++get_device_uuid (GUdevDevice *native) ++{ ++ const char *uuid; ++ char *retval; ++ ++ uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT"); ++ if (uuid == NULL) ++ return NULL; ++ ++ if (strlen (uuid) != 24) ++ return g_strdup (uuid); ++ ++ /* new style UDID: add hyphen between first 8 and following 16 digits */ ++ retval = g_malloc0 (24 + 1 + 1); ++ memcpy (&retval[0], &uuid[0], 8); ++ retval[8] = '-'; ++ memcpy (&retval[9], &uuid[8], 16); ++ ++ return retval; ++} ++ + /** + * up_device_idevice_coldplug: + * +@@ -213,7 +235,7 @@ up_device_idevice_coldplug (UpDevice *device) + { + UpDeviceIdevice *idevice = UP_DEVICE_IDEVICE (device); + GUdevDevice *native; +- const gchar *uuid; ++ char *uuid; + const gchar *model; + UpDeviceKind kind; + +@@ -223,7 +245,7 @@ up_device_idevice_coldplug (UpDevice *device) + return FALSE; + + /* Get the UUID */ +- uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT"); ++ uuid = get_device_uuid (native); + if (uuid == NULL) + return FALSE; + +@@ -253,6 +275,8 @@ up_device_idevice_coldplug (UpDevice *device) + g_source_set_name_by_id (idevice->priv->start_id, + "[upower] up_device_idevice_start_poll_cb (linux)"); + ++ g_free (uuid); ++ + return TRUE; + } + +-- +2.26.2 + diff --git a/upower.spec b/upower.spec index 71248ec..e13c56f 100644 --- a/upower.spec +++ b/upower.spec @@ -2,15 +2,16 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz -# update libplist test in configure.ac for 2.2.0 -# not upstreamed yet as it needs to be smarter -Patch0: upower-0.99.11-libplist-2.0.patch + +Patch0: 0001-linux-Add-support-for-iPhone-XR-XS-models.patch +Patch1: 0001-build-Use-a-newer-libplist-if-available.patch BuildRequires: sqlite-devel +BuildRequires: git BuildRequires: libtool BuildRequires: gettext BuildRequires: libgudev1-devel @@ -55,7 +56,7 @@ BuildArch: noarch Developer documentation for for libupower-glib. %prep -%autosetup -p1 +%autosetup -p1 -S git %build autoreconf -i @@ -123,6 +124,11 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Jun 17 2020 Bastien Nocera - 0.99.11-5 ++ upower-0.99.11-5 +- Use upstreamed libplist patch +- Add support for iPhone XS,XR + * Tue Jun 16 2020 Adam Williamson - 0.99.11-4 - Fix imobiledevice support with new libplist, rebuild for soname bumps From 038911c5910c8955ef7cccfbcfe2bad96585e56c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 17 Jun 2020 08:54:47 -0700 Subject: [PATCH 14/64] Remove patch replaced in last commit --- upower-0.99.11-libplist-2.0.patch | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 upower-0.99.11-libplist-2.0.patch diff --git a/upower-0.99.11-libplist-2.0.patch b/upower-0.99.11-libplist-2.0.patch deleted file mode 100644 index 854cc52..0000000 --- a/upower-0.99.11-libplist-2.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- upower-0.99.11/configure.ac 2019-07-07 01:29:27.000000000 -0700 -+++ upower-0.99.11/configure.ac.new 2020-06-16 23:53:21.290122829 -0700 -@@ -203,7 +203,7 @@ - AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), - with_idevice=$withval,with_idevice=yes) - AS_IF([test "x$with_idevice" != "xno"], -- [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist >= 0.12, have_idevice=yes, have_idevice=no)], -+ [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist-2.0 >= 0.12, have_idevice=yes, have_idevice=no)], - [have_idevice=no]) - AS_IF([test "x$have_idevice" = "xyes"], - [AC_DEFINE(HAVE_IDEVICE, 1, [Define to 1 if iDevice is going to be built])]) From e7e3fb4ee426802c8236860b87b10512d387db80 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 13:21:49 +0000 Subject: [PATCH 15/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index e13c56f..f33f2f7 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -124,6 +124,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 0.99.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Jun 17 2020 Bastien Nocera - 0.99.11-5 + upower-0.99.11-5 - Use upstreamed libplist patch From d48aea48b2ce39485888461536534644bacb55a9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 24 Nov 2020 17:14:28 +0100 Subject: [PATCH 16/64] + upower-0.99.11-7 Disable libimobiledevice integration on RHEL --- upower.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index f33f2f7..a16180d 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -16,9 +16,11 @@ BuildRequires: libtool BuildRequires: gettext BuildRequires: libgudev1-devel %ifnarch s390 s390x +%if ! 0%{?rhel} BuildRequires: libusbx-devel BuildRequires: libimobiledevice-devel %endif +%endif BuildRequires: glib2-devel >= 2.6.0 BuildRequires: gobject-introspection-devel BuildRequires: gtk-doc @@ -124,6 +126,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Nov 24 2020 Bastien Nocera - 0.99.11-7 ++ upower-0.99.11-7 +- Disable libimobiledevice integration on RHEL + * Wed Jul 29 2020 Fedora Release Engineering - 0.99.11-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 03c8ad8b8aac9e354f3144e9f586c33fa36978a8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 9 Jan 2021 00:26:51 +0000 Subject: [PATCH 17/64] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- upower.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/upower.spec b/upower.spec index a16180d..b000b36 100644 --- a/upower.spec +++ b/upower.spec @@ -10,6 +10,7 @@ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/% Patch0: 0001-linux-Add-support-for-iPhone-XR-XS-models.patch Patch1: 0001-build-Use-a-newer-libplist-if-available.patch +BuildRequires: make BuildRequires: sqlite-devel BuildRequires: git BuildRequires: libtool From 793a5d858a0655c85ac61fd4444e2a769c288331 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 19 Jan 2021 13:38:35 +0100 Subject: [PATCH 18/64] + upower-0.99.11-8 Remove USB dependency --- upower-no-usb-dep.patch | 574 ++++++++++++++++++++++++++++++++++++++++ upower.spec | 8 +- 2 files changed, 580 insertions(+), 2 deletions(-) create mode 100644 upower-no-usb-dep.patch diff --git a/upower-no-usb-dep.patch b/upower-no-usb-dep.patch new file mode 100644 index 0000000..548f2a0 --- /dev/null +++ b/upower-no-usb-dep.patch @@ -0,0 +1,574 @@ +From 4227d0c439aa8f812c702f7f169be545d3a139e1 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 19 Jan 2021 13:28:48 +0100 +Subject: [PATCH 1/2] linux: Remove support for CSR devices + +Those devices date back from the mid-2000s. If they still work, and +somebody is still interested in having them export their battery status, +we would recommend moving this information to the appropriate kernel +drivers. +--- + rules/95-upower-csr.rules | 21 --- + rules/Makefile.am | 1 - + src/linux/Makefile.am | 2 - + src/linux/up-backend.c | 8 - + src/linux/up-device-csr.c | 344 -------------------------------------- + src/linux/up-device-csr.h | 56 ------- + 6 files changed, 432 deletions(-) + delete mode 100644 rules/95-upower-csr.rules + delete mode 100644 src/linux/up-device-csr.c + delete mode 100644 src/linux/up-device-csr.h + +diff --git a/rules/95-upower-csr.rules b/rules/95-upower-csr.rules +deleted file mode 100644 +index 7c5f560..0000000 +--- a/rules/95-upower-csr.rules ++++ /dev/null +@@ -1,21 +0,0 @@ +-############################################################################################################## +-# Logitech Mice with CSR battery readouts +-# +-# These are properties defining the behavior: +-# UPOWER_CSR_DUAL (Dual Receiver) +-# +-SUBSYSTEM!="usb", GOTO="up_csr_end" +- +-ATTR{idVendor}=="046d", ENV{UPOWER_VENDOR}="Logitech, Inc." +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c501", ENV{UPOWER_PRODUCT}="Mouse Receiver", ENV{UPOWER_BATTERY_TYPE}="mouse" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c502", ENV{UPOWER_PRODUCT}="Dual Receiver", ENV{UPOWER_BATTERY_TYPE}="mouse", ENV{UPOWER_CSR_DUAL}="1" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c504", ENV{UPOWER_PRODUCT}="Freedom Optical", ENV{UPOWER_BATTERY_TYPE}="mouse", ENV{UPOWER_CSR_DUAL}="1" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c505", ENV{UPOWER_PRODUCT}="Elite Duo", ENV{UPOWER_BATTERY_TYPE}="keyboard" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c506", ENV{UPOWER_PRODUCT}="MX700 Optical Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c508", ENV{UPOWER_PRODUCT}="Optical TrackMan", ENV{UPOWER_BATTERY_TYPE}="mouse" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c50e", ENV{UPOWER_PRODUCT}="MX1000 Laser Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c510", ENV{UPOWER_PRODUCT}="Click! Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c512", ENV{UPOWER_PRODUCT}="Keyboard+Mouse Receiver", ENV{UPOWER_BATTERY_TYPE}="keyboard" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c702", ENV{UPOWER_PRODUCT}="Presenter", ENV{UPOWER_BATTERY_TYPE}="mouse" +- +-LABEL="up_csr_end" +diff --git a/rules/Makefile.am b/rules/Makefile.am +index 5262d9e..1d71d24 100644 +--- a/rules/Makefile.am ++++ b/rules/Makefile.am +@@ -3,7 +3,6 @@ + udevrules_DATA = \ + 95-upower-wup.rules \ + 95-upower-hid.rules \ +- 95-upower-csr.rules \ + 95-upower-hidpp.rules + + EXTRA_DIST = \ +diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am +index aec0b31..82f60fd 100644 +--- a/src/linux/Makefile.am ++++ b/src/linux/Makefile.am +@@ -29,8 +29,6 @@ endif + libupshared_la_SOURCES = \ + up-device-supply.c \ + up-device-supply.h \ +- up-device-csr.c \ +- up-device-csr.h \ + up-device-unifying.c \ + up-device-unifying.h \ + up-device-hid.c \ +diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c +index 04e6f2f..e17a946 100644 +--- a/src/linux/up-backend.c ++++ b/src/linux/up-backend.c +@@ -38,7 +38,6 @@ + #include "sysfs-utils.h" + + #include "up-device-supply.h" +-#include "up-device-csr.h" + #include "up-device-unifying.h" + #include "up-device-wup.h" + #include "up-device-hid.h" +@@ -147,13 +146,6 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native) + g_object_unref (device); + #endif /* HAVE_IDEVICE */ + +- /* see if this is a CSR mouse or keyboard */ +- device = UP_DEVICE (up_device_csr_new ()); +- ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native)); +- if (ret) +- goto out; +- g_object_unref (device); +- + /* try to detect a HID UPS */ + device = UP_DEVICE (up_device_hid_new ()); + ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native)); +diff --git a/src/linux/up-device-csr.c b/src/linux/up-device-csr.c +deleted file mode 100644 +index 63442d8..0000000 +--- a/src/linux/up-device-csr.c ++++ /dev/null +@@ -1,344 +0,0 @@ +-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- +- * +- * Copyright (C) 2005-2010 Richard Hughes +- * Copyright (C) 2004 Sergey V. Udaltsov +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +- * +- */ +- +-#ifdef HAVE_CONFIG_H +-# include "config.h" +-#endif +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "sysfs-utils.h" +-#include "up-types.h" +-#include "up-device-csr.h" +- +-#define UP_DEVICE_CSR_REFRESH_TIMEOUT 30L +- +-/* Internal CSR registers */ +-#define CSR_P6 0 +-#define CSR_P0 1 +-#define CSR_P4 2 +-#define CSR_P5 3 +-#define CSR_P8 4 +-#define CSR_P9 5 +-#define CSR_PB0 6 +-#define CSR_PB1 7 +- +-struct UpDeviceCsrPrivate +-{ +- gboolean is_dual; +- guint bus_num; +- guint dev_num; +- gint raw_value; +- libusb_context *ctx; +- libusb_device *device; +-}; +- +-G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceCsr, up_device_csr, UP_TYPE_DEVICE) +- +-static gboolean up_device_csr_refresh (UpDevice *device); +- +-/** +- * up_device_csr_poll_cb: +- **/ +-static gboolean +-up_device_csr_poll_cb (UpDeviceCsr *csr) +-{ +- UpDevice *device = UP_DEVICE (csr); +- +- g_debug ("Polling: %s", up_device_get_object_path (device)); +- up_device_csr_refresh (device); +- +- /* always continue polling */ +- return TRUE; +-} +- +-/** +- * up_device_csr_find_device: +- **/ +-static libusb_device * +-up_device_csr_find_device (UpDeviceCsr *csr) +-{ +- libusb_device *curr_device = NULL; +- libusb_device **devices = NULL; +- guint8 bus_num; +- guint8 dev_num; +- guint i; +- ssize_t cnt; +- +- g_debug ("Looking for: [%03d][%03d]", csr->priv->bus_num, csr->priv->dev_num); +- +- /* try to find the right device */ +- cnt = libusb_get_device_list (csr->priv->ctx, &devices); +- if (cnt < 0) { +-/* need to depend on > libusb1-1.0.9 for libusb_strerror() +- g_warning ("failed to get device list: %s", libusb_strerror (cnt)); +- */ +- g_warning ("failed to get device list: %d", (int)cnt); +- goto out; +- } +- if (devices == NULL) { +- g_warning ("failed to get device list"); +- goto out; +- } +- for (i=0; devices[i] != NULL; i++) { +- +- bus_num = libusb_get_bus_number (devices[i]); +- dev_num = libusb_get_device_address (devices[i]); +- if (bus_num == csr->priv->bus_num && +- dev_num == csr->priv->dev_num) { +- curr_device = libusb_ref_device (devices[i]); +- break; +- } +- } +- +- libusb_free_device_list (devices, TRUE); +-out: +- return curr_device; +-} +- +-/** +- * up_device_csr_coldplug: +- * +- * Return %TRUE on success, %FALSE if we failed to get data and should be removed +- **/ +-static gboolean +-up_device_csr_coldplug (UpDevice *device) +-{ +- UpDeviceCsr *csr = UP_DEVICE_CSR (device); +- GUdevDevice *native; +- gboolean ret = FALSE; +- const gchar *type; +- const gchar *native_path; +- const gchar *vendor; +- const gchar *product; +- +- /* get the type */ +- native = G_UDEV_DEVICE (up_device_get_native (device)); +- type = g_udev_device_get_property (native, "UPOWER_BATTERY_TYPE"); +- if (type == NULL) +- goto out; +- +- /* which one? */ +- if (g_strcmp0 (type, "mouse") == 0) +- g_object_set (device, "type", UP_DEVICE_KIND_MOUSE, NULL); +- else if (g_strcmp0 (type, "keyboard") == 0) +- g_object_set (device, "type", UP_DEVICE_KIND_KEYBOARD, NULL); +- else { +- g_debug ("not a recognised csr device"); +- goto out; +- } +- +- /* get what USB device we are */ +- native_path = g_udev_device_get_sysfs_path (native); +- csr->priv->bus_num = sysfs_get_int (native_path, "busnum"); +- csr->priv->dev_num = sysfs_get_int (native_path, "devnum"); +- +- /* get correct bus numbers? */ +- if (csr->priv->bus_num == 0 || csr->priv->dev_num == 0) { +- g_warning ("unable to get bus or device numbers"); +- goto out; +- } +- +- /* try to get the usb device */ +- csr->priv->device = up_device_csr_find_device (csr); +- if (csr->priv->device == NULL) { +- g_debug ("failed to get device %p", csr); +- goto out; +- } +- +- /* get optional quirk parameters */ +- ret = g_udev_device_has_property (native, "UPOWER_CSR_DUAL"); +- if (ret) +- csr->priv->is_dual = g_udev_device_get_property_as_boolean (native, "UPOWER_CSR_DUAL"); +- g_debug ("is_dual=%i", csr->priv->is_dual); +- +- /* prefer UPOWER names */ +- vendor = g_udev_device_get_property (native, "UPOWER_VENDOR"); +- if (vendor == NULL) +- vendor = g_udev_device_get_property (native, "ID_VENDOR"); +- product = g_udev_device_get_property (native, "UPOWER_PRODUCT"); +- if (product == NULL) +- product = g_udev_device_get_property (native, "ID_PRODUCT"); +- +- /* hardcode some values */ +- g_object_set (device, +- "vendor", vendor, +- "model", product, +- "power-supply", FALSE, +- "is-present", TRUE, +- "is-rechargeable", TRUE, +- "state", UP_DEVICE_STATE_DISCHARGING, +- "has-history", TRUE, +- NULL); +- +- /* coldplug */ +- ret = up_device_csr_refresh (device); +- if (!ret) +- goto out; +- +- /* set up a poll */ +- up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_csr_poll_cb); +-out: +- return ret; +-} +- +-/** +- * up_device_csr_refresh: +- * +- * Return %TRUE on success, %FALSE if we failed to refresh or no data +- **/ +-static gboolean +-up_device_csr_refresh (UpDevice *device) +-{ +- gboolean ret = FALSE; +- UpDeviceCsr *csr = UP_DEVICE_CSR (device); +- libusb_device_handle *handle = NULL; +- guint8 buf[80]; +- guint addr; +- gdouble percentage; +- gint retval; +- +- /* ensure we still have a device */ +- if (csr->priv->device == NULL) { +- g_warning ("no device!"); +- goto out; +- } +- +- /* open USB device */ +- retval = libusb_open (csr->priv->device, &handle); +- if (retval < 0) { +- g_warning ("could not open device: %i", retval); +- goto out; +- } +- +- /* For dual receivers C502, C504 and C505, the mouse is the +- * second device and uses an addr of 1 in the value and index +- * fields' high byte */ +- addr = csr->priv->is_dual ? 1<<8 : 0; +- +- /* get the charge */ +- retval = libusb_control_transfer (handle, 0xc0, 0x09, 0x03|addr, 0x00|addr, +- buf, 8, UP_DEVICE_CSR_REFRESH_TIMEOUT); +- if (retval < 0) { +- g_warning ("failed to write to device: %i", retval); +- goto out; +- } +- +- /* ensure we wrote 8 bytes */ +- if (retval != 8) { +- g_warning ("failed to write to device, wrote %i bytes", retval); +- goto out; +- } +- +- /* is a C504 receiver busy? */ +- if (buf[CSR_P0] == 0x3b && buf[CSR_P4] == 0) { +- g_warning ("receiver busy"); +- goto out; +- } +- +- /* get battery status */ +- csr->priv->raw_value = buf[CSR_P5] & 0x07; +- g_debug ("charge level: %d", csr->priv->raw_value); +- if (csr->priv->raw_value != 0) { +- percentage = (100.0 / 7.0) * csr->priv->raw_value; +- g_object_set (device, "percentage", percentage, NULL); +- g_debug ("percentage=%f", percentage); +- } +- +- /* reset time */ +- g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL); +- +- /* success */ +- ret = TRUE; +-out: +- if (handle != NULL) +- libusb_close (handle); +- return ret; +-} +- +-/** +- * up_device_csr_init: +- **/ +-static void +-up_device_csr_init (UpDeviceCsr *csr) +-{ +- gint retval; +- csr->priv = up_device_csr_get_instance_private (csr); +- +- csr->priv->raw_value = -1; +- retval = libusb_init (&csr->priv->ctx); +- if (retval < 0) +- g_warning ("could not initialize libusb: %i", retval); +-} +- +-/** +- * up_device_csr_finalize: +- **/ +-static void +-up_device_csr_finalize (GObject *object) +-{ +- UpDeviceCsr *csr; +- +- g_return_if_fail (object != NULL); +- g_return_if_fail (UP_IS_DEVICE_CSR (object)); +- +- csr = UP_DEVICE_CSR (object); +- g_return_if_fail (csr->priv != NULL); +- +- if (csr->priv->ctx != NULL) +- libusb_exit (csr->priv->ctx); +- up_daemon_stop_poll (object); +- +- G_OBJECT_CLASS (up_device_csr_parent_class)->finalize (object); +-} +- +-/** +- * up_device_csr_class_init: +- **/ +-static void +-up_device_csr_class_init (UpDeviceCsrClass *klass) +-{ +- GObjectClass *object_class = G_OBJECT_CLASS (klass); +- UpDeviceClass *device_class = UP_DEVICE_CLASS (klass); +- +- object_class->finalize = up_device_csr_finalize; +- device_class->coldplug = up_device_csr_coldplug; +- device_class->refresh = up_device_csr_refresh; +-} +- +-/** +- * up_device_csr_new: +- **/ +-UpDeviceCsr * +-up_device_csr_new (void) +-{ +- return g_object_new (UP_TYPE_DEVICE_CSR, NULL); +-} +- +diff --git a/src/linux/up-device-csr.h b/src/linux/up-device-csr.h +deleted file mode 100644 +index 65e7f35..0000000 +--- a/src/linux/up-device-csr.h ++++ /dev/null +@@ -1,56 +0,0 @@ +-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- +- * +- * Copyright (C) 2008 David Zeuthen +- * Copyright (C) 2008 Richard Hughes +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +- * +- */ +- +-#ifndef __UP_DEVICE_CSR_H__ +-#define __UP_DEVICE_CSR_H__ +- +-#include +-#include "up-device.h" +- +-G_BEGIN_DECLS +- +-#define UP_TYPE_DEVICE_CSR (up_device_csr_get_type ()) +-#define UP_DEVICE_CSR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsr)) +-#define UP_DEVICE_CSR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_DEVICE_CSR, UpDeviceCsrClass)) +-#define UP_IS_DEVICE_CSR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_DEVICE_CSR)) +-#define UP_IS_DEVICE_CSR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_DEVICE_CSR)) +-#define UP_DEVICE_CSR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsrClass)) +- +-typedef struct UpDeviceCsrPrivate UpDeviceCsrPrivate; +- +-typedef struct +-{ +- UpDevice parent; +- UpDeviceCsrPrivate *priv; +-} UpDeviceCsr; +- +-typedef struct +-{ +- UpDeviceClass parent_class; +-} UpDeviceCsrClass; +- +-GType up_device_csr_get_type (void); +-UpDeviceCsr *up_device_csr_new (void); +- +-G_END_DECLS +- +-#endif /* __UP_DEVICE_CSR_H__ */ +- +-- +2.29.2 + + +From 64582256a8c75127c3de23f5542c8467e2e9484a Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 19 Jan 2021 13:31:25 +0100 +Subject: [PATCH 2/2] build: Remove libusb dependency in Linux + +As the last user, the CSR support code, was removed. +--- + configure.ac | 1 - + src/Makefile.am | 2 -- + src/linux/Makefile.am | 1 - + 3 files changed, 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 5f08d91..9db579f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -199,7 +199,6 @@ AC_SUBST(BACKEND, "$with_backend") + have_idevice=no + if test x$with_backend = xlinux; then + PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= 147]) +- PKG_CHECK_MODULES(USB, [libusb-1.0 >= 1.0.0]) + AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), + with_idevice=$withval,with_idevice=yes) + LIBPLIST_DEP=libplist +diff --git a/src/Makefile.am b/src/Makefile.am +index 3400139..81f5566 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -69,7 +69,6 @@ upowerd_CPPFLAGS = \ + + upowerd_LDADD = \ + -lm \ +- $(USB_LIBS) \ + $(GIO_LIBS) \ + $(GIO_UNIX_LIBS) \ + $(UPOWER_LIBS) +@@ -94,7 +93,6 @@ endif + if BACKEND_TYPE_LINUX + upowerd_LDADD += \ + linux/libupshared.la \ +- $(USB_LIBS) \ + $(GUDEV_LIBS) \ + $(IDEVICE_LIBS) \ + $(NULL) +diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am +index 82f60fd..5f3475d 100644 +--- a/src/linux/Makefile.am ++++ b/src/linux/Makefile.am +@@ -7,7 +7,6 @@ AM_CPPFLAGS = \ + -DG_LOG_DOMAIN=\"UPower-Linux\" \ + -DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \ + -I$(top_srcdir)/libupower-glib \ +- $(USB_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GIO_UNIX_CFLAGS) \ + $(GUDEV_CFLAGS) \ +-- +2.29.2 + diff --git a/upower.spec b/upower.spec index b000b36..e53ce3d 100644 --- a/upower.spec +++ b/upower.spec @@ -2,13 +2,14 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz Patch0: 0001-linux-Add-support-for-iPhone-XR-XS-models.patch Patch1: 0001-build-Use-a-newer-libplist-if-available.patch +Patch2: upower-no-usb-dep.patch BuildRequires: make BuildRequires: sqlite-devel @@ -18,7 +19,6 @@ BuildRequires: gettext BuildRequires: libgudev1-devel %ifnarch s390 s390x %if ! 0%{?rhel} -BuildRequires: libusbx-devel BuildRequires: libimobiledevice-devel %endif %endif @@ -127,6 +127,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Jan 19 2021 Bastien Nocera - 0.99.11-8 ++ upower-0.99.11-8 +- Remove USB dependency + * Tue Nov 24 2020 Bastien Nocera - 0.99.11-7 + upower-0.99.11-7 - Disable libimobiledevice integration on RHEL From 7bd1923a9d0eb34026e97337375dd748ef271e13 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 22:44:08 +0000 Subject: [PATCH 19/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index e53ce3d..6ddd9c2 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -127,6 +127,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 0.99.11-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Jan 19 2021 Bastien Nocera - 0.99.11-8 + upower-0.99.11-8 - Remove USB dependency From 809c5439d2024d37d424f5849a01979a5ad052ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 2 Mar 2021 16:12:05 +0100 Subject: [PATCH 20/64] Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. --- upower.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index 6ddd9c2..288a8e2 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.11 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz @@ -127,6 +127,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.99.11-10 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + * Wed Jan 27 2021 Fedora Release Engineering - 0.99.11-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From a457c6e92bb8d4e88ce2258a33ff615b9468f50b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 17 Jun 2021 15:59:26 +0200 Subject: [PATCH 21/64] + upower-0.99.12-1 Update to 0.99.12 --- .gitignore | 1 + ...ld-Use-a-newer-libplist-if-available.patch | 28 - ...-Add-support-for-iPhone-XR-XS-models.patch | 76 --- sources | 2 +- upower-no-usb-dep.patch | 574 ------------------ upower.spec | 14 +- 6 files changed, 9 insertions(+), 686 deletions(-) delete mode 100644 0001-build-Use-a-newer-libplist-if-available.patch delete mode 100644 0001-linux-Add-support-for-iPhone-XR-XS-models.patch delete mode 100644 upower-no-usb-dep.patch diff --git a/.gitignore b/.gitignore index cc5db30..a6d69d3 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.9.tar.xz /upower-0.99.10.tar.xz /upower-0.99.11.tar.xz +/upower-0.99.12.tar.xz diff --git a/0001-build-Use-a-newer-libplist-if-available.patch b/0001-build-Use-a-newer-libplist-if-available.patch deleted file mode 100644 index 3e9e3b6..0000000 --- a/0001-build-Use-a-newer-libplist-if-available.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 694207d3f08bdd2095f01eee09eb523363800825 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 16 Jun 2020 14:04:25 +0200 -Subject: [PATCH] build: Use a newer libplist if available - ---- - configure.ac | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index a96b794..5f08d91 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -202,8 +202,10 @@ if test x$with_backend = xlinux; then - PKG_CHECK_MODULES(USB, [libusb-1.0 >= 1.0.0]) - AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), - with_idevice=$withval,with_idevice=yes) -+ LIBPLIST_DEP=libplist -+ PKG_CHECK_EXISTS(libplist-2.0, LIBPLIST_DEP=libplist-2.0) - AS_IF([test "x$with_idevice" != "xno"], -- [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist >= 0.12, have_idevice=yes, have_idevice=no)], -+ [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 $LIBPLIST_DEP, have_idevice=yes, have_idevice=no)], - [have_idevice=no]) - AS_IF([test "x$have_idevice" = "xyes"], - [AC_DEFINE(HAVE_IDEVICE, 1, [Define to 1 if iDevice is going to be built])]) --- -2.26.2 - diff --git a/0001-linux-Add-support-for-iPhone-XR-XS-models.patch b/0001-linux-Add-support-for-iPhone-XR-XS-models.patch deleted file mode 100644 index 08654a1..0000000 --- a/0001-linux-Add-support-for-iPhone-XR-XS-models.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 97185bae75b16bea48d532aa5511417e485b1c06 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Wed, 17 Jun 2020 10:51:09 +0200 -Subject: [PATCH] linux: Add support for iPhone XR, XS models - -Modifying the udev serial to be acceptable as an hyphened UDID, as the -usbmux stack expects. - -Closes: #114 ---- - src/linux/up-device-idevice.c | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c -index a808269..d2fa0a1 100644 ---- a/src/linux/up-device-idevice.c -+++ b/src/linux/up-device-idevice.c -@@ -203,6 +203,28 @@ out: - return G_SOURCE_CONTINUE; - } - -+static char * -+get_device_uuid (GUdevDevice *native) -+{ -+ const char *uuid; -+ char *retval; -+ -+ uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT"); -+ if (uuid == NULL) -+ return NULL; -+ -+ if (strlen (uuid) != 24) -+ return g_strdup (uuid); -+ -+ /* new style UDID: add hyphen between first 8 and following 16 digits */ -+ retval = g_malloc0 (24 + 1 + 1); -+ memcpy (&retval[0], &uuid[0], 8); -+ retval[8] = '-'; -+ memcpy (&retval[9], &uuid[8], 16); -+ -+ return retval; -+} -+ - /** - * up_device_idevice_coldplug: - * -@@ -213,7 +235,7 @@ up_device_idevice_coldplug (UpDevice *device) - { - UpDeviceIdevice *idevice = UP_DEVICE_IDEVICE (device); - GUdevDevice *native; -- const gchar *uuid; -+ char *uuid; - const gchar *model; - UpDeviceKind kind; - -@@ -223,7 +245,7 @@ up_device_idevice_coldplug (UpDevice *device) - return FALSE; - - /* Get the UUID */ -- uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT"); -+ uuid = get_device_uuid (native); - if (uuid == NULL) - return FALSE; - -@@ -253,6 +275,8 @@ up_device_idevice_coldplug (UpDevice *device) - g_source_set_name_by_id (idevice->priv->start_id, - "[upower] up_device_idevice_start_poll_cb (linux)"); - -+ g_free (uuid); -+ - return TRUE; - } - --- -2.26.2 - diff --git a/sources b/sources index e475161..346234f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.11.tar.xz) = 67219a0beb98c97ac4512e4fe8ba83fc80a1035d1edb5367dda6911da50c672b047051f2f528e8703be29ab47547d92b6c71a7ef695226a1bdb5bc33e6d18803 +SHA512 (upower-0.99.12.tar.xz) = 9858a0e5f65271522cc5f36b0cd8722a5fb3effba37dbc5b22f08606701d4242ee54329d07460768004a24dc42705a84140ac6d9691afb7f09584b2e61fe3413 diff --git a/upower-no-usb-dep.patch b/upower-no-usb-dep.patch deleted file mode 100644 index 548f2a0..0000000 --- a/upower-no-usb-dep.patch +++ /dev/null @@ -1,574 +0,0 @@ -From 4227d0c439aa8f812c702f7f169be545d3a139e1 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 19 Jan 2021 13:28:48 +0100 -Subject: [PATCH 1/2] linux: Remove support for CSR devices - -Those devices date back from the mid-2000s. If they still work, and -somebody is still interested in having them export their battery status, -we would recommend moving this information to the appropriate kernel -drivers. ---- - rules/95-upower-csr.rules | 21 --- - rules/Makefile.am | 1 - - src/linux/Makefile.am | 2 - - src/linux/up-backend.c | 8 - - src/linux/up-device-csr.c | 344 -------------------------------------- - src/linux/up-device-csr.h | 56 ------- - 6 files changed, 432 deletions(-) - delete mode 100644 rules/95-upower-csr.rules - delete mode 100644 src/linux/up-device-csr.c - delete mode 100644 src/linux/up-device-csr.h - -diff --git a/rules/95-upower-csr.rules b/rules/95-upower-csr.rules -deleted file mode 100644 -index 7c5f560..0000000 ---- a/rules/95-upower-csr.rules -+++ /dev/null -@@ -1,21 +0,0 @@ --############################################################################################################## --# Logitech Mice with CSR battery readouts --# --# These are properties defining the behavior: --# UPOWER_CSR_DUAL (Dual Receiver) --# --SUBSYSTEM!="usb", GOTO="up_csr_end" -- --ATTR{idVendor}=="046d", ENV{UPOWER_VENDOR}="Logitech, Inc." --ATTR{idVendor}=="046d", ATTR{idProduct}=="c501", ENV{UPOWER_PRODUCT}="Mouse Receiver", ENV{UPOWER_BATTERY_TYPE}="mouse" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c502", ENV{UPOWER_PRODUCT}="Dual Receiver", ENV{UPOWER_BATTERY_TYPE}="mouse", ENV{UPOWER_CSR_DUAL}="1" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c504", ENV{UPOWER_PRODUCT}="Freedom Optical", ENV{UPOWER_BATTERY_TYPE}="mouse", ENV{UPOWER_CSR_DUAL}="1" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c505", ENV{UPOWER_PRODUCT}="Elite Duo", ENV{UPOWER_BATTERY_TYPE}="keyboard" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c506", ENV{UPOWER_PRODUCT}="MX700 Optical Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c508", ENV{UPOWER_PRODUCT}="Optical TrackMan", ENV{UPOWER_BATTERY_TYPE}="mouse" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c50e", ENV{UPOWER_PRODUCT}="MX1000 Laser Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c510", ENV{UPOWER_PRODUCT}="Click! Mouse", ENV{UPOWER_BATTERY_TYPE}="mouse" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c512", ENV{UPOWER_PRODUCT}="Keyboard+Mouse Receiver", ENV{UPOWER_BATTERY_TYPE}="keyboard" --ATTR{idVendor}=="046d", ATTR{idProduct}=="c702", ENV{UPOWER_PRODUCT}="Presenter", ENV{UPOWER_BATTERY_TYPE}="mouse" -- --LABEL="up_csr_end" -diff --git a/rules/Makefile.am b/rules/Makefile.am -index 5262d9e..1d71d24 100644 ---- a/rules/Makefile.am -+++ b/rules/Makefile.am -@@ -3,7 +3,6 @@ - udevrules_DATA = \ - 95-upower-wup.rules \ - 95-upower-hid.rules \ -- 95-upower-csr.rules \ - 95-upower-hidpp.rules - - EXTRA_DIST = \ -diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am -index aec0b31..82f60fd 100644 ---- a/src/linux/Makefile.am -+++ b/src/linux/Makefile.am -@@ -29,8 +29,6 @@ endif - libupshared_la_SOURCES = \ - up-device-supply.c \ - up-device-supply.h \ -- up-device-csr.c \ -- up-device-csr.h \ - up-device-unifying.c \ - up-device-unifying.h \ - up-device-hid.c \ -diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c -index 04e6f2f..e17a946 100644 ---- a/src/linux/up-backend.c -+++ b/src/linux/up-backend.c -@@ -38,7 +38,6 @@ - #include "sysfs-utils.h" - - #include "up-device-supply.h" --#include "up-device-csr.h" - #include "up-device-unifying.h" - #include "up-device-wup.h" - #include "up-device-hid.h" -@@ -147,13 +146,6 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native) - g_object_unref (device); - #endif /* HAVE_IDEVICE */ - -- /* see if this is a CSR mouse or keyboard */ -- device = UP_DEVICE (up_device_csr_new ()); -- ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native)); -- if (ret) -- goto out; -- g_object_unref (device); -- - /* try to detect a HID UPS */ - device = UP_DEVICE (up_device_hid_new ()); - ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native)); -diff --git a/src/linux/up-device-csr.c b/src/linux/up-device-csr.c -deleted file mode 100644 -index 63442d8..0000000 ---- a/src/linux/up-device-csr.c -+++ /dev/null -@@ -1,344 +0,0 @@ --/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -- * -- * Copyright (C) 2005-2010 Richard Hughes -- * Copyright (C) 2004 Sergey V. Udaltsov -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- * -- */ -- --#ifdef HAVE_CONFIG_H --# include "config.h" --#endif -- --#include --#include -- --#include --#include --#include --#include --#include --#include --#include -- --#include "sysfs-utils.h" --#include "up-types.h" --#include "up-device-csr.h" -- --#define UP_DEVICE_CSR_REFRESH_TIMEOUT 30L -- --/* Internal CSR registers */ --#define CSR_P6 0 --#define CSR_P0 1 --#define CSR_P4 2 --#define CSR_P5 3 --#define CSR_P8 4 --#define CSR_P9 5 --#define CSR_PB0 6 --#define CSR_PB1 7 -- --struct UpDeviceCsrPrivate --{ -- gboolean is_dual; -- guint bus_num; -- guint dev_num; -- gint raw_value; -- libusb_context *ctx; -- libusb_device *device; --}; -- --G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceCsr, up_device_csr, UP_TYPE_DEVICE) -- --static gboolean up_device_csr_refresh (UpDevice *device); -- --/** -- * up_device_csr_poll_cb: -- **/ --static gboolean --up_device_csr_poll_cb (UpDeviceCsr *csr) --{ -- UpDevice *device = UP_DEVICE (csr); -- -- g_debug ("Polling: %s", up_device_get_object_path (device)); -- up_device_csr_refresh (device); -- -- /* always continue polling */ -- return TRUE; --} -- --/** -- * up_device_csr_find_device: -- **/ --static libusb_device * --up_device_csr_find_device (UpDeviceCsr *csr) --{ -- libusb_device *curr_device = NULL; -- libusb_device **devices = NULL; -- guint8 bus_num; -- guint8 dev_num; -- guint i; -- ssize_t cnt; -- -- g_debug ("Looking for: [%03d][%03d]", csr->priv->bus_num, csr->priv->dev_num); -- -- /* try to find the right device */ -- cnt = libusb_get_device_list (csr->priv->ctx, &devices); -- if (cnt < 0) { --/* need to depend on > libusb1-1.0.9 for libusb_strerror() -- g_warning ("failed to get device list: %s", libusb_strerror (cnt)); -- */ -- g_warning ("failed to get device list: %d", (int)cnt); -- goto out; -- } -- if (devices == NULL) { -- g_warning ("failed to get device list"); -- goto out; -- } -- for (i=0; devices[i] != NULL; i++) { -- -- bus_num = libusb_get_bus_number (devices[i]); -- dev_num = libusb_get_device_address (devices[i]); -- if (bus_num == csr->priv->bus_num && -- dev_num == csr->priv->dev_num) { -- curr_device = libusb_ref_device (devices[i]); -- break; -- } -- } -- -- libusb_free_device_list (devices, TRUE); --out: -- return curr_device; --} -- --/** -- * up_device_csr_coldplug: -- * -- * Return %TRUE on success, %FALSE if we failed to get data and should be removed -- **/ --static gboolean --up_device_csr_coldplug (UpDevice *device) --{ -- UpDeviceCsr *csr = UP_DEVICE_CSR (device); -- GUdevDevice *native; -- gboolean ret = FALSE; -- const gchar *type; -- const gchar *native_path; -- const gchar *vendor; -- const gchar *product; -- -- /* get the type */ -- native = G_UDEV_DEVICE (up_device_get_native (device)); -- type = g_udev_device_get_property (native, "UPOWER_BATTERY_TYPE"); -- if (type == NULL) -- goto out; -- -- /* which one? */ -- if (g_strcmp0 (type, "mouse") == 0) -- g_object_set (device, "type", UP_DEVICE_KIND_MOUSE, NULL); -- else if (g_strcmp0 (type, "keyboard") == 0) -- g_object_set (device, "type", UP_DEVICE_KIND_KEYBOARD, NULL); -- else { -- g_debug ("not a recognised csr device"); -- goto out; -- } -- -- /* get what USB device we are */ -- native_path = g_udev_device_get_sysfs_path (native); -- csr->priv->bus_num = sysfs_get_int (native_path, "busnum"); -- csr->priv->dev_num = sysfs_get_int (native_path, "devnum"); -- -- /* get correct bus numbers? */ -- if (csr->priv->bus_num == 0 || csr->priv->dev_num == 0) { -- g_warning ("unable to get bus or device numbers"); -- goto out; -- } -- -- /* try to get the usb device */ -- csr->priv->device = up_device_csr_find_device (csr); -- if (csr->priv->device == NULL) { -- g_debug ("failed to get device %p", csr); -- goto out; -- } -- -- /* get optional quirk parameters */ -- ret = g_udev_device_has_property (native, "UPOWER_CSR_DUAL"); -- if (ret) -- csr->priv->is_dual = g_udev_device_get_property_as_boolean (native, "UPOWER_CSR_DUAL"); -- g_debug ("is_dual=%i", csr->priv->is_dual); -- -- /* prefer UPOWER names */ -- vendor = g_udev_device_get_property (native, "UPOWER_VENDOR"); -- if (vendor == NULL) -- vendor = g_udev_device_get_property (native, "ID_VENDOR"); -- product = g_udev_device_get_property (native, "UPOWER_PRODUCT"); -- if (product == NULL) -- product = g_udev_device_get_property (native, "ID_PRODUCT"); -- -- /* hardcode some values */ -- g_object_set (device, -- "vendor", vendor, -- "model", product, -- "power-supply", FALSE, -- "is-present", TRUE, -- "is-rechargeable", TRUE, -- "state", UP_DEVICE_STATE_DISCHARGING, -- "has-history", TRUE, -- NULL); -- -- /* coldplug */ -- ret = up_device_csr_refresh (device); -- if (!ret) -- goto out; -- -- /* set up a poll */ -- up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_csr_poll_cb); --out: -- return ret; --} -- --/** -- * up_device_csr_refresh: -- * -- * Return %TRUE on success, %FALSE if we failed to refresh or no data -- **/ --static gboolean --up_device_csr_refresh (UpDevice *device) --{ -- gboolean ret = FALSE; -- UpDeviceCsr *csr = UP_DEVICE_CSR (device); -- libusb_device_handle *handle = NULL; -- guint8 buf[80]; -- guint addr; -- gdouble percentage; -- gint retval; -- -- /* ensure we still have a device */ -- if (csr->priv->device == NULL) { -- g_warning ("no device!"); -- goto out; -- } -- -- /* open USB device */ -- retval = libusb_open (csr->priv->device, &handle); -- if (retval < 0) { -- g_warning ("could not open device: %i", retval); -- goto out; -- } -- -- /* For dual receivers C502, C504 and C505, the mouse is the -- * second device and uses an addr of 1 in the value and index -- * fields' high byte */ -- addr = csr->priv->is_dual ? 1<<8 : 0; -- -- /* get the charge */ -- retval = libusb_control_transfer (handle, 0xc0, 0x09, 0x03|addr, 0x00|addr, -- buf, 8, UP_DEVICE_CSR_REFRESH_TIMEOUT); -- if (retval < 0) { -- g_warning ("failed to write to device: %i", retval); -- goto out; -- } -- -- /* ensure we wrote 8 bytes */ -- if (retval != 8) { -- g_warning ("failed to write to device, wrote %i bytes", retval); -- goto out; -- } -- -- /* is a C504 receiver busy? */ -- if (buf[CSR_P0] == 0x3b && buf[CSR_P4] == 0) { -- g_warning ("receiver busy"); -- goto out; -- } -- -- /* get battery status */ -- csr->priv->raw_value = buf[CSR_P5] & 0x07; -- g_debug ("charge level: %d", csr->priv->raw_value); -- if (csr->priv->raw_value != 0) { -- percentage = (100.0 / 7.0) * csr->priv->raw_value; -- g_object_set (device, "percentage", percentage, NULL); -- g_debug ("percentage=%f", percentage); -- } -- -- /* reset time */ -- g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL); -- -- /* success */ -- ret = TRUE; --out: -- if (handle != NULL) -- libusb_close (handle); -- return ret; --} -- --/** -- * up_device_csr_init: -- **/ --static void --up_device_csr_init (UpDeviceCsr *csr) --{ -- gint retval; -- csr->priv = up_device_csr_get_instance_private (csr); -- -- csr->priv->raw_value = -1; -- retval = libusb_init (&csr->priv->ctx); -- if (retval < 0) -- g_warning ("could not initialize libusb: %i", retval); --} -- --/** -- * up_device_csr_finalize: -- **/ --static void --up_device_csr_finalize (GObject *object) --{ -- UpDeviceCsr *csr; -- -- g_return_if_fail (object != NULL); -- g_return_if_fail (UP_IS_DEVICE_CSR (object)); -- -- csr = UP_DEVICE_CSR (object); -- g_return_if_fail (csr->priv != NULL); -- -- if (csr->priv->ctx != NULL) -- libusb_exit (csr->priv->ctx); -- up_daemon_stop_poll (object); -- -- G_OBJECT_CLASS (up_device_csr_parent_class)->finalize (object); --} -- --/** -- * up_device_csr_class_init: -- **/ --static void --up_device_csr_class_init (UpDeviceCsrClass *klass) --{ -- GObjectClass *object_class = G_OBJECT_CLASS (klass); -- UpDeviceClass *device_class = UP_DEVICE_CLASS (klass); -- -- object_class->finalize = up_device_csr_finalize; -- device_class->coldplug = up_device_csr_coldplug; -- device_class->refresh = up_device_csr_refresh; --} -- --/** -- * up_device_csr_new: -- **/ --UpDeviceCsr * --up_device_csr_new (void) --{ -- return g_object_new (UP_TYPE_DEVICE_CSR, NULL); --} -- -diff --git a/src/linux/up-device-csr.h b/src/linux/up-device-csr.h -deleted file mode 100644 -index 65e7f35..0000000 ---- a/src/linux/up-device-csr.h -+++ /dev/null -@@ -1,56 +0,0 @@ --/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -- * -- * Copyright (C) 2008 David Zeuthen -- * Copyright (C) 2008 Richard Hughes -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- * -- */ -- --#ifndef __UP_DEVICE_CSR_H__ --#define __UP_DEVICE_CSR_H__ -- --#include --#include "up-device.h" -- --G_BEGIN_DECLS -- --#define UP_TYPE_DEVICE_CSR (up_device_csr_get_type ()) --#define UP_DEVICE_CSR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsr)) --#define UP_DEVICE_CSR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_DEVICE_CSR, UpDeviceCsrClass)) --#define UP_IS_DEVICE_CSR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_DEVICE_CSR)) --#define UP_IS_DEVICE_CSR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_DEVICE_CSR)) --#define UP_DEVICE_CSR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsrClass)) -- --typedef struct UpDeviceCsrPrivate UpDeviceCsrPrivate; -- --typedef struct --{ -- UpDevice parent; -- UpDeviceCsrPrivate *priv; --} UpDeviceCsr; -- --typedef struct --{ -- UpDeviceClass parent_class; --} UpDeviceCsrClass; -- --GType up_device_csr_get_type (void); --UpDeviceCsr *up_device_csr_new (void); -- --G_END_DECLS -- --#endif /* __UP_DEVICE_CSR_H__ */ -- --- -2.29.2 - - -From 64582256a8c75127c3de23f5542c8467e2e9484a Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 19 Jan 2021 13:31:25 +0100 -Subject: [PATCH 2/2] build: Remove libusb dependency in Linux - -As the last user, the CSR support code, was removed. ---- - configure.ac | 1 - - src/Makefile.am | 2 -- - src/linux/Makefile.am | 1 - - 3 files changed, 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 5f08d91..9db579f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -199,7 +199,6 @@ AC_SUBST(BACKEND, "$with_backend") - have_idevice=no - if test x$with_backend = xlinux; then - PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= 147]) -- PKG_CHECK_MODULES(USB, [libusb-1.0 >= 1.0.0]) - AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]), - with_idevice=$withval,with_idevice=yes) - LIBPLIST_DEP=libplist -diff --git a/src/Makefile.am b/src/Makefile.am -index 3400139..81f5566 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -69,7 +69,6 @@ upowerd_CPPFLAGS = \ - - upowerd_LDADD = \ - -lm \ -- $(USB_LIBS) \ - $(GIO_LIBS) \ - $(GIO_UNIX_LIBS) \ - $(UPOWER_LIBS) -@@ -94,7 +93,6 @@ endif - if BACKEND_TYPE_LINUX - upowerd_LDADD += \ - linux/libupshared.la \ -- $(USB_LIBS) \ - $(GUDEV_LIBS) \ - $(IDEVICE_LIBS) \ - $(NULL) -diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am -index 82f60fd..5f3475d 100644 ---- a/src/linux/Makefile.am -+++ b/src/linux/Makefile.am -@@ -7,7 +7,6 @@ AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"UPower-Linux\" \ - -DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \ - -I$(top_srcdir)/libupower-glib \ -- $(USB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(GIO_UNIX_CFLAGS) \ - $(GUDEV_CFLAGS) \ --- -2.29.2 - diff --git a/upower.spec b/upower.spec index 288a8e2..cb878a9 100644 --- a/upower.spec +++ b/upower.spec @@ -1,15 +1,11 @@ %global commit 93cfe7c8d66ed486001c4f3f55399b7a Summary: Power Management Service Name: upower -Version: 0.99.11 -Release: 10%{?dist} +Version: 0.99.12 +Release: 1%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ -Source0: https://gitlab.freedesktop.org/upower/upower/uploads/%{commit}/%{name}-%{version}.tar.xz - -Patch0: 0001-linux-Add-support-for-iPhone-XR-XS-models.patch -Patch1: 0001-build-Use-a-newer-libplist-if-available.patch -Patch2: upower-no-usb-dep.patch +Source0: https://gitlab.freedesktop.org/upower/upower/uploads/244f5966c58773bbd3b4c507c549560f/upower-0.99.12.tar.xz BuildRequires: make BuildRequires: sqlite-devel @@ -127,6 +123,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Thu Jun 17 2021 Bastien Nocera - 0.99.12-1 ++ upower-0.99.12-1 +- Update to 0.99.12 + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.99.11-10 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. From aa1546dd8fec4ccbc412059a1c9330cbae2fafe7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 20:06:31 +0000 Subject: [PATCH 22/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index cb878a9..75ff920 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.12 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/244f5966c58773bbd3b4c507c549560f/upower-0.99.12.tar.xz @@ -123,6 +123,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 0.99.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Thu Jun 17 2021 Bastien Nocera - 0.99.12-1 + upower-0.99.12-1 - Update to 0.99.12 From 6a516b6bb644c0544299ce3cb17bce1fcc23f148 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 17 Aug 2021 17:32:20 +0200 Subject: [PATCH 23/64] + upower-0.99.13-1 Update to 0.99.13 --- .gitignore | 1 + sources | 2 +- upower.spec | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a6d69d3..68fae3e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.10.tar.xz /upower-0.99.11.tar.xz /upower-0.99.12.tar.xz +/upower-0.99.13.tar.xz diff --git a/sources b/sources index 346234f..d9ecba3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.12.tar.xz) = 9858a0e5f65271522cc5f36b0cd8722a5fb3effba37dbc5b22f08606701d4242ee54329d07460768004a24dc42705a84140ac6d9691afb7f09584b2e61fe3413 +SHA512 (upower-0.99.13.tar.xz) = 5e72d3a67060e3053bc0753b5a2ab3b5fc5bc5e9d6e32165286c7d4c97d23441ef7c095af3af7a6f1f59841e63c1d46b2d90681abad22eb442047bd628d859d2 diff --git a/upower.spec b/upower.spec index 75ff920..4fa1fb5 100644 --- a/upower.spec +++ b/upower.spec @@ -1,11 +1,11 @@ %global commit 93cfe7c8d66ed486001c4f3f55399b7a Summary: Power Management Service Name: upower -Version: 0.99.12 -Release: 2%{?dist} +Version: 0.99.13 +Release: 1%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ -Source0: https://gitlab.freedesktop.org/upower/upower/uploads/244f5966c58773bbd3b4c507c549560f/upower-0.99.12.tar.xz +Source0: https://gitlab.freedesktop.org/upower/upower/uploads/177df5b9f9b76f25a2ad9da41aa0c1fa/upower-0.99.13.tar.xz BuildRequires: make BuildRequires: sqlite-devel @@ -123,6 +123,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Tue Aug 17 2021 Bastien Nocera - 0.99.13-1 ++ upower-0.99.13-1 +- Update to 0.99.13 + * Fri Jul 23 2021 Fedora Release Engineering - 0.99.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From ab89b54d2b837a91b88b0ccef625baabcdab962d Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 23 Aug 2021 14:54:49 +0200 Subject: [PATCH 24/64] Add python3-packaging dependency to tests This is needed for an added version check that was added. Related: #1994639 --- tests/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tests.yml b/tests/tests.yml index 627611a..2cc14ca 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,6 +13,7 @@ - pygobject3-devel - python3-dbus - python3-dbusmock + - python3-packaging - umockdev-devel tests: - smoke: From 6ab0fb10132f740aae98871438aa08d855342e93 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 23 Aug 2021 16:28:02 +0200 Subject: [PATCH 25/64] Add git-core to tests dependency This is required to unpack the sources. --- tests/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tests.yml b/tests/tests.yml index 2cc14ca..cdee703 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -4,6 +4,8 @@ - role: standard-test-source tags: - always + required_packages: + - git-core - role: standard-test-basic tags: - atomic From 7195162ccb8ff75d5fedcf8be43a5f477becb0bb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 03:35:30 +0000 Subject: [PATCH 26/64] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- upower.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index 4fa1fb5..544b74a 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.13 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/upower/uploads/177df5b9f9b76f25a2ad9da41aa0c1fa/upower-0.99.13.tar.xz @@ -123,6 +123,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 0.99.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Aug 17 2021 Bastien Nocera - 0.99.13-1 + upower-0.99.13-1 - Update to 0.99.13 From 996c754c319535d5198a1709d3ebac5dd82bcba2 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 7 Feb 2022 10:52:48 +0100 Subject: [PATCH 27/64] + upower-0.99.14-1 Update to 0.99.14 --- .gitignore | 1 + build-fixes.patch | 100 ++++++++++++++++++++++++++++++++++++++++++++++ sources | 2 +- upower.spec | 39 ++++++++---------- 4 files changed, 119 insertions(+), 23 deletions(-) create mode 100644 build-fixes.patch diff --git a/.gitignore b/.gitignore index 68fae3e..49d28be 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.11.tar.xz /upower-0.99.12.tar.xz /upower-0.99.13.tar.xz +/upower-v0.99.14.tar.bz2 diff --git a/build-fixes.patch b/build-fixes.patch new file mode 100644 index 0000000..f1618cf --- /dev/null +++ b/build-fixes.patch @@ -0,0 +1,100 @@ +From 8eb8ab1056e03b68634098b754c89c5a99f33c5c Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Sat, 5 Feb 2022 02:26:48 +0000 +Subject: [PATCH 1/2] build: Fix default udevrulesdir + +We need to append 'rules.d' to the udev_dir. +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index f87de19..3858cbe 100644 +--- a/meson.build ++++ b/meson.build +@@ -90,7 +90,7 @@ endif + udevrulesdir = get_option('udevrulesdir') + if udevrulesdir == 'auto' + udev_dep = dependency('udev', required: true) +- udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') ++ udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') / 'rules.d' + endif + + dbusdir = get_option('datadir') / 'dbus-1' +-- +2.34.1 + + +From 1dc74629ff24a2121f17f6e38b2c8067be0b7182 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Sat, 5 Feb 2022 02:30:52 +0000 +Subject: [PATCH 2/2] build: Fix version macros + +The project version is a string. We need to split it into an array of +version components. +--- + libupower-glib/meson.build | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/libupower-glib/meson.build b/libupower-glib/meson.build +index 1bab59b..2ff7baf 100644 +--- a/libupower-glib/meson.build ++++ b/libupower-glib/meson.build +@@ -1,7 +1,12 @@ ++version_arr = meson.project_version().split('.') ++major_version = version_arr[0].to_int() ++minor_version = version_arr[1].to_int() ++micro_version = version_arr[2].to_int() ++ + cdata = configuration_data() +-cdata.set('UP_MAJOR_VERSION', meson.project_version()[0]) +-cdata.set('UP_MINOR_VERSION', meson.project_version()[1]) +-cdata.set('UP_MICRO_VERSION', meson.project_version()[2]) ++cdata.set('UP_MAJOR_VERSION', major_version) ++cdata.set('UP_MINOR_VERSION', minor_version) ++cdata.set('UP_MICRO_VERSION', micro_version) + + up_version_h = configure_file( + output: 'up-version.h', +-- +2.34.1 + +From 7660d6d8850e37db8c7f0d06316a82e956e89e81 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 7 Feb 2022 11:09:21 +0100 +Subject: [PATCH] build: Fix missing libm link on some platforms + +This should fix the PPC64 and ARMv7 builds. +--- + meson.build | 1 + + src/meson.build | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index c612953..be7658a 100644 +--- a/meson.build ++++ b/meson.build +@@ -45,6 +45,7 @@ glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version) + gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version) + gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version) + gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version) ++m_dep = cc.find_library('m', required: true) + + xsltproc = find_program('xsltproc', required: get_option('gtk-doc') or get_option('man')) + +diff --git a/src/meson.build b/src/meson.build +index d0d8141..406f9cb 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -6,7 +6,7 @@ upowerd_deps = declare_dependency( + include_directories('../dbus'), + ], + dependencies: [ +- glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep ++ m_dep, glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep + ], + compile_args: [ + '-DUP_COMPILATION', +-- +2.34.1 + diff --git a/sources b/sources index d9ecba3..facb430 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-0.99.13.tar.xz) = 5e72d3a67060e3053bc0753b5a2ab3b5fc5bc5e9d6e32165286c7d4c97d23441ef7c095af3af7a6f1f59841e63c1d46b2d90681abad22eb442047bd628d859d2 +SHA512 (upower-v0.99.14.tar.bz2) = 8682528afb2af968a34bcde718ac53596ae04d1324b4aef98592799a506e69e17aa457887a4fbf2f4950ae9ee7c6b5519f32ec01b965142b7eed6750007f7158 diff --git a/upower.spec b/upower.spec index 544b74a..f5a63db 100644 --- a/upower.spec +++ b/upower.spec @@ -1,16 +1,16 @@ %global commit 93cfe7c8d66ed486001c4f3f55399b7a Summary: Power Management Service Name: upower -Version: 0.99.13 -Release: 2%{?dist} +Version: 0.99.14 +Release: 1%{?dist} License: GPLv2+ URL: http://upower.freedesktop.org/ -Source0: https://gitlab.freedesktop.org/upower/upower/uploads/177df5b9f9b76f25a2ad9da41aa0c1fa/upower-0.99.13.tar.xz +Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 +Patch0: build-fixes.patch -BuildRequires: make +BuildRequires: meson BuildRequires: sqlite-devel BuildRequires: git -BuildRequires: libtool BuildRequires: gettext BuildRequires: libgudev1-devel %ifnarch s390 s390x @@ -22,10 +22,6 @@ BuildRequires: glib2-devel >= 2.6.0 BuildRequires: gobject-introspection-devel BuildRequires: gtk-doc BuildRequires: systemd -# Only required while we're patching configure.ac -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: gettext-devel Requires: udev Requires: gobject-introspection @@ -55,24 +51,21 @@ BuildArch: noarch Developer documentation for for libupower-glib. %prep -%autosetup -p1 -S git +%autosetup -n %{name}-v%{version} -p1 -S git %build -autoreconf -i -%configure \ - --enable-gtk-doc \ - --disable-static \ - --enable-introspection \ +%meson \ + -Dman=true \ + -Dgtk-doc=true \ + -Dintrospection=enabled \ %ifarch s390 s390x - --with-backend=dummy + -Dos_backend=dummy %endif -# Disable SMP build, fails to build docs -make +%meson_build %install -make install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +%meson_install %find_lang upower @@ -93,9 +86,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %doc NEWS AUTHORS HACKING README %{_libdir}/libupower-glib.so.* %{_datadir}/dbus-1/system.d/*.conf -%ifnarch s390 s390x %{_udevrulesdir}/*.rules -%endif %ghost %dir %{_localstatedir}/lib/upower %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf @@ -123,6 +114,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Mon Feb 07 2022 Bastien Nocera - 0.99.14-1 ++ upower-0.99.14-1 +- Update to 0.99.14 + * Sat Jan 22 2022 Fedora Release Engineering - 0.99.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 0d63374acd3bb6aeaa64aeb77cf49e131d953f37 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 16:02:08 +0200 Subject: [PATCH 28/64] Convert to rpmautospec --- changelog | 284 +++++++++++++++++++++++++++++++++++++++++++++++++++ upower.spec | 287 +--------------------------------------------------- 2 files changed, 286 insertions(+), 285 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..0e7ffd0 --- /dev/null +++ b/changelog @@ -0,0 +1,284 @@ +* Mon Feb 07 2022 Bastien Nocera - 0.99.14-1 ++ upower-0.99.14-1 +- Update to 0.99.14 + +* Sat Jan 22 2022 Fedora Release Engineering - 0.99.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Aug 17 2021 Bastien Nocera - 0.99.13-1 ++ upower-0.99.13-1 +- Update to 0.99.13 + +* Fri Jul 23 2021 Fedora Release Engineering - 0.99.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 17 2021 Bastien Nocera - 0.99.12-1 ++ upower-0.99.12-1 +- Update to 0.99.12 + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.99.11-10 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Wed Jan 27 2021 Fedora Release Engineering - 0.99.11-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jan 19 2021 Bastien Nocera - 0.99.11-8 ++ upower-0.99.11-8 +- Remove USB dependency + +* Tue Nov 24 2020 Bastien Nocera - 0.99.11-7 ++ upower-0.99.11-7 +- Disable libimobiledevice integration on RHEL + +* Wed Jul 29 2020 Fedora Release Engineering - 0.99.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jun 17 2020 Bastien Nocera - 0.99.11-5 ++ upower-0.99.11-5 +- Use upstreamed libplist patch +- Add support for iPhone XS,XR + +* Tue Jun 16 2020 Adam Williamson - 0.99.11-4 +- Fix imobiledevice support with new libplist, rebuild for soname bumps + +* Fri Jan 31 2020 Fedora Release Engineering - 0.99.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Sep 4 2019 Christian Kellner - 0.99.11-2 +- Add systemd service snippets +- Use macros for _unitdir and _udevrulesdir +- Mark _datadir/gtk-doc as directory + +* Tue Sep 3 2019 Christian Kellner - 0.99.11-1 +- New upstream release 0.99.11 +- Intltool has been replaced by gettext +- D-Bus configuration moved from sysconfdir to datadir +- Systemd is creating /var/lib/upower, so 'ghost' the dir + +* Sat Jul 27 2019 Fedora Release Engineering - 0.99.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Feb 20 2019 Christian Kellner - 0.99.10-1 +- New upstream release with the following changes: +- Set 'pending-charge' for DisplayDevice if at least one battery is in + the 'pending-charge' state +- Map pending-charge to fully-charged when charge is 100% + +* Sun Feb 03 2019 Fedora Release Engineering - 0.99.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Nov 20 2018 Christian Kellner - 0.99.9-1 +- New upstream release +- Drop unneccessary patch to fix udev events access +- Fix daemon lockdown issues (keyboard backlight, AC status changes) +- Out-of-tree build fixes and documentation fixes + +* Sun Oct 07 2018 Kalev Lember - 0.99.8-3 +- Backport an upstream fix for upower not having access to udev events + +* Sat Jul 14 2018 Fedora Release Engineering - 0.99.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Bastien Nocera - 0.99.8-1 ++ upower-0.99.8-1 +- Update to 0.99.8 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.99.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 0.99.7-2 +- Switch to %%ldconfig_scriptlets + +* Tue Nov 28 2017 Bastien Nocera - 0.99.7-1 ++ upower-0.99.7-1 +- Update to 0.99.7 +- Add Bluetooth LE battery support +- Fix critical action after resume from hibernate + +* Mon Sep 11 2017 Richard Hughes - 0.99.6-1 +- New upstream release +- Detect joysticks as gaming input devices +- Fix crash when '@' is present in the device name +- Grab the model name from device if unavailable from battery + +* Thu Aug 24 2017 Benjamin Berg - 0.99.5-4 +- Add patch to not correctly close the inhibitor FD + +* Thu Aug 03 2017 Fedora Release Engineering - 0.99.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.99.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 24 2017 Richard Hughes - 0.99.5-1 +- New upstream release +- Add BatteryLevel property for devices with a finite number of power levels +- Add support for pausing and resuming of the daemon poll +- Do not spin in a loop when /proc/timer_stats cannot be written +- Fix reading and writing the keyboard brightness level +- Get a serial number for device batteries +- Refresh devices after waking up from sleep +- Lower initial power usage when iDevice isn't accessible + +* Tue Feb 14 2017 Dan Horák - 0.99.4-4 +- Add explicit BR:systemd to fix s390(x) build + +* Sat Feb 11 2017 Fedora Release Engineering - 0.99.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Mar 14 2016 Bastien Nocera 0.99.4-2 +- Fix getting the critical action + +* Tue Feb 16 2016 Richard Hughes - 0.99.4-1 +- New upstream release +- Add support for Logitech G700s/G700 Gaming Mouse +- Change the default low battery policy to percentage + +* Fri Feb 05 2016 Fedora Release Engineering - 0.99.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jun 19 2015 Fedora Release Engineering - 0.99.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu May 28 2015 Richard Hughes - 0.99.3-1 +- New upstream release +- Fix several crashes +- Properly detect bluetooth mice and keyboards that are HID devices +- Support Logitech Unifying in Linux 3.19 +- Work-around broken battery on the Onda v975w + +* Wed Mar 18 2015 Rex Dieter - 0.99.2-4 +- pull in upstream crash fix (#1128390) +- use %%autosetup +- -devel: tighten subpkg dep via %%_isa +- -devel-docs: fix Summary + +* Sat Feb 21 2015 Till Maas - 0.99.2-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Wed Feb 11 2015 Peter Robinson 0.99.2-2 +- Rebuild (libimobiledevice) +- Use %%license + +* Thu Dec 18 2014 Richard Hughes - 0.99.2-1 +- New upstream release +- Fix various memory and reference leaks +- Respect the CriticalPowerAction config option +- Set update-time on the aggregate device +- Update display device when battery is removed + +* Sun Nov 16 2014 Kalev Lember - 0.99.1-3 +- Obsolete compat-upower09 from rhughes-f20-gnome-3-12 copr + +* Wed Oct 15 2014 Peter Robinson 0.99.1-2 +- Rebuild for libimobiledevice 1.1.7 + +* Mon Aug 18 2014 Richard Hughes - 0.99.1-1 +- New upstream release +- Create the history directory at runtime +- Do not log a critical warning when using _set_object_path_sync() +- Fix API doc for up_client_get_on_battery() +- Fix possible UpHistoryItem leak on failure +- Fix segfault on getting property when daemon is not running +- Fix shutdown on boot on some machines +- Fix small memleak on startup with Logitech devices +- Free the obtained device list array after use +- Remove IsDocked property +- Remove unused polkit dependency + +* Mon Aug 18 2014 Fedora Release Engineering - 0.99.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Jul 22 2014 Kalev Lember - 0.99.0-6 +- Rebuilt for gobject-introspection 1.41.4 + +* Sun Jun 08 2014 Fedora Release Engineering - 0.99.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 5 2014 Peter Robinson 0.99.0-4 +- Rebuild for libimobiledevice 1.1.6 + +* Mon Mar 17 2014 Richard Hughes - 0.99.0-3 +- Split out a new devel-docs subpackage to fix multilib_policy=all installs. +- Resolves: #1070661 + +* Fri Nov 08 2013 Bastien Nocera 0.99.0-2 +- Fix crash when D-Bus isn't available + +* Tue Oct 29 2013 Richard Hughes - 0.99.0-1 +- New upstream release +- This version contains major API changes and bumps library soname. +- Add DisplayDevice composite battery +- Add WarningLevel and IconName properties to all devices +- Clamp percentage for overfull batteries +- Emit PropertiesChanged signals +- Enforce critical battery policy on the daemon side +- Reduce client-side and daemon-side wake-ups +- Register objects on the bus once they've been setup +- Remove DeviceChanged and Changed signals +- Remove OnLowBattery property (use WarningLevel instead) +- Remove QoS support +- Remove battery recall support + +* Fri Oct 18 2013 Richard Hughes - 0.9.23-1 +- New upstream release +- Add missing dbus-glib-1 to private requires +- Avoid trying to close fd that wasn't opened +- Disable Watts-Up devices by default +- Don't guess discharging state for devices +- Fix crasher calling _about_to_sleep_sync() +- Really don't overwrite retval with prop values +- Update and correct Toshiba recall list + +* Wed Oct 09 2013 Bastien Nocera 0.9.22-1 +- Update to 0.9.22 +- Fixes incorrect reporting of some properties +- Fixes battery values for Logitech unifying devices +- Bluetooth input devices support +- Device name fixes + +* Fri Jul 26 2013 Richard Hughes - 0.9.21-1 +- New upstream release +- Add support for Logitech Wireless (NonUnifying) devices +- Allow clients to call org.freedesktop.DBus.Peer +- Update the upower man page with all the current options +- Use PIE to better secure installed tools and also use full RELRO in the daemon + +* Thu Apr 25 2013 Matthias Clasen - 0.9.20-3 +- Enabled hardened build +- Don't use /lib/udev in file paths + +* Tue Mar 19 2013 Matthias Clasen - 0.9.20-2 +- Rebuild + +* Mon Mar 11 2013 Richard Hughes - 0.9.20-1 +- New upstream release +- Add a --enable-deprecated configure argument to remove pm-utils support +- Deprecate running the powersave scripts +- Factor out the Logitech Unifying support to support other devices +- Require unfixed applications to define UPOWER_ENABLE_DEPRECATED +- Fix batteries which report current energy but full charge +- Fix several small memory leaks + +* Fri Feb 15 2013 Fedora Release Engineering - 0.9.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jan 02 2013 Richard Hughes - 0.9.19-1 +- New upstream release +- Add a Documentation tag to the service file +- Add support for Logitech Unifying devices +- Do not continue to poll if /proc/timer_stats is not readable +- Fix device matching for recent kernels +- Resolves: #848521 + +* Wed Oct 24 2012 Dan Horák - 0.9.18-2 +- the notify-upower script is not installed with dummy backend on s390(x) + +* Wed Aug 08 2012 Richard Hughes - 0.9.18-1 +- New upstream release +- Use systemd for suspend and hibernate + +* Sun Jul 22 2012 Fedora Release Engineering - 0.9.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/upower.spec b/upower.spec index f5a63db..2ca89a9 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.14 -Release: 1%{?dist} +Release: %autorelease License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 @@ -114,287 +114,4 @@ Developer documentation for for libupower-glib. %{_datadir}/gtk-doc/html/UPower/* %changelog -* Mon Feb 07 2022 Bastien Nocera - 0.99.14-1 -+ upower-0.99.14-1 -- Update to 0.99.14 - -* Sat Jan 22 2022 Fedora Release Engineering - 0.99.13-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Aug 17 2021 Bastien Nocera - 0.99.13-1 -+ upower-0.99.13-1 -- Update to 0.99.13 - -* Fri Jul 23 2021 Fedora Release Engineering - 0.99.12-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Thu Jun 17 2021 Bastien Nocera - 0.99.12-1 -+ upower-0.99.12-1 -- Update to 0.99.12 - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.99.11-10 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Wed Jan 27 2021 Fedora Release Engineering - 0.99.11-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Jan 19 2021 Bastien Nocera - 0.99.11-8 -+ upower-0.99.11-8 -- Remove USB dependency - -* Tue Nov 24 2020 Bastien Nocera - 0.99.11-7 -+ upower-0.99.11-7 -- Disable libimobiledevice integration on RHEL - -* Wed Jul 29 2020 Fedora Release Engineering - 0.99.11-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jun 17 2020 Bastien Nocera - 0.99.11-5 -+ upower-0.99.11-5 -- Use upstreamed libplist patch -- Add support for iPhone XS,XR - -* Tue Jun 16 2020 Adam Williamson - 0.99.11-4 -- Fix imobiledevice support with new libplist, rebuild for soname bumps - -* Fri Jan 31 2020 Fedora Release Engineering - 0.99.11-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Wed Sep 4 2019 Christian Kellner - 0.99.11-2 -- Add systemd service snippets -- Use macros for _unitdir and _udevrulesdir -- Mark _datadir/gtk-doc as directory - -* Tue Sep 3 2019 Christian Kellner - 0.99.11-1 -- New upstream release 0.99.11 -- Intltool has been replaced by gettext -- D-Bus configuration moved from sysconfdir to datadir -- Systemd is creating /var/lib/upower, so 'ghost' the dir - -* Sat Jul 27 2019 Fedora Release Engineering - 0.99.10-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Feb 20 2019 Christian Kellner - 0.99.10-1 -- New upstream release with the following changes: -- Set 'pending-charge' for DisplayDevice if at least one battery is in - the 'pending-charge' state -- Map pending-charge to fully-charged when charge is 100% - -* Sun Feb 03 2019 Fedora Release Engineering - 0.99.9-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Nov 20 2018 Christian Kellner - 0.99.9-1 -- New upstream release -- Drop unneccessary patch to fix udev events access -- Fix daemon lockdown issues (keyboard backlight, AC status changes) -- Out-of-tree build fixes and documentation fixes - -* Sun Oct 07 2018 Kalev Lember - 0.99.8-3 -- Backport an upstream fix for upower not having access to udev events - -* Sat Jul 14 2018 Fedora Release Engineering - 0.99.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Bastien Nocera - 0.99.8-1 -+ upower-0.99.8-1 -- Update to 0.99.8 - -* Fri Feb 09 2018 Fedora Release Engineering - 0.99.7-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Feb 03 2018 Igor Gnatenko - 0.99.7-2 -- Switch to %%ldconfig_scriptlets - -* Tue Nov 28 2017 Bastien Nocera - 0.99.7-1 -+ upower-0.99.7-1 -- Update to 0.99.7 -- Add Bluetooth LE battery support -- Fix critical action after resume from hibernate - -* Mon Sep 11 2017 Richard Hughes - 0.99.6-1 -- New upstream release -- Detect joysticks as gaming input devices -- Fix crash when '@' is present in the device name -- Grab the model name from device if unavailable from battery - -* Thu Aug 24 2017 Benjamin Berg - 0.99.5-4 -- Add patch to not correctly close the inhibitor FD - -* Thu Aug 03 2017 Fedora Release Engineering - 0.99.5-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 0.99.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Mon Jul 24 2017 Richard Hughes - 0.99.5-1 -- New upstream release -- Add BatteryLevel property for devices with a finite number of power levels -- Add support for pausing and resuming of the daemon poll -- Do not spin in a loop when /proc/timer_stats cannot be written -- Fix reading and writing the keyboard brightness level -- Get a serial number for device batteries -- Refresh devices after waking up from sleep -- Lower initial power usage when iDevice isn't accessible - -* Tue Feb 14 2017 Dan Horák - 0.99.4-4 -- Add explicit BR:systemd to fix s390(x) build - -* Sat Feb 11 2017 Fedora Release Engineering - 0.99.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Mar 14 2016 Bastien Nocera 0.99.4-2 -- Fix getting the critical action - -* Tue Feb 16 2016 Richard Hughes - 0.99.4-1 -- New upstream release -- Add support for Logitech G700s/G700 Gaming Mouse -- Change the default low battery policy to percentage - -* Fri Feb 05 2016 Fedora Release Engineering - 0.99.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Jun 19 2015 Fedora Release Engineering - 0.99.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Thu May 28 2015 Richard Hughes - 0.99.3-1 -- New upstream release -- Fix several crashes -- Properly detect bluetooth mice and keyboards that are HID devices -- Support Logitech Unifying in Linux 3.19 -- Work-around broken battery on the Onda v975w - -* Wed Mar 18 2015 Rex Dieter - 0.99.2-4 -- pull in upstream crash fix (#1128390) -- use %%autosetup -- -devel: tighten subpkg dep via %%_isa -- -devel-docs: fix Summary - -* Sat Feb 21 2015 Till Maas - 0.99.2-3 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Wed Feb 11 2015 Peter Robinson 0.99.2-2 -- Rebuild (libimobiledevice) -- Use %%license - -* Thu Dec 18 2014 Richard Hughes - 0.99.2-1 -- New upstream release -- Fix various memory and reference leaks -- Respect the CriticalPowerAction config option -- Set update-time on the aggregate device -- Update display device when battery is removed - -* Sun Nov 16 2014 Kalev Lember - 0.99.1-3 -- Obsolete compat-upower09 from rhughes-f20-gnome-3-12 copr - -* Wed Oct 15 2014 Peter Robinson 0.99.1-2 -- Rebuild for libimobiledevice 1.1.7 - -* Mon Aug 18 2014 Richard Hughes - 0.99.1-1 -- New upstream release -- Create the history directory at runtime -- Do not log a critical warning when using _set_object_path_sync() -- Fix API doc for up_client_get_on_battery() -- Fix possible UpHistoryItem leak on failure -- Fix segfault on getting property when daemon is not running -- Fix shutdown on boot on some machines -- Fix small memleak on startup with Logitech devices -- Free the obtained device list array after use -- Remove IsDocked property -- Remove unused polkit dependency - -* Mon Aug 18 2014 Fedora Release Engineering - 0.99.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Tue Jul 22 2014 Kalev Lember - 0.99.0-6 -- Rebuilt for gobject-introspection 1.41.4 - -* Sun Jun 08 2014 Fedora Release Engineering - 0.99.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Mon May 5 2014 Peter Robinson 0.99.0-4 -- Rebuild for libimobiledevice 1.1.6 - -* Mon Mar 17 2014 Richard Hughes - 0.99.0-3 -- Split out a new devel-docs subpackage to fix multilib_policy=all installs. -- Resolves: #1070661 - -* Fri Nov 08 2013 Bastien Nocera 0.99.0-2 -- Fix crash when D-Bus isn't available - -* Tue Oct 29 2013 Richard Hughes - 0.99.0-1 -- New upstream release -- This version contains major API changes and bumps library soname. -- Add DisplayDevice composite battery -- Add WarningLevel and IconName properties to all devices -- Clamp percentage for overfull batteries -- Emit PropertiesChanged signals -- Enforce critical battery policy on the daemon side -- Reduce client-side and daemon-side wake-ups -- Register objects on the bus once they've been setup -- Remove DeviceChanged and Changed signals -- Remove OnLowBattery property (use WarningLevel instead) -- Remove QoS support -- Remove battery recall support - -* Fri Oct 18 2013 Richard Hughes - 0.9.23-1 -- New upstream release -- Add missing dbus-glib-1 to private requires -- Avoid trying to close fd that wasn't opened -- Disable Watts-Up devices by default -- Don't guess discharging state for devices -- Fix crasher calling _about_to_sleep_sync() -- Really don't overwrite retval with prop values -- Update and correct Toshiba recall list - -* Wed Oct 09 2013 Bastien Nocera 0.9.22-1 -- Update to 0.9.22 -- Fixes incorrect reporting of some properties -- Fixes battery values for Logitech unifying devices -- Bluetooth input devices support -- Device name fixes - -* Fri Jul 26 2013 Richard Hughes - 0.9.21-1 -- New upstream release -- Add support for Logitech Wireless (NonUnifying) devices -- Allow clients to call org.freedesktop.DBus.Peer -- Update the upower man page with all the current options -- Use PIE to better secure installed tools and also use full RELRO in the daemon - -* Thu Apr 25 2013 Matthias Clasen - 0.9.20-3 -- Enabled hardened build -- Don't use /lib/udev in file paths - -* Tue Mar 19 2013 Matthias Clasen - 0.9.20-2 -- Rebuild - -* Mon Mar 11 2013 Richard Hughes - 0.9.20-1 -- New upstream release -- Add a --enable-deprecated configure argument to remove pm-utils support -- Deprecate running the powersave scripts -- Factor out the Logitech Unifying support to support other devices -- Require unfixed applications to define UPOWER_ENABLE_DEPRECATED -- Fix batteries which report current energy but full charge -- Fix several small memory leaks - -* Fri Feb 15 2013 Fedora Release Engineering - 0.9.19-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Wed Jan 02 2013 Richard Hughes - 0.9.19-1 -- New upstream release -- Add a Documentation tag to the service file -- Add support for Logitech Unifying devices -- Do not continue to poll if /proc/timer_stats is not readable -- Fix device matching for recent kernels -- Resolves: #848521 - -* Wed Oct 24 2012 Dan Horák - 0.9.18-2 -- the notify-upower script is not installed with dummy backend on s390(x) - -* Wed Aug 08 2012 Richard Hughes - 0.9.18-1 -- New upstream release -- Use systemd for suspend and hibernate - -* Sun Jul 22 2012 Fedora Release Engineering - 0.9.17-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild +%autochangelog From 22139bfa249332a1a7c1411e2c8c8dd88ca2c597 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 16:02:36 +0200 Subject: [PATCH 29/64] Build linux backend on s390 This was disabled due to the lack of libusb1 in 2010. However, that is not a dependency anymore, and while imobiledevice is missing the configuration will be picked up automatically. --- upower.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/upower.spec b/upower.spec index 2ca89a9..6a59794 100644 --- a/upower.spec +++ b/upower.spec @@ -13,8 +13,10 @@ BuildRequires: sqlite-devel BuildRequires: git BuildRequires: gettext BuildRequires: libgudev1-devel +%define idevice disabled %ifnarch s390 s390x %if ! 0%{?rhel} +%define idevice enabled BuildRequires: libimobiledevice-devel %endif %endif @@ -55,12 +57,10 @@ Developer documentation for for libupower-glib. %build %meson \ + -Didevice=%{idevice} \ -Dman=true \ -Dgtk-doc=true \ - -Dintrospection=enabled \ -%ifarch s390 s390x - -Dos_backend=dummy -%endif + -Dintrospection=enabled %meson_build From d8423dc2fa4813a00e1a3e8bb41d1f2a7ab24b00 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 16:05:13 +0200 Subject: [PATCH 30/64] Remove ancient Obsoletes: line --- upower.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/upower.spec b/upower.spec index 6a59794..6d92612 100644 --- a/upower.spec +++ b/upower.spec @@ -28,10 +28,6 @@ BuildRequires: systemd Requires: udev Requires: gobject-introspection -%if 0%{?fedora} -# From rhughes-f20-gnome-3-12 copr -Obsoletes: compat-upower09 < 0.99 -%endif %description UPower (formerly DeviceKit-power) provides a daemon, API and command From 487bba4db1e0055eb6a2e4fb258b10eefceee03a Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 17:45:34 +0200 Subject: [PATCH 31/64] Remove unused commit global --- upower.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/upower.spec b/upower.spec index 6d92612..e2e0c3a 100644 --- a/upower.spec +++ b/upower.spec @@ -1,4 +1,3 @@ -%global commit 93cfe7c8d66ed486001c4f3f55399b7a Summary: Power Management Service Name: upower Version: 0.99.14 From 714d272ce9b527bacf3eca01f8f7061a74143e6d Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 17:45:58 +0200 Subject: [PATCH 32/64] Remove sqlite build dependency --- upower.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/upower.spec b/upower.spec index e2e0c3a..f92462b 100644 --- a/upower.spec +++ b/upower.spec @@ -8,7 +8,6 @@ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{versi Patch0: build-fixes.patch BuildRequires: meson -BuildRequires: sqlite-devel BuildRequires: git BuildRequires: gettext BuildRequires: libgudev1-devel From 32c353f8f580b340d47737f47eead693241c1e84 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 9 Jun 2022 18:18:01 +0200 Subject: [PATCH 33/64] Update to 0.99.19 Resolves: #2050327 Resolves: #2093607 --- .gitignore | 1 + 150.patch | 67 +++++++++++++++++++++++++++++++ build-fixes.patch | 100 ---------------------------------------------- sources | 2 +- upower.spec | 7 +++- 5 files changed, 74 insertions(+), 103 deletions(-) create mode 100644 150.patch delete mode 100644 build-fixes.patch diff --git a/.gitignore b/.gitignore index 49d28be..43825df 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.12.tar.xz /upower-0.99.13.tar.xz /upower-v0.99.14.tar.bz2 +/upower-v0.99.19.tar.bz2 diff --git a/150.patch b/150.patch new file mode 100644 index 0000000..a3b6c13 --- /dev/null +++ b/150.patch @@ -0,0 +1,67 @@ +From a78ee6039054770b466749f8ec4bfbe4c278d697 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Thu, 9 Jun 2022 12:38:34 +0200 +Subject: [PATCH] test: Properly wait for idle handler after uevents + +The state aggregation test requires an idle handler to run, which can be +a bit unreliable as it may or may not run twice. + +Force running it twice and add code to wait for it to complete. Do so +properly by waiting for the correct log messages rather than sleeping so +that everything is ordered nicely while not slowing down the test a lot. + +Closes: #193 +--- + src/linux/integration-test.py | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py +index d60453e..9523f28 100755 +--- a/src/linux/integration-test.py ++++ b/src/linux/integration-test.py +@@ -649,6 +649,8 @@ class Tests(dbusmock.DBusTestCase): + (TBD , CHARGING , DISCHARGING, TBD , TBD , P_CHARGE , ANY), + (ANY , CHARGING , DISCHARGING, ANY , ANY , ANY , ANY), + ] ++ ++ self.daemon_log.clear() + for i in range(len(states)): + for j in range(len(states)): + # The table should be mirrored +@@ -657,9 +659,19 @@ class Tests(dbusmock.DBusTestCase): + self.testbed.set_attribute(bat0, 'status', states[i]) + self.testbed.set_attribute(bat1, 'status', states[j]) + self.testbed.uevent(bat0, 'change') ++ # We can't guarantee that both uevents are processed without ++ # the idle handler running. So, lets wait for the idle handler ++ # to calculate the composite battery state. ++ self.daemon_log.check_line('Calculating percentage', timeout=2.0) + self.testbed.uevent(bat1, 'change') +- # The uevent can race with the DBus request +- time.sleep(0.5) ++ ++ if display_device_state[i][j] == CONFLICT: ++ self.daemon_log.check_line_re("Conflicting.*state", timeout=2.0) ++ else: ++ # TODO: Add a helper in OutputChecker to do this ++ lines = self.daemon_log.check_line('Calculating percentage', timeout=2.0) ++ for l in lines: ++ self.assertNotRegex(l, b"Conflicting.*state") + + if display_device_state[i][j] >= 0: + self.assertEqual(self.get_dbus_display_property('State'), display_device_state[i][j], +@@ -675,10 +687,7 @@ class Tests(dbusmock.DBusTestCase): + UP_DEVICE_STATE_PENDING_DISCHARGE), + msg=f"Invalid aggregate state for states {states[i]} and {states[j]}" + ) +- if display_device_state[i][j] == CONFLICT: +- self.daemon_log.check_line_re("Conflicting.*state") +- else: +- self.daemon_log.check_no_line_re("Conflicting.*state") ++ + self.stop_daemon() + + def test_map_pending_charge_to_fully_charged(self): +-- +GitLab + diff --git a/build-fixes.patch b/build-fixes.patch deleted file mode 100644 index f1618cf..0000000 --- a/build-fixes.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 8eb8ab1056e03b68634098b754c89c5a99f33c5c Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Sat, 5 Feb 2022 02:26:48 +0000 -Subject: [PATCH 1/2] build: Fix default udevrulesdir - -We need to append 'rules.d' to the udev_dir. ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index f87de19..3858cbe 100644 ---- a/meson.build -+++ b/meson.build -@@ -90,7 +90,7 @@ endif - udevrulesdir = get_option('udevrulesdir') - if udevrulesdir == 'auto' - udev_dep = dependency('udev', required: true) -- udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') -+ udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') / 'rules.d' - endif - - dbusdir = get_option('datadir') / 'dbus-1' --- -2.34.1 - - -From 1dc74629ff24a2121f17f6e38b2c8067be0b7182 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Sat, 5 Feb 2022 02:30:52 +0000 -Subject: [PATCH 2/2] build: Fix version macros - -The project version is a string. We need to split it into an array of -version components. ---- - libupower-glib/meson.build | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/libupower-glib/meson.build b/libupower-glib/meson.build -index 1bab59b..2ff7baf 100644 ---- a/libupower-glib/meson.build -+++ b/libupower-glib/meson.build -@@ -1,7 +1,12 @@ -+version_arr = meson.project_version().split('.') -+major_version = version_arr[0].to_int() -+minor_version = version_arr[1].to_int() -+micro_version = version_arr[2].to_int() -+ - cdata = configuration_data() --cdata.set('UP_MAJOR_VERSION', meson.project_version()[0]) --cdata.set('UP_MINOR_VERSION', meson.project_version()[1]) --cdata.set('UP_MICRO_VERSION', meson.project_version()[2]) -+cdata.set('UP_MAJOR_VERSION', major_version) -+cdata.set('UP_MINOR_VERSION', minor_version) -+cdata.set('UP_MICRO_VERSION', micro_version) - - up_version_h = configure_file( - output: 'up-version.h', --- -2.34.1 - -From 7660d6d8850e37db8c7f0d06316a82e956e89e81 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Mon, 7 Feb 2022 11:09:21 +0100 -Subject: [PATCH] build: Fix missing libm link on some platforms - -This should fix the PPC64 and ARMv7 builds. ---- - meson.build | 1 + - src/meson.build | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index c612953..be7658a 100644 ---- a/meson.build -+++ b/meson.build -@@ -45,6 +45,7 @@ glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version) - gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version) - gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version) - gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version) -+m_dep = cc.find_library('m', required: true) - - xsltproc = find_program('xsltproc', required: get_option('gtk-doc') or get_option('man')) - -diff --git a/src/meson.build b/src/meson.build -index d0d8141..406f9cb 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -6,7 +6,7 @@ upowerd_deps = declare_dependency( - include_directories('../dbus'), - ], - dependencies: [ -- glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep -+ m_dep, glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep - ], - compile_args: [ - '-DUP_COMPILATION', --- -2.34.1 - diff --git a/sources b/sources index facb430..7bafba7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v0.99.14.tar.bz2) = 8682528afb2af968a34bcde718ac53596ae04d1324b4aef98592799a506e69e17aa457887a4fbf2f4950ae9ee7c6b5519f32ec01b965142b7eed6750007f7158 +SHA512 (upower-v0.99.19.tar.bz2) = 1462a64bc642bd6c5c235742f5a8fa9e3440846d90061889b568fc0a91f7b24d56d1f5a3d33bff8d6d35f78aa8bc8c15f9c4a51a2cb40f1ee3b2a822ad60ca33 diff --git a/upower.spec b/upower.spec index f92462b..7abd0dd 100644 --- a/upower.spec +++ b/upower.spec @@ -1,11 +1,13 @@ Summary: Power Management Service Name: upower -Version: 0.99.14 +Version: 0.99.19 Release: %autorelease License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 -Patch0: build-fixes.patch + +# Pull fix for test race condition +Patch0: https://gitlab.freedesktop.org/upower/upower/-/merge_requests/150.patch BuildRequires: meson BuildRequires: git @@ -81,6 +83,7 @@ Developer documentation for for libupower-glib. %{_libdir}/libupower-glib.so.* %{_datadir}/dbus-1/system.d/*.conf %{_udevrulesdir}/*.rules +%{_udevhwdbdir}/*.hwdb %ghost %dir %{_localstatedir}/lib/upower %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf From 87e4ae4077900d4252d5e19ce83404e8504779b5 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 15 Jul 2022 11:42:59 +0200 Subject: [PATCH 34/64] Update to 0.99.20 Resolves: #2106841 --- .gitignore | 1 + 150.patch | 67 ----------------------------------------------------- sources | 2 +- upower.spec | 5 +--- 4 files changed, 3 insertions(+), 72 deletions(-) delete mode 100644 150.patch diff --git a/.gitignore b/.gitignore index 43825df..5e6ada9 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ upower-0.9.5.tar.bz2 /upower-0.99.13.tar.xz /upower-v0.99.14.tar.bz2 /upower-v0.99.19.tar.bz2 +/upower-v0.99.20.tar.bz2 diff --git a/150.patch b/150.patch deleted file mode 100644 index a3b6c13..0000000 --- a/150.patch +++ /dev/null @@ -1,67 +0,0 @@ -From a78ee6039054770b466749f8ec4bfbe4c278d697 Mon Sep 17 00:00:00 2001 -From: Benjamin Berg -Date: Thu, 9 Jun 2022 12:38:34 +0200 -Subject: [PATCH] test: Properly wait for idle handler after uevents - -The state aggregation test requires an idle handler to run, which can be -a bit unreliable as it may or may not run twice. - -Force running it twice and add code to wait for it to complete. Do so -properly by waiting for the correct log messages rather than sleeping so -that everything is ordered nicely while not slowing down the test a lot. - -Closes: #193 ---- - src/linux/integration-test.py | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py -index d60453e..9523f28 100755 ---- a/src/linux/integration-test.py -+++ b/src/linux/integration-test.py -@@ -649,6 +649,8 @@ class Tests(dbusmock.DBusTestCase): - (TBD , CHARGING , DISCHARGING, TBD , TBD , P_CHARGE , ANY), - (ANY , CHARGING , DISCHARGING, ANY , ANY , ANY , ANY), - ] -+ -+ self.daemon_log.clear() - for i in range(len(states)): - for j in range(len(states)): - # The table should be mirrored -@@ -657,9 +659,19 @@ class Tests(dbusmock.DBusTestCase): - self.testbed.set_attribute(bat0, 'status', states[i]) - self.testbed.set_attribute(bat1, 'status', states[j]) - self.testbed.uevent(bat0, 'change') -+ # We can't guarantee that both uevents are processed without -+ # the idle handler running. So, lets wait for the idle handler -+ # to calculate the composite battery state. -+ self.daemon_log.check_line('Calculating percentage', timeout=2.0) - self.testbed.uevent(bat1, 'change') -- # The uevent can race with the DBus request -- time.sleep(0.5) -+ -+ if display_device_state[i][j] == CONFLICT: -+ self.daemon_log.check_line_re("Conflicting.*state", timeout=2.0) -+ else: -+ # TODO: Add a helper in OutputChecker to do this -+ lines = self.daemon_log.check_line('Calculating percentage', timeout=2.0) -+ for l in lines: -+ self.assertNotRegex(l, b"Conflicting.*state") - - if display_device_state[i][j] >= 0: - self.assertEqual(self.get_dbus_display_property('State'), display_device_state[i][j], -@@ -675,10 +687,7 @@ class Tests(dbusmock.DBusTestCase): - UP_DEVICE_STATE_PENDING_DISCHARGE), - msg=f"Invalid aggregate state for states {states[i]} and {states[j]}" - ) -- if display_device_state[i][j] == CONFLICT: -- self.daemon_log.check_line_re("Conflicting.*state") -- else: -- self.daemon_log.check_no_line_re("Conflicting.*state") -+ - self.stop_daemon() - - def test_map_pending_charge_to_fully_charged(self): --- -GitLab - diff --git a/sources b/sources index 7bafba7..8cf5295 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v0.99.19.tar.bz2) = 1462a64bc642bd6c5c235742f5a8fa9e3440846d90061889b568fc0a91f7b24d56d1f5a3d33bff8d6d35f78aa8bc8c15f9c4a51a2cb40f1ee3b2a822ad60ca33 +SHA512 (upower-v0.99.20.tar.bz2) = 50e5b03f1319da3869b0caba4fbe78c8eabf1df6f783f1463b06394bee58bae42ad411780faa503965c5fdb983d723c0b5ae0731fae4220997a17875f4850b1e diff --git a/upower.spec b/upower.spec index 7abd0dd..6e72b0c 100644 --- a/upower.spec +++ b/upower.spec @@ -1,14 +1,11 @@ Summary: Power Management Service Name: upower -Version: 0.99.19 +Version: 0.99.20 Release: %autorelease License: GPLv2+ URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 -# Pull fix for test race condition -Patch0: https://gitlab.freedesktop.org/upower/upower/-/merge_requests/150.patch - BuildRequires: meson BuildRequires: git BuildRequires: gettext From 3234e68720804ff83be07729cdce0ddbecbb2b70 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 11:28:19 +0000 Subject: [PATCH 35/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering From fb62487adc60b7d770838f8edd342c70c1d3908f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 05:53:33 +0000 Subject: [PATCH 36/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 4e2e15c749db3432cdd292d7c403d5e9e6dc69fb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 19 Feb 2023 07:23:24 -0500 Subject: [PATCH 37/64] Separate libs package This is needed for flatpak builds of upower-dependent clients, which will communicate with the system upower service over D-Bus, to avoid pulling in systemd. --- upower.spec | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/upower.spec b/upower.spec index 6e72b0c..15bee75 100644 --- a/upower.spec +++ b/upower.spec @@ -22,24 +22,33 @@ BuildRequires: gobject-introspection-devel BuildRequires: gtk-doc BuildRequires: systemd +Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev -Requires: gobject-introspection %description UPower (formerly DeviceKit-power) provides a daemon, API and command line tools for managing power devices attached to the system. +%package libs +Summary: Client libraries for UPower +Requires: gobject-introspection +Recommends: %{name}%{?_isa} = %{version}-%{release} +Conflicts: %{name} < 0.99.20-4 + +%description libs +Client libraries for UPower. + %package devel Summary: Headers and libraries for UPower -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel Headers and libraries for UPower. %package devel-docs Summary: Developer documentation for for libupower-glib -Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} BuildArch: noarch %description devel-docs @@ -77,7 +86,6 @@ Developer documentation for for libupower-glib. %{!?_licensedir:%global license %%doc} %license COPYING %doc NEWS AUTHORS HACKING README -%{_libdir}/libupower-glib.so.* %{_datadir}/dbus-1/system.d/*.conf %{_udevrulesdir}/*.rules %{_udevhwdbdir}/*.hwdb @@ -86,13 +94,17 @@ Developer documentation for for libupower-glib. %config %{_sysconfdir}/UPower/UPower.conf %{_bindir}/* %{_libexecdir}/* -%{_libdir}/girepository-1.0/*.typelib %{_mandir}/man1/* %{_mandir}/man7/* %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service +%files libs +%license COPYING +%{_libdir}/libupower-glib.so.3{,.*} +%{_libdir}/girepository-1.0/*.typelib + %files devel %{_datadir}/dbus-1/interfaces/*.xml %{_libdir}/libupower-glib.so From 64880686f75af64f563aaf260eb14e4d8fa40a53 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 22 Feb 2023 09:38:07 +0000 Subject: [PATCH 38/64] migrated to SPDX license --- upower.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index 15bee75..5b0b2bc 100644 --- a/upower.spec +++ b/upower.spec @@ -2,7 +2,7 @@ Summary: Power Management Service Name: upower Version: 0.99.20 Release: %autorelease -License: GPLv2+ +License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 From dc5bf473a007ffe706a551ad7088ed92508adb9c Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 4 Jul 2023 16:33:32 +0200 Subject: [PATCH 39/64] Update to 1.90.1 --- .gitignore | 1 + sources | 2 +- upower.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5e6ada9..5fcb9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ upower-0.9.5.tar.bz2 /upower-v0.99.14.tar.bz2 /upower-v0.99.19.tar.bz2 /upower-v0.99.20.tar.bz2 +/upower-v1.90.1.tar.bz2 diff --git a/sources b/sources index 8cf5295..76e7e98 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v0.99.20.tar.bz2) = 50e5b03f1319da3869b0caba4fbe78c8eabf1df6f783f1463b06394bee58bae42ad411780faa503965c5fdb983d723c0b5ae0731fae4220997a17875f4850b1e +SHA512 (upower-v1.90.1.tar.bz2) = bc4698c032d894164e8fb9b38a5052116c14c9dd9104d27e493abb865b59343ccee2f335addabbc1e89ca698cc8126792137d3ed6e7cdd74d4787c0a53afb429 diff --git a/upower.spec b/upower.spec index 5b0b2bc..19506a7 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 0.99.20 +Version: 1.90.1 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ From 9a30f3c81b2e80edd4aa92221425cc24334cb554 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 6 Jul 2023 11:08:11 +0200 Subject: [PATCH 40/64] Update to 1.90.2 --- .gitignore | 1 + sources | 2 +- upower.spec | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5fcb9a8..a1763c2 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ upower-0.9.5.tar.bz2 /upower-v0.99.19.tar.bz2 /upower-v0.99.20.tar.bz2 /upower-v1.90.1.tar.bz2 +/upower-v1.90.2.tar.bz2 diff --git a/sources b/sources index 76e7e98..88378b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.1.tar.bz2) = bc4698c032d894164e8fb9b38a5052116c14c9dd9104d27e493abb865b59343ccee2f335addabbc1e89ca698cc8126792137d3ed6e7cdd74d4787c0a53afb429 +SHA512 (upower-v1.90.2.tar.bz2) = 9cdaea76d604e79bb385c2d7d8df26ab74d8fbbd5ddd271d7dc3323ae4f98ce9504ce807638e008869fdec0e1fcaf8d4be53e486714913616b8df73d8e4ac396 diff --git a/upower.spec b/upower.spec index 19506a7..2a5a39e 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.1 +Version: 1.90.2 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ @@ -99,6 +99,7 @@ Developer documentation for for libupower-glib. %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service +%{_datadir}/installed-tests/upower/upower-integration.test %files libs %license COPYING From e42dc557e67781a3c3b88a0cd6fc3007565fa281 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 17:11:38 +0000 Subject: [PATCH 41/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering From ef8cbd3e58d9dcb2bfd098899dc134b81f3b9dab Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Fri, 28 Jul 2023 17:32:17 -0500 Subject: [PATCH 42/64] Rebuilt for libimobiledevice and libplist soname bump Signed-off-by: Michel Alexandre Salim From 31479f0c50b2c89b3115541f68ffd2b5154af171 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 07:11:23 +0000 Subject: [PATCH 43/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From e0e40e7b029ac05b4d4e5174123f9af9b14d08ad Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Wed, 10 Apr 2024 16:13:17 +0100 Subject: [PATCH 44/64] Update to 1.90.4 --- .gitignore | 1 + sources | 2 +- upower.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a1763c2..40e4c7a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ upower-0.9.5.tar.bz2 /upower-v0.99.20.tar.bz2 /upower-v1.90.1.tar.bz2 /upower-v1.90.2.tar.bz2 +/upower-v1.90.4.tar.bz2 diff --git a/sources b/sources index 88378b4..b575fdb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.2.tar.bz2) = 9cdaea76d604e79bb385c2d7d8df26ab74d8fbbd5ddd271d7dc3323ae4f98ce9504ce807638e008869fdec0e1fcaf8d4be53e486714913616b8df73d8e4ac396 +SHA512 (upower-v1.90.4.tar.bz2) = 2db8f2fea4086939c7ec236674ddd03ff043eeb1c7e46deb40b45aed5d31b6eb0e84fa44f189336b0a171f3e2f92f2f50e2f355b9366e0d686e570d0107e88da diff --git a/upower.spec b/upower.spec index 2a5a39e..4dccc5a 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.2 +Version: 1.90.4 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ From a5f363789c19c372b9705718ed44c842d894559c Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 11 Jun 2024 16:38:10 +0800 Subject: [PATCH 45/64] Fix test dependency pygobject-devel is renamed to python3-gobject-base. --- tests/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.yml b/tests/tests.yml index cdee703..20dd538 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -12,7 +12,7 @@ - classic required_packages: - upower - - pygobject3-devel + - python3-gobject-base - python3-dbus - python3-dbusmock - python3-packaging From f4fe8b920144e6fa5c2a52f0910fd873c2ec9f75 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 08:20:35 +0000 Subject: [PATCH 46/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 4ef5b48c65a3a7a6c5b10394f6680016043ffcbe Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Sat, 14 Sep 2024 16:00:49 +0800 Subject: [PATCH 47/64] Updated to upstream release 1.90.5 - Support battery charging limit --- .gitignore | 1 + 0001-ci-Add-polkit-dependency.patch | 24 ++ 0002-Revert-Remove-polkit-tests.patch | 88 +++++++ ...nux-integration-test-Add-polkit-test.patch | 229 ++++++++++++++++++ ...up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch | 30 +++ ...-global-variable-and-remove-g_object.patch | 41 ++++ ...lace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch | 28 +++ sources | 2 +- upower.spec | 16 +- 9 files changed, 457 insertions(+), 2 deletions(-) create mode 100644 0001-ci-Add-polkit-dependency.patch create mode 100644 0002-Revert-Remove-polkit-tests.patch create mode 100644 0003-linux-integration-test-Add-polkit-test.patch create mode 100644 0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch create mode 100644 0008-up-polkit-remove-global-variable-and-remove-g_object.patch create mode 100644 0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch diff --git a/.gitignore b/.gitignore index 40e4c7a..632891e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.1.tar.bz2 /upower-v1.90.2.tar.bz2 /upower-v1.90.4.tar.bz2 +/upower-v1.90.5.tar.bz2 diff --git a/0001-ci-Add-polkit-dependency.patch b/0001-ci-Add-polkit-dependency.patch new file mode 100644 index 0000000..7f9ec8e --- /dev/null +++ b/0001-ci-Add-polkit-dependency.patch @@ -0,0 +1,24 @@ +From b26c8c79c9ff7fd0ba63e893171c6d5b164fda82 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Wed, 28 Aug 2024 13:29:41 +0800 +Subject: [PATCH 1/9] ci: Add polkit dependency + +--- + .gitlab-ci.yml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml +index fbdbd53..1476c85 100644 +--- a/.gitlab-ci.yml ++++ b/.gitlab-ci.yml +@@ -25,6 +25,7 @@ variables: + libplist-devel + umockdev + dbus-x11 ++ polkit-devel + python3-gobject + python3-dbusmock + python3-pip +-- +2.46.0 + diff --git a/0002-Revert-Remove-polkit-tests.patch b/0002-Revert-Remove-polkit-tests.patch new file mode 100644 index 0000000..2f6dacf --- /dev/null +++ b/0002-Revert-Remove-polkit-tests.patch @@ -0,0 +1,88 @@ +From f55641cd4335997bffd2a662de84c69a45ce9394 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Thu, 22 Aug 2024 20:43:43 +0800 +Subject: [PATCH 2/9] Revert "Remove polkit tests" + +This reverts commit bddc559713ed3e8d790231139b21c8277931b5d0. + +Changes: +- Removed Makefile +- Removed test for UpWakeups +--- + README | 1 + + src/up-self-test.c | 26 ++++++++++++++++++++++++++ + 2 files changed, 27 insertions(+) + +diff --git a/README b/README +index dd2a18c..d7f325e 100644 +--- a/README ++++ b/README +@@ -8,6 +8,7 @@ Requirements: + gio-2.0 >= 2.16.1 + gudev-1.0 >= 235 (Linux) + libimobiledevice-1.0 >= 0.9.7 (optional) ++ polkit-gobject-1 >= 124 + + UPower is an abstraction for enumerating power devices, + listening to device events and querying history and statistics. +diff --git a/src/up-self-test.c b/src/up-self-test.c +index f60618f..a60f5f2 100644 +--- a/src/up-self-test.c ++++ b/src/up-self-test.c +@@ -33,6 +33,7 @@ + #include "up-device-list.h" + #include "up-history.h" + #include "up-native.h" ++#include "up-polkit.h" + + gchar *history_dir = NULL; + +@@ -64,6 +65,12 @@ up_test_daemon_func (void) + { + UpDaemon *daemon; + ++ /* needs polkit, which only listens to the system bus */ ++ if (!g_file_test (DBUS_SYSTEM_SOCKET, G_FILE_TEST_EXISTS)) { ++ puts("No system D-BUS running, skipping test"); ++ return; ++ } ++ + daemon = up_daemon_new (); + g_assert (daemon != NULL); + +@@ -274,6 +281,24 @@ up_test_history_func (void) + rmdir (history_dir); + } + ++static void ++up_test_polkit_func (void) ++{ ++ UpPolkit *polkit; ++ ++ /* polkit only listens to the system bus */ ++ if (!g_file_test (DBUS_SYSTEM_SOCKET, G_FILE_TEST_EXISTS)) { ++ puts("No system D-BUS running, skipping test"); ++ return; ++ } ++ ++ polkit = up_polkit_new (); ++ g_assert (polkit != NULL); ++ ++ /* unref */ ++ g_object_unref (polkit); ++} ++ + int + main (int argc, char **argv) + { +@@ -290,6 +315,7 @@ main (int argc, char **argv) + g_test_add_func ("/power/device_list", up_test_device_list_func); + g_test_add_func ("/power/history", up_test_history_func); + g_test_add_func ("/power/native", up_test_native_func); ++ g_test_add_func ("/power/polkit", up_test_polkit_func); + g_test_add_func ("/power/daemon", up_test_daemon_func); + + return g_test_run (); +-- +2.46.0 + diff --git a/0003-linux-integration-test-Add-polkit-test.patch b/0003-linux-integration-test-Add-polkit-test.patch new file mode 100644 index 0000000..f10baf2 --- /dev/null +++ b/0003-linux-integration-test-Add-polkit-test.patch @@ -0,0 +1,229 @@ +From b71996a526a73a18ae5e66ad6ce52c297a458df9 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Wed, 28 Aug 2024 12:57:40 +0800 +Subject: [PATCH 3/9] linux: integration-test: Add polkit test + +Test action is allowed and not allowed when calling EnableChargeThreshold +dbus API. +--- + src/linux/integration-test.py | 162 +++++++++++++++++++++++++++++++++- + 1 file changed, 159 insertions(+), 3 deletions(-) + +diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py +index 61dfa56..df754c7 100755 +--- a/src/linux/integration-test.py ++++ b/src/linux/integration-test.py +@@ -157,6 +157,7 @@ class Tests(dbusmock.DBusTestCase): + self.daemon = None + self.bluez = None + self.start_logind({'CanHybridSleep' : 'yes'}) ++ self.start_polkitd({}) + + @classmethod + def stop_process(cls, proc, timeout=1): +@@ -324,6 +325,11 @@ class Tests(dbusmock.DBusTestCase): + parameters or {}) + self.addCleanup(self.stop_process, self.bluez) + ++ def start_polkitd(self, parameters=None): ++ self.polkit, self.polkit_obj = self.spawn_server_template('polkitd', ++ parameters or {}) ++ self.addCleanup(self.stop_process, self.polkit) ++ + def assertEventually(self, condition, message=None, timeout=50, value=True): + '''Assert that condition function eventually returns True. + +@@ -1014,6 +1020,10 @@ class Tests(dbusmock.DBusTestCase): + def test_battery_charge_limit_multiple_batteries(self): + '''Battery with charge limits with multiple batteries''' + ++ if not self.polkit: ++ self.start_polkitd({}) ++ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) ++ + self.testbed.add_device('power_supply', 'BAT0', None, + ['type', 'Battery', + 'present', '1', +@@ -1062,9 +1072,75 @@ class Tests(dbusmock.DBusTestCase): + with open(f'/sys/class/power_supply/{battery_name}/charge_control_end_threshold') as fp: + self.assertEqual(fp.read(), '80') + ++ def test_battery_charge_limit_multiple_batteries_polkit_not_allowed(self): ++ '''Battery with charge limits with multiple batteries, but polkit isn't allowed''' ++ ++ if not self.polkit: ++ self.start_polkitd({}) ++ ++ self.testbed.add_device('power_supply', 'BAT0', None, ++ ['type', 'Battery', ++ 'present', '1', ++ 'status', 'unknown', ++ 'energy_full', '60000000', ++ 'energy_full_design', '80000000', ++ 'energy_now', '48000000', ++ 'voltage_now', '12000000', ++ 'charge_control_start_threshold', '0', ++ 'charge_control_end_threshold', '100', ++ ], []) ++ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '70,80') ++ ++ self.testbed.add_device('power_supply', 'BAT1', None, ++ ['type', 'Battery', ++ 'present', '1', ++ 'status', 'unknown', ++ 'energy_full', '60000000', ++ 'energy_full_design', '80000000', ++ 'energy_now', '48000000', ++ 'voltage_now', '12000000', ++ 'charge_control_start_threshold', '0', ++ 'charge_control_end_threshold', '100', ++ ], []) ++ self.testbed.set_property("/sys/class/power_supply/BAT1", 'CHARGE_LIMIT', '70,80') ++ ++ self.start_daemon() ++ devs = self.proxy.EnumerateDevices() ++ self.assertEqual(len(devs), 2) ++ bat0_up = devs[0] ++ bat1_up = devs[0] ++ ++ for bat in [bat0_up, bat1_up]: ++ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdSupported'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdEnabled'), False) ++ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeStartThreshold'), 70) ++ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeEndThreshold'), 80) ++ ++ with self.assertRaises(Exception) as cm: ++ self.enable_charge_limits(bat0_up, True) ++ ex = cm.exception ++ self.assertIn("Operation is not allowed", str(ex)) ++ ++ with self.assertRaises(Exception) as cm: ++ self.enable_charge_limits(bat1_up, True) ++ ex = cm.exception ++ self.assertIn("Operation is not allowed", str(ex)) ++ ++ for bat in [bat0_up, bat1_up]: ++ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdEnabled'), False) ++ battery_name = bat.split('_')[-1] ++ with open(f'/sys/class/power_supply/{battery_name}/charge_control_start_threshold') as fp: ++ self.assertEqual(fp.read(), '0') ++ with open(f'/sys/class/power_supply/{battery_name}/charge_control_end_threshold') as fp: ++ self.assertEqual(fp.read(), '100') ++ + def test_battery_charge_limit_supported(self): + '''Battery with charge_control_start/end_threshold supported''' + ++ if not self.polkit: ++ self.start_polkitd({}) ++ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) ++ + self.testbed.add_device('power_supply', 'BAT0', None, + ['type', 'Battery', + 'present', '1', +@@ -1135,9 +1211,89 @@ class Tests(dbusmock.DBusTestCase): + with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: + self.assertEqual(fp.read(), '100') + ++ def test_battery_charge_limit_supported_polkit_not_allowed(self): ++ '''Battery with charge_control_start/end_threshold supported''' ++ ++ if not self.polkit: ++ self.start_polkitd({}) ++ ++ self.testbed.add_device('power_supply', 'BAT0', None, ++ ['type', 'Battery', ++ 'present', '1', ++ 'model_name', 'test', ++ 'serial_number', '12', ++ 'status', 'unknown', ++ 'energy_full', '60000000', ++ 'energy_full_design', '80000000', ++ 'energy_now', '48000000', ++ 'voltage_now', '12000000', ++ 'charge_control_start_threshold', '0', ++ 'charge_control_end_threshold', '100', ++ ], []) ++ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '70,80') ++ ++ def start_daemon(charge_threshold_value=None): ++ upower_history_dir_override = tempfile.mkdtemp(prefix='upower-history-') ++ if charge_threshold_value is not None: ++ with open(os.path.join(upower_history_dir_override, f"charging-threshold-status") , 'w') as fp: ++ fp.write(charge_threshold_value) ++ ++ self.start_daemon(history_dir_override=upower_history_dir_override) ++ devs = self.proxy.EnumerateDevices() ++ self.assertEqual(len(devs), 1) ++ return devs[0] ++ ++ bat0_up = start_daemon() ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeStartThreshold'), 70) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeEndThreshold'), 80) ++ ++ with self.assertRaises(Exception) as cm: ++ self.enable_charge_limits(bat0_up, True) ++ ex = cm.exception ++ self.assertIn("Operation is not allowed", str(ex)) ++ ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) ++ # charge limits enabled? ++ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: ++ self.assertEqual(fp.read(), '0') ++ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: ++ self.assertEqual(fp.read(), '100') ++ ++ with self.assertRaises(Exception) as cm: ++ self.enable_charge_limits(bat0_up, False) ++ ex = cm.exception ++ self.assertIn("Operation is not allowed", str(ex)) ++ ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) ++ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: ++ self.assertEqual(fp.read(), '0') ++ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: ++ self.assertEqual(fp.read(), '100') ++ ++ self.stop_daemon() ++ ++ # On startup with threshold set ++ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '90,100') ++ bat0_up = start_daemon(charge_threshold_value='1') ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeStartThreshold'), 90) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeEndThreshold'), 100) ++ ++ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: ++ self.assertEqual(fp.read(), '90') ++ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: ++ self.assertEqual(fp.read(), '100') ++ + def test_battery_charge_threshold_unsupported(self): + '''Battery with only end_threshold supported''' + ++ if not self.polkit: ++ self.start_polkitd({}) ++ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) ++ + self.testbed.add_device('power_supply', 'BAT0', None, + ['type', 'Battery', + 'present', '1', +@@ -1159,10 +1315,10 @@ class Tests(dbusmock.DBusTestCase): + self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), False) + self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) + +- try: ++ with self.assertRaises(Exception) as cm: + self.enable_charge_limits(bat0_up, True) +- except Exception as err: +- self.assertIn("setting battery charge thresholds", str(err)) ++ ex = cm.exception ++ self.assertIn("setting battery charge thresholds", str(ex)) + + self.stop_daemon() + +-- +2.46.0 + diff --git a/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch b/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch new file mode 100644 index 0000000..921664e --- /dev/null +++ b/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch @@ -0,0 +1,30 @@ +From b4697dbc626ced1a456bcb4aba8dca2fe1efa901 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Sat, 31 Aug 2024 11:05:54 +0200 +Subject: [PATCH 4/9] up-polkit: Add `G_ADD_PRIVATE (UpPolkit)` + +Without this, accesses to `UpPolkitPrivate` are actually out of bounds +and writing to it will cause heap corruption. + +Fixes: https://gitlab.freedesktop.org/upower/upower/-/issues/281 +--- + src/up-polkit.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/up-polkit.c b/src/up-polkit.c +index 0ede5a7..e0ba246 100644 +--- a/src/up-polkit.c ++++ b/src/up-polkit.c +@@ -43,7 +43,8 @@ struct UpPolkitPrivate + #endif + }; + +-G_DEFINE_TYPE (UpPolkit, up_polkit, G_TYPE_OBJECT) ++G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, ++ G_ADD_PRIVATE (UpPolkit)) + static gpointer up_polkit_object = NULL; + + #ifdef HAVE_POLKIT +-- +2.46.0 + diff --git a/0008-up-polkit-remove-global-variable-and-remove-g_object.patch b/0008-up-polkit-remove-global-variable-and-remove-g_object.patch new file mode 100644 index 0000000..cbdf550 --- /dev/null +++ b/0008-up-polkit-remove-global-variable-and-remove-g_object.patch @@ -0,0 +1,41 @@ +From 7db90b28d842744f135114b3e90e6bded4ac6fbb Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Mon, 2 Sep 2024 14:03:56 +0800 +Subject: [PATCH 8/9] up-polkit: remove global variable and remove + g_object_add_weak_pointer() + +Since UpPolkit is only created in the daemon, so the global variable and +g_object_add_weak_pointer() can be removed. +--- + src/up-polkit.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/src/up-polkit.c b/src/up-polkit.c +index e0ba246..fadfc30 100644 +--- a/src/up-polkit.c ++++ b/src/up-polkit.c +@@ -45,7 +45,6 @@ struct UpPolkitPrivate + + G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, + G_ADD_PRIVATE (UpPolkit)) +-static gpointer up_polkit_object = NULL; + + #ifdef HAVE_POLKIT + /** +@@ -190,12 +189,6 @@ up_polkit_init (UpPolkit *polkit) + UpPolkit * + up_polkit_new (void) + { +- if (up_polkit_object != NULL) { +- g_object_ref (up_polkit_object); +- } else { +- up_polkit_object = g_object_new (UP_TYPE_POLKIT, NULL); +- g_object_add_weak_pointer (up_polkit_object, &up_polkit_object); +- } +- return UP_POLKIT (up_polkit_object); ++ return UP_POLKIT (g_object_new (UP_TYPE_POLKIT, NULL)); + } + +-- +2.46.0 + diff --git a/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch b/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch new file mode 100644 index 0000000..9a2d5d4 --- /dev/null +++ b/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch @@ -0,0 +1,28 @@ +From 131ab3a9d51ca14914a693e18f7f2961efba911e Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Mon, 9 Sep 2024 14:03:57 +0800 +Subject: [PATCH 9/9] up-polkit: Replace with G_DEFINE_TYPE_WITH_PRIVATE + +Since no interface was inplemented in UpPolkit class so G_DEFINE_TYPE_WITH_PRIVATE +macro is batter. +--- + src/up-polkit.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/up-polkit.c b/src/up-polkit.c +index fadfc30..1ead7e7 100644 +--- a/src/up-polkit.c ++++ b/src/up-polkit.c +@@ -43,8 +43,7 @@ struct UpPolkitPrivate + #endif + }; + +-G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, +- G_ADD_PRIVATE (UpPolkit)) ++G_DEFINE_TYPE_WITH_PRIVATE (UpPolkit, up_polkit, G_TYPE_OBJECT) + + #ifdef HAVE_POLKIT + /** +-- +2.46.0 + diff --git a/sources b/sources index b575fdb..3baed65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.4.tar.bz2) = 2db8f2fea4086939c7ec236674ddd03ff043eeb1c7e46deb40b45aed5d31b6eb0e84fa44f189336b0a171f3e2f92f2f50e2f355b9366e0d686e570d0107e88da +SHA512 (upower-v1.90.5.tar.bz2) = 53fe3c3d58a2d7d2ec322620aae3c328dae6402cbd97b24648f12ef862579d4110bb09f746457b6eafa1f24ba2311249216cf84e4a307eeaee152d110787fd56 diff --git a/upower.spec b/upower.spec index 4dccc5a..5c3c611 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.4 +Version: 1.90.5 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ @@ -20,11 +20,24 @@ BuildRequires: libimobiledevice-devel BuildRequires: glib2-devel >= 2.6.0 BuildRequires: gobject-introspection-devel BuildRequires: gtk-doc +BuildRequires: polkit-devel BuildRequires: systemd Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev +# https://gitlab.freedesktop.org/upower/upower/-/commit/b26c8c79c9ff7fd0ba63e893171c6d5b164fda82.patch +Patch1001: 0001-ci-Add-polkit-dependency.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/f55641cd4335997bffd2a662de84c69a45ce9394.patch +Patch1002: 0002-Revert-Remove-polkit-tests.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/b71996a526a73a18ae5e66ad6ce52c297a458df9.patch +Patch1003: 0003-linux-integration-test-Add-polkit-test.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/b4697dbc626ced1a456bcb4aba8dca2fe1efa901.patch +Patch10004: 0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/7db90b28d842744f135114b3e90e6bded4ac6fbb.patch +Patch10005: 0008-up-polkit-remove-global-variable-and-remove-g_object.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/131ab3a9d51ca14914a693e18f7f2961efba911e.patch +Patch10006: 0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch %description UPower (formerly DeviceKit-power) provides a daemon, API and command @@ -100,6 +113,7 @@ Developer documentation for for libupower-glib. %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service %{_datadir}/installed-tests/upower/upower-integration.test +%{_datadir}/polkit-1/actions/org.freedesktop.upower.policy %files libs %license COPYING From a056d9bafcc4609c0f08cf4cba84b0695102aabd Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Sat, 14 Sep 2024 16:42:46 +0800 Subject: [PATCH 48/64] Add polkit dependency and fix intergration test filename --- tests/run-it.sh | 2 +- tests/tests.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/run-it.sh b/tests/run-it.sh index 5db3a05..d480ee1 100755 --- a/tests/run-it.sh +++ b/tests/run-it.sh @@ -2,7 +2,7 @@ set -u # main script -IT="${1:-source/src/linux/integration-test}" +IT="${1:-source/src/linux/integration-test.py}" # check if we need to install additional packages # which is the case if we are on RHEL 8 diff --git a/tests/tests.yml b/tests/tests.yml index 20dd538..f7723ef 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -12,6 +12,7 @@ - classic required_packages: - upower + - polkit-libs - python3-gobject-base - python3-dbus - python3-dbusmock @@ -23,4 +24,4 @@ run: upower -d - integration: dir: . - run: ./run-it.sh source/src/linux/integration-test + run: ./run-it.sh source/src/linux/integration-test.py From 692fec60cba3c0af51df6215d20b93b0c23c253b Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 24 Sep 2024 14:10:37 +0800 Subject: [PATCH 49/64] Update to upstream release 1.90.6 --- .gitignore | 1 + 0001-ci-Add-polkit-dependency.patch | 24 -- 0002-Revert-Remove-polkit-tests.patch | 88 ------- ...nux-integration-test-Add-polkit-test.patch | 229 ------------------ ...up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch | 30 --- ...-global-variable-and-remove-g_object.patch | 41 ---- ...lace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch | 28 --- sources | 2 +- upower.spec | 15 +- 9 files changed, 3 insertions(+), 455 deletions(-) delete mode 100644 0001-ci-Add-polkit-dependency.patch delete mode 100644 0002-Revert-Remove-polkit-tests.patch delete mode 100644 0003-linux-integration-test-Add-polkit-test.patch delete mode 100644 0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch delete mode 100644 0008-up-polkit-remove-global-variable-and-remove-g_object.patch delete mode 100644 0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch diff --git a/.gitignore b/.gitignore index 632891e..03e1335 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.2.tar.bz2 /upower-v1.90.4.tar.bz2 /upower-v1.90.5.tar.bz2 +/upower-v1.90.6.tar.bz2 diff --git a/0001-ci-Add-polkit-dependency.patch b/0001-ci-Add-polkit-dependency.patch deleted file mode 100644 index 7f9ec8e..0000000 --- a/0001-ci-Add-polkit-dependency.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b26c8c79c9ff7fd0ba63e893171c6d5b164fda82 Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Wed, 28 Aug 2024 13:29:41 +0800 -Subject: [PATCH 1/9] ci: Add polkit dependency - ---- - .gitlab-ci.yml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml -index fbdbd53..1476c85 100644 ---- a/.gitlab-ci.yml -+++ b/.gitlab-ci.yml -@@ -25,6 +25,7 @@ variables: - libplist-devel - umockdev - dbus-x11 -+ polkit-devel - python3-gobject - python3-dbusmock - python3-pip --- -2.46.0 - diff --git a/0002-Revert-Remove-polkit-tests.patch b/0002-Revert-Remove-polkit-tests.patch deleted file mode 100644 index 2f6dacf..0000000 --- a/0002-Revert-Remove-polkit-tests.patch +++ /dev/null @@ -1,88 +0,0 @@ -From f55641cd4335997bffd2a662de84c69a45ce9394 Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Thu, 22 Aug 2024 20:43:43 +0800 -Subject: [PATCH 2/9] Revert "Remove polkit tests" - -This reverts commit bddc559713ed3e8d790231139b21c8277931b5d0. - -Changes: -- Removed Makefile -- Removed test for UpWakeups ---- - README | 1 + - src/up-self-test.c | 26 ++++++++++++++++++++++++++ - 2 files changed, 27 insertions(+) - -diff --git a/README b/README -index dd2a18c..d7f325e 100644 ---- a/README -+++ b/README -@@ -8,6 +8,7 @@ Requirements: - gio-2.0 >= 2.16.1 - gudev-1.0 >= 235 (Linux) - libimobiledevice-1.0 >= 0.9.7 (optional) -+ polkit-gobject-1 >= 124 - - UPower is an abstraction for enumerating power devices, - listening to device events and querying history and statistics. -diff --git a/src/up-self-test.c b/src/up-self-test.c -index f60618f..a60f5f2 100644 ---- a/src/up-self-test.c -+++ b/src/up-self-test.c -@@ -33,6 +33,7 @@ - #include "up-device-list.h" - #include "up-history.h" - #include "up-native.h" -+#include "up-polkit.h" - - gchar *history_dir = NULL; - -@@ -64,6 +65,12 @@ up_test_daemon_func (void) - { - UpDaemon *daemon; - -+ /* needs polkit, which only listens to the system bus */ -+ if (!g_file_test (DBUS_SYSTEM_SOCKET, G_FILE_TEST_EXISTS)) { -+ puts("No system D-BUS running, skipping test"); -+ return; -+ } -+ - daemon = up_daemon_new (); - g_assert (daemon != NULL); - -@@ -274,6 +281,24 @@ up_test_history_func (void) - rmdir (history_dir); - } - -+static void -+up_test_polkit_func (void) -+{ -+ UpPolkit *polkit; -+ -+ /* polkit only listens to the system bus */ -+ if (!g_file_test (DBUS_SYSTEM_SOCKET, G_FILE_TEST_EXISTS)) { -+ puts("No system D-BUS running, skipping test"); -+ return; -+ } -+ -+ polkit = up_polkit_new (); -+ g_assert (polkit != NULL); -+ -+ /* unref */ -+ g_object_unref (polkit); -+} -+ - int - main (int argc, char **argv) - { -@@ -290,6 +315,7 @@ main (int argc, char **argv) - g_test_add_func ("/power/device_list", up_test_device_list_func); - g_test_add_func ("/power/history", up_test_history_func); - g_test_add_func ("/power/native", up_test_native_func); -+ g_test_add_func ("/power/polkit", up_test_polkit_func); - g_test_add_func ("/power/daemon", up_test_daemon_func); - - return g_test_run (); --- -2.46.0 - diff --git a/0003-linux-integration-test-Add-polkit-test.patch b/0003-linux-integration-test-Add-polkit-test.patch deleted file mode 100644 index f10baf2..0000000 --- a/0003-linux-integration-test-Add-polkit-test.patch +++ /dev/null @@ -1,229 +0,0 @@ -From b71996a526a73a18ae5e66ad6ce52c297a458df9 Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Wed, 28 Aug 2024 12:57:40 +0800 -Subject: [PATCH 3/9] linux: integration-test: Add polkit test - -Test action is allowed and not allowed when calling EnableChargeThreshold -dbus API. ---- - src/linux/integration-test.py | 162 +++++++++++++++++++++++++++++++++- - 1 file changed, 159 insertions(+), 3 deletions(-) - -diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py -index 61dfa56..df754c7 100755 ---- a/src/linux/integration-test.py -+++ b/src/linux/integration-test.py -@@ -157,6 +157,7 @@ class Tests(dbusmock.DBusTestCase): - self.daemon = None - self.bluez = None - self.start_logind({'CanHybridSleep' : 'yes'}) -+ self.start_polkitd({}) - - @classmethod - def stop_process(cls, proc, timeout=1): -@@ -324,6 +325,11 @@ class Tests(dbusmock.DBusTestCase): - parameters or {}) - self.addCleanup(self.stop_process, self.bluez) - -+ def start_polkitd(self, parameters=None): -+ self.polkit, self.polkit_obj = self.spawn_server_template('polkitd', -+ parameters or {}) -+ self.addCleanup(self.stop_process, self.polkit) -+ - def assertEventually(self, condition, message=None, timeout=50, value=True): - '''Assert that condition function eventually returns True. - -@@ -1014,6 +1020,10 @@ class Tests(dbusmock.DBusTestCase): - def test_battery_charge_limit_multiple_batteries(self): - '''Battery with charge limits with multiple batteries''' - -+ if not self.polkit: -+ self.start_polkitd({}) -+ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) -+ - self.testbed.add_device('power_supply', 'BAT0', None, - ['type', 'Battery', - 'present', '1', -@@ -1062,9 +1072,75 @@ class Tests(dbusmock.DBusTestCase): - with open(f'/sys/class/power_supply/{battery_name}/charge_control_end_threshold') as fp: - self.assertEqual(fp.read(), '80') - -+ def test_battery_charge_limit_multiple_batteries_polkit_not_allowed(self): -+ '''Battery with charge limits with multiple batteries, but polkit isn't allowed''' -+ -+ if not self.polkit: -+ self.start_polkitd({}) -+ -+ self.testbed.add_device('power_supply', 'BAT0', None, -+ ['type', 'Battery', -+ 'present', '1', -+ 'status', 'unknown', -+ 'energy_full', '60000000', -+ 'energy_full_design', '80000000', -+ 'energy_now', '48000000', -+ 'voltage_now', '12000000', -+ 'charge_control_start_threshold', '0', -+ 'charge_control_end_threshold', '100', -+ ], []) -+ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '70,80') -+ -+ self.testbed.add_device('power_supply', 'BAT1', None, -+ ['type', 'Battery', -+ 'present', '1', -+ 'status', 'unknown', -+ 'energy_full', '60000000', -+ 'energy_full_design', '80000000', -+ 'energy_now', '48000000', -+ 'voltage_now', '12000000', -+ 'charge_control_start_threshold', '0', -+ 'charge_control_end_threshold', '100', -+ ], []) -+ self.testbed.set_property("/sys/class/power_supply/BAT1", 'CHARGE_LIMIT', '70,80') -+ -+ self.start_daemon() -+ devs = self.proxy.EnumerateDevices() -+ self.assertEqual(len(devs), 2) -+ bat0_up = devs[0] -+ bat1_up = devs[0] -+ -+ for bat in [bat0_up, bat1_up]: -+ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdSupported'), True) -+ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdEnabled'), False) -+ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeStartThreshold'), 70) -+ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeEndThreshold'), 80) -+ -+ with self.assertRaises(Exception) as cm: -+ self.enable_charge_limits(bat0_up, True) -+ ex = cm.exception -+ self.assertIn("Operation is not allowed", str(ex)) -+ -+ with self.assertRaises(Exception) as cm: -+ self.enable_charge_limits(bat1_up, True) -+ ex = cm.exception -+ self.assertIn("Operation is not allowed", str(ex)) -+ -+ for bat in [bat0_up, bat1_up]: -+ self.assertEqual(self.get_dbus_dev_property(bat, 'ChargeThresholdEnabled'), False) -+ battery_name = bat.split('_')[-1] -+ with open(f'/sys/class/power_supply/{battery_name}/charge_control_start_threshold') as fp: -+ self.assertEqual(fp.read(), '0') -+ with open(f'/sys/class/power_supply/{battery_name}/charge_control_end_threshold') as fp: -+ self.assertEqual(fp.read(), '100') -+ - def test_battery_charge_limit_supported(self): - '''Battery with charge_control_start/end_threshold supported''' - -+ if not self.polkit: -+ self.start_polkitd({}) -+ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) -+ - self.testbed.add_device('power_supply', 'BAT0', None, - ['type', 'Battery', - 'present', '1', -@@ -1135,9 +1211,89 @@ class Tests(dbusmock.DBusTestCase): - with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: - self.assertEqual(fp.read(), '100') - -+ def test_battery_charge_limit_supported_polkit_not_allowed(self): -+ '''Battery with charge_control_start/end_threshold supported''' -+ -+ if not self.polkit: -+ self.start_polkitd({}) -+ -+ self.testbed.add_device('power_supply', 'BAT0', None, -+ ['type', 'Battery', -+ 'present', '1', -+ 'model_name', 'test', -+ 'serial_number', '12', -+ 'status', 'unknown', -+ 'energy_full', '60000000', -+ 'energy_full_design', '80000000', -+ 'energy_now', '48000000', -+ 'voltage_now', '12000000', -+ 'charge_control_start_threshold', '0', -+ 'charge_control_end_threshold', '100', -+ ], []) -+ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '70,80') -+ -+ def start_daemon(charge_threshold_value=None): -+ upower_history_dir_override = tempfile.mkdtemp(prefix='upower-history-') -+ if charge_threshold_value is not None: -+ with open(os.path.join(upower_history_dir_override, f"charging-threshold-status") , 'w') as fp: -+ fp.write(charge_threshold_value) -+ -+ self.start_daemon(history_dir_override=upower_history_dir_override) -+ devs = self.proxy.EnumerateDevices() -+ self.assertEqual(len(devs), 1) -+ return devs[0] -+ -+ bat0_up = start_daemon() -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), True) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeStartThreshold'), 70) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeEndThreshold'), 80) -+ -+ with self.assertRaises(Exception) as cm: -+ self.enable_charge_limits(bat0_up, True) -+ ex = cm.exception -+ self.assertIn("Operation is not allowed", str(ex)) -+ -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) -+ # charge limits enabled? -+ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: -+ self.assertEqual(fp.read(), '0') -+ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: -+ self.assertEqual(fp.read(), '100') -+ -+ with self.assertRaises(Exception) as cm: -+ self.enable_charge_limits(bat0_up, False) -+ ex = cm.exception -+ self.assertIn("Operation is not allowed", str(ex)) -+ -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) -+ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: -+ self.assertEqual(fp.read(), '0') -+ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: -+ self.assertEqual(fp.read(), '100') -+ -+ self.stop_daemon() -+ -+ # On startup with threshold set -+ self.testbed.set_property("/sys/class/power_supply/BAT0", 'CHARGE_LIMIT', '90,100') -+ bat0_up = start_daemon(charge_threshold_value='1') -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), True) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), True) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeStartThreshold'), 90) -+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeEndThreshold'), 100) -+ -+ with open('/sys/class/power_supply/BAT0/charge_control_start_threshold') as fp: -+ self.assertEqual(fp.read(), '90') -+ with open('/sys/class/power_supply/BAT0/charge_control_end_threshold') as fp: -+ self.assertEqual(fp.read(), '100') -+ - def test_battery_charge_threshold_unsupported(self): - '''Battery with only end_threshold supported''' - -+ if not self.polkit: -+ self.start_polkitd({}) -+ self.polkit_obj.SetAllowed(['org.freedesktop.UPower.enable-charging-limit']) -+ - self.testbed.add_device('power_supply', 'BAT0', None, - ['type', 'Battery', - 'present', '1', -@@ -1159,10 +1315,10 @@ class Tests(dbusmock.DBusTestCase): - self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdSupported'), False) - self.assertEqual(self.get_dbus_dev_property(bat0_up, 'ChargeThresholdEnabled'), False) - -- try: -+ with self.assertRaises(Exception) as cm: - self.enable_charge_limits(bat0_up, True) -- except Exception as err: -- self.assertIn("setting battery charge thresholds", str(err)) -+ ex = cm.exception -+ self.assertIn("setting battery charge thresholds", str(ex)) - - self.stop_daemon() - --- -2.46.0 - diff --git a/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch b/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch deleted file mode 100644 index 921664e..0000000 --- a/0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b4697dbc626ced1a456bcb4aba8dca2fe1efa901 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Sat, 31 Aug 2024 11:05:54 +0200 -Subject: [PATCH 4/9] up-polkit: Add `G_ADD_PRIVATE (UpPolkit)` - -Without this, accesses to `UpPolkitPrivate` are actually out of bounds -and writing to it will cause heap corruption. - -Fixes: https://gitlab.freedesktop.org/upower/upower/-/issues/281 ---- - src/up-polkit.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/up-polkit.c b/src/up-polkit.c -index 0ede5a7..e0ba246 100644 ---- a/src/up-polkit.c -+++ b/src/up-polkit.c -@@ -43,7 +43,8 @@ struct UpPolkitPrivate - #endif - }; - --G_DEFINE_TYPE (UpPolkit, up_polkit, G_TYPE_OBJECT) -+G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, -+ G_ADD_PRIVATE (UpPolkit)) - static gpointer up_polkit_object = NULL; - - #ifdef HAVE_POLKIT --- -2.46.0 - diff --git a/0008-up-polkit-remove-global-variable-and-remove-g_object.patch b/0008-up-polkit-remove-global-variable-and-remove-g_object.patch deleted file mode 100644 index cbdf550..0000000 --- a/0008-up-polkit-remove-global-variable-and-remove-g_object.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7db90b28d842744f135114b3e90e6bded4ac6fbb Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Mon, 2 Sep 2024 14:03:56 +0800 -Subject: [PATCH 8/9] up-polkit: remove global variable and remove - g_object_add_weak_pointer() - -Since UpPolkit is only created in the daemon, so the global variable and -g_object_add_weak_pointer() can be removed. ---- - src/up-polkit.c | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/src/up-polkit.c b/src/up-polkit.c -index e0ba246..fadfc30 100644 ---- a/src/up-polkit.c -+++ b/src/up-polkit.c -@@ -45,7 +45,6 @@ struct UpPolkitPrivate - - G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, - G_ADD_PRIVATE (UpPolkit)) --static gpointer up_polkit_object = NULL; - - #ifdef HAVE_POLKIT - /** -@@ -190,12 +189,6 @@ up_polkit_init (UpPolkit *polkit) - UpPolkit * - up_polkit_new (void) - { -- if (up_polkit_object != NULL) { -- g_object_ref (up_polkit_object); -- } else { -- up_polkit_object = g_object_new (UP_TYPE_POLKIT, NULL); -- g_object_add_weak_pointer (up_polkit_object, &up_polkit_object); -- } -- return UP_POLKIT (up_polkit_object); -+ return UP_POLKIT (g_object_new (UP_TYPE_POLKIT, NULL)); - } - --- -2.46.0 - diff --git a/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch b/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch deleted file mode 100644 index 9a2d5d4..0000000 --- a/0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 131ab3a9d51ca14914a693e18f7f2961efba911e Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Mon, 9 Sep 2024 14:03:57 +0800 -Subject: [PATCH 9/9] up-polkit: Replace with G_DEFINE_TYPE_WITH_PRIVATE - -Since no interface was inplemented in UpPolkit class so G_DEFINE_TYPE_WITH_PRIVATE -macro is batter. ---- - src/up-polkit.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/up-polkit.c b/src/up-polkit.c -index fadfc30..1ead7e7 100644 ---- a/src/up-polkit.c -+++ b/src/up-polkit.c -@@ -43,8 +43,7 @@ struct UpPolkitPrivate - #endif - }; - --G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT, -- G_ADD_PRIVATE (UpPolkit)) -+G_DEFINE_TYPE_WITH_PRIVATE (UpPolkit, up_polkit, G_TYPE_OBJECT) - - #ifdef HAVE_POLKIT - /** --- -2.46.0 - diff --git a/sources b/sources index 3baed65..666497c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.5.tar.bz2) = 53fe3c3d58a2d7d2ec322620aae3c328dae6402cbd97b24648f12ef862579d4110bb09f746457b6eafa1f24ba2311249216cf84e4a307eeaee152d110787fd56 +SHA512 (upower-v1.90.6.tar.bz2) = 8ac1c0685b73efece0ecfbee7a37cb7c47601d252210cf3ecc32d1e44cabdde4c8b59b9a93d8bf21e25b3ecbbb95fb952958b37a53f878128747231d4334e5a6 diff --git a/upower.spec b/upower.spec index 5c3c611..7f65795 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.5 +Version: 1.90.6 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ @@ -26,19 +26,6 @@ BuildRequires: systemd Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev -# https://gitlab.freedesktop.org/upower/upower/-/commit/b26c8c79c9ff7fd0ba63e893171c6d5b164fda82.patch -Patch1001: 0001-ci-Add-polkit-dependency.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/f55641cd4335997bffd2a662de84c69a45ce9394.patch -Patch1002: 0002-Revert-Remove-polkit-tests.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/b71996a526a73a18ae5e66ad6ce52c297a458df9.patch -Patch1003: 0003-linux-integration-test-Add-polkit-test.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/b4697dbc626ced1a456bcb4aba8dca2fe1efa901.patch -Patch10004: 0004-up-polkit-Add-G_ADD_PRIVATE-UpPolkit.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/7db90b28d842744f135114b3e90e6bded4ac6fbb.patch -Patch10005: 0008-up-polkit-remove-global-variable-and-remove-g_object.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/131ab3a9d51ca14914a693e18f7f2961efba911e.patch -Patch10006: 0009-up-polkit-Replace-with-G_DEFINE_TYPE_WITH_PRIVATE.patch - %description UPower (formerly DeviceKit-power) provides a daemon, API and command line tools for managing power devices attached to the system. From 50380ac0ae4e5ac9c478706c533998e50a38ea0a Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 3 Oct 2024 17:36:04 -0400 Subject: [PATCH 50/64] Rebuild for libimobiledevice update From cd7a0b6a5bfe3a016853683ce041be554d03c760 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 4 Oct 2024 15:34:58 +0800 Subject: [PATCH 51/64] Fix device update issue The following fix patch was included. "linux: up-enumerator-udev: Find the correct parent id for input devices" Link: https://gitlab.freedesktop.org/upower/upower/-/commit/7d7bb84fde91bef9ee7eba924cbdfa74639cc4fe.patch --- ...n-test_sibling_priority_no_overwrite.patch | 26 +++++++++++ 0002-linux-up-enumerator-udev-Find-the.patch | 43 +++++++++++++++++++ upower.spec | 5 +++ 3 files changed, 74 insertions(+) create mode 100644 0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch create mode 100644 0002-linux-up-enumerator-udev-Find-the.patch diff --git a/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch b/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch new file mode 100644 index 0000000..c39928b --- /dev/null +++ b/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch @@ -0,0 +1,26 @@ +From 9ee76826bd41a5d3a377dfd6f5835f42ec50be9a Mon Sep 17 00:00:00 2001 +From: Stuart Hayhurst +Date: Wed, 25 Sep 2024 16:56:11 +0100 +Subject: [PATCH] Fix race condition in test_sibling_priority_no_overwrite + +--- + src/linux/integration-test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py +index 6b1514a9..f6c804a4 100755 +--- a/src/linux/integration-test.py ++++ b/src/linux/integration-test.py +@@ -3148,8 +3148,8 @@ class Tests(dbusmock.DBusTestCase): + def test_sibling_priority_no_overwrite(self): + 'Test siblings using the fallback device do not overwrite previous guesses' + +- self.start_daemon() + self.testbed.add_from_file(os.path.join(edir, 'tests/wacom-pen-digitiser.device')) ++ self.start_daemon() + + self.assertDevs({ + 'battery_wacom_battery_0': { +-- +GitLab + diff --git a/0002-linux-up-enumerator-udev-Find-the.patch b/0002-linux-up-enumerator-udev-Find-the.patch new file mode 100644 index 0000000..54c0681 --- /dev/null +++ b/0002-linux-up-enumerator-udev-Find-the.patch @@ -0,0 +1,43 @@ +From 7d7bb84fde91bef9ee7eba924cbdfa74639cc4fe Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 18 Jun 2024 15:04:29 +0800 +Subject: [PATCH] linux: up-enumerator-udev: Find the correct parent id for + input devices + +The parent id for the devices under "/sys/devices/virtual/misc/uhid/*" +points to /sys/devices/virtual/misc/uhid. It will cause the device +information to be updated incorrectly. For example, the type for a mouse is +updated to "keyboard". This patch makes sure the correct parent id for +each input device. + +Resolves: #268 #286 +--- + src/linux/up-enumerator-udev.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/linux/up-enumerator-udev.c b/src/linux/up-enumerator-udev.c +index 36e3887b..553f6524 100644 +--- a/src/linux/up-enumerator-udev.c ++++ b/src/linux/up-enumerator-udev.c +@@ -66,8 +66,17 @@ device_parent_id (GUdevDevice *dev) + return NULL; + + /* Continue walk if the parent is a "hid" device */ +- if (g_strcmp0 (subsystem, "hid") == 0) ++ if (g_strcmp0 (subsystem, "hid") == 0) { ++ /* if the parent is under /sys/devices/virtual/misc/uhid, the device should be input devices ++ * and return the path immediately to make sure they belongs to the correct parent. ++ * for example: ++ * root@fedora:/sys/devices/virtual/misc/uhid# ls ++ * 0005:046D:B01A.0005 0005:05AC:0250.000B dev power subsystem uevent */ ++ if (g_strrstr (g_udev_device_get_sysfs_path (parent), "/sys/devices/virtual/misc/uhid")) ++ return g_strdup (g_udev_device_get_sysfs_path (parent)); ++ + return device_parent_id (parent); ++ } + + /* Also skip over USB interfaces, we care about full devices */ + if (g_strcmp0 (subsystem, "usb") == 0 && +-- +GitLab + diff --git a/upower.spec b/upower.spec index 7f65795..c538f47 100644 --- a/upower.spec +++ b/upower.spec @@ -26,6 +26,11 @@ BuildRequires: systemd Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev +# https://gitlab.freedesktop.org/upower/upower/-/commit/9ee76826bd41a5d3a377dfd6f5835f42ec50be9a.patch +Patch1001: 0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch +# https://gitlab.freedesktop.org/upower/upower/-/commit/7d7bb84fde91bef9ee7eba924cbdfa74639cc4fe.patch +Patch1002: 0002-linux-up-enumerator-udev-Find-the.patch + %description UPower (formerly DeviceKit-power) provides a daemon, API and command line tools for managing power devices attached to the system. From df248073c0f0c19299712e4f73f26a0fb41aed26 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 15 Jan 2025 11:24:23 +0800 Subject: [PATCH 52/64] Update to the upstream release 1.90.7 --- .gitignore | 1 + ...n-test_sibling_priority_no_overwrite.patch | 26 ----------- 0002-linux-up-enumerator-udev-Find-the.patch | 43 ------------------- sources | 2 +- upower.spec | 10 ++--- 5 files changed, 5 insertions(+), 77 deletions(-) delete mode 100644 0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch delete mode 100644 0002-linux-up-enumerator-udev-Find-the.patch diff --git a/.gitignore b/.gitignore index 03e1335..cddd8fd 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.4.tar.bz2 /upower-v1.90.5.tar.bz2 /upower-v1.90.6.tar.bz2 +/upower-v1.90.7.tar.bz2 diff --git a/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch b/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch deleted file mode 100644 index c39928b..0000000 --- a/0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9ee76826bd41a5d3a377dfd6f5835f42ec50be9a Mon Sep 17 00:00:00 2001 -From: Stuart Hayhurst -Date: Wed, 25 Sep 2024 16:56:11 +0100 -Subject: [PATCH] Fix race condition in test_sibling_priority_no_overwrite - ---- - src/linux/integration-test.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py -index 6b1514a9..f6c804a4 100755 ---- a/src/linux/integration-test.py -+++ b/src/linux/integration-test.py -@@ -3148,8 +3148,8 @@ class Tests(dbusmock.DBusTestCase): - def test_sibling_priority_no_overwrite(self): - 'Test siblings using the fallback device do not overwrite previous guesses' - -- self.start_daemon() - self.testbed.add_from_file(os.path.join(edir, 'tests/wacom-pen-digitiser.device')) -+ self.start_daemon() - - self.assertDevs({ - 'battery_wacom_battery_0': { --- -GitLab - diff --git a/0002-linux-up-enumerator-udev-Find-the.patch b/0002-linux-up-enumerator-udev-Find-the.patch deleted file mode 100644 index 54c0681..0000000 --- a/0002-linux-up-enumerator-udev-Find-the.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7d7bb84fde91bef9ee7eba924cbdfa74639cc4fe Mon Sep 17 00:00:00 2001 -From: Kate Hsuan -Date: Tue, 18 Jun 2024 15:04:29 +0800 -Subject: [PATCH] linux: up-enumerator-udev: Find the correct parent id for - input devices - -The parent id for the devices under "/sys/devices/virtual/misc/uhid/*" -points to /sys/devices/virtual/misc/uhid. It will cause the device -information to be updated incorrectly. For example, the type for a mouse is -updated to "keyboard". This patch makes sure the correct parent id for -each input device. - -Resolves: #268 #286 ---- - src/linux/up-enumerator-udev.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/src/linux/up-enumerator-udev.c b/src/linux/up-enumerator-udev.c -index 36e3887b..553f6524 100644 ---- a/src/linux/up-enumerator-udev.c -+++ b/src/linux/up-enumerator-udev.c -@@ -66,8 +66,17 @@ device_parent_id (GUdevDevice *dev) - return NULL; - - /* Continue walk if the parent is a "hid" device */ -- if (g_strcmp0 (subsystem, "hid") == 0) -+ if (g_strcmp0 (subsystem, "hid") == 0) { -+ /* if the parent is under /sys/devices/virtual/misc/uhid, the device should be input devices -+ * and return the path immediately to make sure they belongs to the correct parent. -+ * for example: -+ * root@fedora:/sys/devices/virtual/misc/uhid# ls -+ * 0005:046D:B01A.0005 0005:05AC:0250.000B dev power subsystem uevent */ -+ if (g_strrstr (g_udev_device_get_sysfs_path (parent), "/sys/devices/virtual/misc/uhid")) -+ return g_strdup (g_udev_device_get_sysfs_path (parent)); -+ - return device_parent_id (parent); -+ } - - /* Also skip over USB interfaces, we care about full devices */ - if (g_strcmp0 (subsystem, "usb") == 0 && --- -GitLab - diff --git a/sources b/sources index 666497c..df2d334 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.6.tar.bz2) = 8ac1c0685b73efece0ecfbee7a37cb7c47601d252210cf3ecc32d1e44cabdde4c8b59b9a93d8bf21e25b3ecbbb95fb952958b37a53f878128747231d4334e5a6 +SHA512 (upower-v1.90.7.tar.bz2) = 2ef7412c26b2c3a9be533a53f579669b532e321196886725bd4333b54c0c7fbe307ce84776ed5cbfdf82a9822979fc0906f62ea7c5d42171ac6819b3e4c77b97 diff --git a/upower.spec b/upower.spec index c538f47..13f406b 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.6 +Version: 1.90.7 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ @@ -26,11 +26,6 @@ BuildRequires: systemd Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev -# https://gitlab.freedesktop.org/upower/upower/-/commit/9ee76826bd41a5d3a377dfd6f5835f42ec50be9a.patch -Patch1001: 0001-Fix-race-condition-in-test_sibling_priority_no_overwrite.patch -# https://gitlab.freedesktop.org/upower/upower/-/commit/7d7bb84fde91bef9ee7eba924cbdfa74639cc4fe.patch -Patch1002: 0002-linux-up-enumerator-udev-Find-the.patch - %description UPower (formerly DeviceKit-power) provides a daemon, API and command line tools for managing power devices attached to the system. @@ -90,7 +85,7 @@ Developer documentation for for libupower-glib. %files -f upower.lang %{!?_licensedir:%global license %%doc} %license COPYING -%doc NEWS AUTHORS HACKING README +%doc NEWS AUTHORS HACKING.md README.md %{_datadir}/dbus-1/system.d/*.conf %{_udevrulesdir}/*.rules %{_udevhwdbdir}/*.hwdb @@ -106,6 +101,7 @@ Developer documentation for for libupower-glib. %{_unitdir}/*.service %{_datadir}/installed-tests/upower/upower-integration.test %{_datadir}/polkit-1/actions/org.freedesktop.upower.policy +%{_datadir}/zsh %files libs %license COPYING From 9a0a60360f9190be36ff30b6237ae68d49f61a2e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 13:51:00 +0000 Subject: [PATCH 53/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From b501ba1ff3a3315706626a70f843e8192db1eddf Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 31 Mar 2025 15:53:24 +0800 Subject: [PATCH 54/64] Update to the upstream version 1.90.8 --- .gitignore | 1 + sources | 2 +- upower.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cddd8fd..399904b 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.5.tar.bz2 /upower-v1.90.6.tar.bz2 /upower-v1.90.7.tar.bz2 +/upower-v1.90.8.tar.bz2 diff --git a/sources b/sources index df2d334..f7c8fa7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.7.tar.bz2) = 2ef7412c26b2c3a9be533a53f579669b532e321196886725bd4333b54c0c7fbe307ce84776ed5cbfdf82a9822979fc0906f62ea7c5d42171ac6819b3e4c77b97 +SHA512 (upower-v1.90.8.tar.bz2) = 529e0963df6b01576d72abc259148a0303609881ee4aa88e5b9a1cdef11c10b7ab802a5c1c85430ca335f5a54a1114453b0a80eec83fdbf444ed0d34353ceff1 diff --git a/upower.spec b/upower.spec index 13f406b..e641a9e 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.7 +Version: 1.90.8 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ From 791fa9ff4742ccdc6492038038d50384909ca3c6 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 11 Apr 2025 12:07:39 +0800 Subject: [PATCH 55/64] Update to the upstream version 1.90.9 --- .gitignore | 1 + sources | 2 +- upower.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 399904b..c65b443 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.6.tar.bz2 /upower-v1.90.7.tar.bz2 /upower-v1.90.8.tar.bz2 +/upower-v1.90.9.tar.bz2 diff --git a/sources b/sources index f7c8fa7..d2899f5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.8.tar.bz2) = 529e0963df6b01576d72abc259148a0303609881ee4aa88e5b9a1cdef11c10b7ab802a5c1c85430ca335f5a54a1114453b0a80eec83fdbf444ed0d34353ceff1 +SHA512 (upower-v1.90.9.tar.bz2) = 7308e03125a5a888242253f9260f68283f5b53677c08dbc4d7e4d48cc6f600f50f8ab161d100f152138208d5119acddc90f0f19742aa8cca58e3a0ec54975110 diff --git a/upower.spec b/upower.spec index e641a9e..e4d6e7c 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.8 +Version: 1.90.9 Release: %autorelease License: GPL-2.0-or-later URL: http://upower.freedesktop.org/ From 27fd9bd9e8102ad15cb2871d7052ce8a7eb1f617 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 21 May 2025 15:19:22 +0800 Subject: [PATCH 56/64] Move the test files to the upower-tests package --- upower.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/upower.spec b/upower.spec index e4d6e7c..44e665d 100644 --- a/upower.spec +++ b/upower.spec @@ -54,6 +54,13 @@ BuildArch: noarch %description devel-docs Developer documentation for for libupower-glib. +%package tests +Summary: Test files for Upower +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tests +Test files for Upower + %prep %autosetup -n %{name}-v%{version} -p1 -S git @@ -69,6 +76,9 @@ Developer documentation for for libupower-glib. %install %meson_install +mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/installed-tests +mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed-tests + %find_lang upower %ldconfig_scriptlets @@ -93,15 +103,14 @@ Developer documentation for for libupower-glib. %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf %{_bindir}/* -%{_libexecdir}/* +%{_libexecdir}/upowerd %{_mandir}/man1/* %{_mandir}/man7/* %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service -%{_datadir}/installed-tests/upower/upower-integration.test %{_datadir}/polkit-1/actions/org.freedesktop.upower.policy -%{_datadir}/zsh +%{_datadir}/zsh/* %files libs %license COPYING @@ -122,5 +131,9 @@ Developer documentation for for libupower-glib. %dir %{_datadir}/gtk-doc/html/UPower %{_datadir}/gtk-doc/html/UPower/* +%files tests +%{_libexecdir}/installed-tests/upower +%{_datadir}/installed-tests/upower/upower-integration.test + %changelog %autochangelog From 59781ca9580ae855a436e62cbd48c83fada1efea Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 21 May 2025 15:45:48 +0800 Subject: [PATCH 57/64] Revert "Move the test files to the upower-tests package" This reverts commit 27fd9bd9e8102ad15cb2871d7052ce8a7eb1f617. --- upower.spec | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/upower.spec b/upower.spec index 44e665d..e4d6e7c 100644 --- a/upower.spec +++ b/upower.spec @@ -54,13 +54,6 @@ BuildArch: noarch %description devel-docs Developer documentation for for libupower-glib. -%package tests -Summary: Test files for Upower -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description tests -Test files for Upower - %prep %autosetup -n %{name}-v%{version} -p1 -S git @@ -76,9 +69,6 @@ Test files for Upower %install %meson_install -mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/installed-tests -mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed-tests - %find_lang upower %ldconfig_scriptlets @@ -103,14 +93,15 @@ mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed- %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf %{_bindir}/* -%{_libexecdir}/upowerd +%{_libexecdir}/* %{_mandir}/man1/* %{_mandir}/man7/* %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service +%{_datadir}/installed-tests/upower/upower-integration.test %{_datadir}/polkit-1/actions/org.freedesktop.upower.policy -%{_datadir}/zsh/* +%{_datadir}/zsh %files libs %license COPYING @@ -131,9 +122,5 @@ mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed- %dir %{_datadir}/gtk-doc/html/UPower %{_datadir}/gtk-doc/html/UPower/* -%files tests -%{_libexecdir}/installed-tests/upower -%{_datadir}/installed-tests/upower/upower-integration.test - %changelog %autochangelog From 40391129a572ea691a82deb564cfb957f481e2a6 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 21 May 2025 15:19:22 +0800 Subject: [PATCH 58/64] Move the test files to the upower-tests package Move test file to the tests packages. Resolves: #2351829 --- upower.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/upower.spec b/upower.spec index e4d6e7c..44e665d 100644 --- a/upower.spec +++ b/upower.spec @@ -54,6 +54,13 @@ BuildArch: noarch %description devel-docs Developer documentation for for libupower-glib. +%package tests +Summary: Test files for Upower +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tests +Test files for Upower + %prep %autosetup -n %{name}-v%{version} -p1 -S git @@ -69,6 +76,9 @@ Developer documentation for for libupower-glib. %install %meson_install +mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/installed-tests +mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed-tests + %find_lang upower %ldconfig_scriptlets @@ -93,15 +103,14 @@ Developer documentation for for libupower-glib. %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf %{_bindir}/* -%{_libexecdir}/* +%{_libexecdir}/upowerd %{_mandir}/man1/* %{_mandir}/man7/* %{_mandir}/man8/* %{_datadir}/dbus-1/system-services/*.service %{_unitdir}/*.service -%{_datadir}/installed-tests/upower/upower-integration.test %{_datadir}/polkit-1/actions/org.freedesktop.upower.policy -%{_datadir}/zsh +%{_datadir}/zsh/* %files libs %license COPYING @@ -122,5 +131,9 @@ Developer documentation for for libupower-glib. %dir %{_datadir}/gtk-doc/html/UPower %{_datadir}/gtk-doc/html/UPower/* +%files tests +%{_libexecdir}/installed-tests/upower +%{_datadir}/installed-tests/upower/upower-integration.test + %changelog %autochangelog From 8b4f2fc33014c6de0e4c552ca27c10f0bb3a98fc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:49:53 +0000 Subject: [PATCH 59/64] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From f8b971fcb652e2cd716563b6dfec0ed69dfe5959 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 5 Aug 2025 15:12:59 +0800 Subject: [PATCH 60/64] Migrate to tmt test Resolves: #2383092 --- .fmf/version | 1 + plans/integration.fmf | 19 +++++++++++++++++++ tests/integration/main.fmf | 2 ++ tests/{ => integration}/run-it.sh | 2 +- tests/tests.yml | 27 --------------------------- 5 files changed, 23 insertions(+), 28 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/integration.fmf create mode 100644 tests/integration/main.fmf rename tests/{ => integration}/run-it.sh (87%) delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/integration.fmf b/plans/integration.fmf new file mode 100644 index 0000000..aa2d392 --- /dev/null +++ b/plans/integration.fmf @@ -0,0 +1,19 @@ +summary: Test for Upower +discover: + how: fmf +prepare: + - name: packages + how: install + package: + - upower + - upower-tests + - umockdev-devel + - dbus-x11 + - polkit-devel + - python3-dbus + - python3-dbusmock + - python3-gobject-base + - python3-pip + - python3-packaging +execute: + how: tmt diff --git a/tests/integration/main.fmf b/tests/integration/main.fmf new file mode 100644 index 0000000..683aaf3 --- /dev/null +++ b/tests/integration/main.fmf @@ -0,0 +1,2 @@ +summary: Upower integration test +test: bash ./run-it.sh diff --git a/tests/run-it.sh b/tests/integration/run-it.sh similarity index 87% rename from tests/run-it.sh rename to tests/integration/run-it.sh index d480ee1..8b086bf 100755 --- a/tests/run-it.sh +++ b/tests/integration/run-it.sh @@ -2,7 +2,7 @@ set -u # main script -IT="${1:-source/src/linux/integration-test.py}" +IT="${1:-/usr/libexec/installed-tests/upower/integration-test.py}" # check if we need to install additional packages # which is the case if we are on RHEL 8 diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index f7723ef..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- hosts: localhost - roles: - - role: standard-test-source - tags: - - always - required_packages: - - git-core - - role: standard-test-basic - tags: - - atomic - - classic - required_packages: - - upower - - polkit-libs - - python3-gobject-base - - python3-dbus - - python3-dbusmock - - python3-packaging - - umockdev-devel - tests: - - smoke: - dir: smoke - run: upower -d - - integration: - dir: . - run: ./run-it.sh source/src/linux/integration-test.py From 4c15a189e86a08ff9c944ec036f9c908843f2324 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Thu, 28 Aug 2025 15:41:56 +0800 Subject: [PATCH 61/64] Upower owns /usr/share/installed-tests/upower Upower owns its test directory. Resolves: rhbz#2281974 --- upower.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upower.spec b/upower.spec index 44e665d..04d2bda 100644 --- a/upower.spec +++ b/upower.spec @@ -133,6 +133,8 @@ mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed- %files tests %{_libexecdir}/installed-tests/upower +%dir %{_datadir}/installed-tests/ +%dir %{_datadir}/installed-tests/upower/ %{_datadir}/installed-tests/upower/upower-integration.test %changelog From a7310904eb121501e3d1d13cb2fa9578be82c19b Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 29 Aug 2025 14:58:04 +0800 Subject: [PATCH 62/64] Fix URL (rhbz#2387606) Fix URL. --- upower.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upower.spec b/upower.spec index 04d2bda..d5adaa1 100644 --- a/upower.spec +++ b/upower.spec @@ -3,7 +3,7 @@ Name: upower Version: 1.90.9 Release: %autorelease License: GPL-2.0-or-later -URL: http://upower.freedesktop.org/ +URL: https://upower.freedesktop.org/ Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 BuildRequires: meson From 4fc4010f6d3fa67d6c374f8032d94c80bc4c96d5 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 29 Aug 2025 15:51:16 +0800 Subject: [PATCH 63/64] Update to the upstream version 1.90.10 (rhbz#2391004) Update to version 1.90.10. --- .gitignore | 1 + sources | 2 +- upower.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c65b443..eee096e 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.7.tar.bz2 /upower-v1.90.8.tar.bz2 /upower-v1.90.9.tar.bz2 +/upower-v1.90.10.tar.bz2 diff --git a/sources b/sources index d2899f5..725b805 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.9.tar.bz2) = 7308e03125a5a888242253f9260f68283f5b53677c08dbc4d7e4d48cc6f600f50f8ab161d100f152138208d5119acddc90f0f19742aa8cca58e3a0ec54975110 +SHA512 (upower-v1.90.10.tar.bz2) = f7bfb4c4301b6155a17c6b1baf12947503037bb8f8827ab7993ade39ef1aaece64bc08318c73600f62cd5b2ff7d372cc58652045efa803fff5951abd466a3d63 diff --git a/upower.spec b/upower.spec index d5adaa1..d3ee17d 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.9 +Version: 1.90.10 Release: %autorelease License: GPL-2.0-or-later URL: https://upower.freedesktop.org/ From b15ffc9b97d8cc79c7aa833dd38e2dd1987e867a Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 26 Nov 2025 16:51:27 +0800 Subject: [PATCH 64/64] Update to the upstream version 1.91.0 Update to 1.91.0 Resolves: #2416975 --- .gitignore | 1 + sources | 2 +- upower.spec | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index eee096e..fca0e92 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ upower-0.9.5.tar.bz2 /upower-v1.90.8.tar.bz2 /upower-v1.90.9.tar.bz2 /upower-v1.90.10.tar.bz2 +/upower-v1.91.0.tar.bz2 diff --git a/sources b/sources index 725b805..c586f4b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upower-v1.90.10.tar.bz2) = f7bfb4c4301b6155a17c6b1baf12947503037bb8f8827ab7993ade39ef1aaece64bc08318c73600f62cd5b2ff7d372cc58652045efa803fff5951abd466a3d63 +SHA512 (upower-v1.91.0.tar.bz2) = 32801d3ee4c5086221a9f12062b0f2e6765b239f68a562c24ef7808999bb34e299e6acd31acf5c414cf41613709c97b20ad64d252e1d8ddf23183576b156cf93 diff --git a/upower.spec b/upower.spec index d3ee17d..87a9f4c 100644 --- a/upower.spec +++ b/upower.spec @@ -1,6 +1,6 @@ Summary: Power Management Service Name: upower -Version: 1.90.10 +Version: 1.91.0 Release: %autorelease License: GPL-2.0-or-later URL: https://upower.freedesktop.org/ @@ -102,7 +102,8 @@ mv $RPM_BUILD_ROOT%{_libexecdir}/upower $RPM_BUILD_ROOT%{_libexecdir}/installed- %ghost %dir %{_localstatedir}/lib/upower %dir %{_sysconfdir}/UPower %config %{_sysconfdir}/UPower/UPower.conf -%{_bindir}/* +%{_sysconfdir}/UPower/UPower.conf.d/README.md +%{_bindir}/upower %{_libexecdir}/upowerd %{_mandir}/man1/* %{_mandir}/man7/*