Christophe Marin 2024-10-16 07:41:27 +00:00 committed by Git OBS Bridge
commit e922423c68
16 changed files with 578 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,53 @@
From 8c1686c9e97edb9a06e06e2f41cfe5351cef7986 Mon Sep 17 00:00:00 2001
From: Jakob Petsovits <jpetso@petsovits.com>
Date: Thu, 18 Jul 2024 17:14:06 +0000
Subject: [PATCH] daemon: Don't leave dangling Action pointers in idle-time
containers
If we delete the Action but don't clean up related map/set elements,
the powerdevil daemon can crash e.g. in Core::onResumingFromIdle()
and Core::onKIdleTimeoutReached().
This has been an issue since commit 584cfdf0 (or d91bc62f on 6.1)
which made it possible for already-created actions to get deleted
again at a later time.
BUG: 490356
BUG: 490421
(cherry picked from commit 7a929fa01ed036f60c5a15c72416b4e40eb03160)
Co-authored-by: Jakob Petsovits <jpetso@petsovits.com>
---
daemon/powerdevilcore.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
index 915ca0ad..838b5c05 100644
--- a/daemon/powerdevilcore.cpp
+++ b/daemon/powerdevilcore.cpp
@@ -224,10 +224,16 @@ void Core::refreshActions()
}
// Remove now-unsupported actions
- std::erase_if(m_actionPool, [](const auto &pair) {
- const auto &[name, action] = pair;
- return !action->isSupported();
- });
+ for (auto it = m_actionPool.begin(); it != m_actionPool.end();) {
+ Action *action = it->second.get();
+ if (!action->isSupported()) {
+ m_registeredActionTimeouts.remove(action);
+ m_pendingResumeFromIdleActions.remove(action);
+ it = m_actionPool.erase(it);
+ } else {
+ ++it;
+ }
+ }
}
bool Core::isActionSupported(const QString &actionName)
--
2.45.2

BIN
plasma.keyring Normal file

Binary file not shown.

3
powerdevil-6.1.3.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:624f8c9498056d3c7065bb72a61a381fa2021dc36f5a1f32c735435b239918f3
size 965420

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmaWVVMACgkQ11dEg7tX
sY1mGw/+N4ySMnQzp0dJWP6yVYTIphdbdZQtf9ExLvkSgsKln11I53/hIquSV/Zq
9ocJrwA3h7WnO7Y2kAAiecXxMDh6pUR+ZgaQn1uJTpwIvf/E1bnP/WOMvCVNlCRl
bQedOYMBz6aVPhjwDyqVhZAPbrKWrPDUQGy5X7z5r80IgaGokvgtqk0S6HKAr9r8
lOgCimvC2SoWlPSuWFnLlu8nXuQxkxQ6O2qY3xBfyxbZuOTrhTtt0XIzwQ7Y/Tf0
onHGSYqga8N5vuX8j/eyu+obYXdgmukNRU73O9dXkik2/dbTLEHDidwgeA2c/4t5
Lze/DsEYcJnXY4cv3IyvBs+3gMXzMGt/Mc+xEZKH5V2M+85UVsNWehpthFh1/BJJ
hPNj92/XRL1iY6ReFdYXQPzX1q6XmMWJi/pY+5P/XDWrw8AqyrP6T9s6CI79tomD
v7XkuLx/J+w7M0cnzKLqL6BDlAuGzi7/g1Efgy4v2s6n0Nk0BoP0HzNip/1YX7mz
XnKt0ofFZRg9fCvQqUJ3ozNvjruQrcH1DMe0zTSKyNqLV5LQRkLsV7a1FgrbuYNd
GSwhIM2Hz7uIpIQZK8M6osFBno5Jmp77cfJWITQvR3l7ramqVD05gI85YyQc9/h7
mEGU/afgvcQf5BxvviKVAqO8v0TUASkmylrnsBiZ13tXo5v5Rks=
=1Dp4
-----END PGP SIGNATURE-----

3
powerdevil-6.1.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1a966e2e2498305e33397ef27dfa68d10255fcb7099b0d91c5eda8d429013e5
size 967284

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmayGNoACgkQ11dEg7tX
sY05Ow/8C3h3FfK6QeZeu3S3RSKJlfX5wD8dnVRRj9/7Kt1xUGFhY300OKCiUwFg
qmP+GLpxv4kmZ+1xCAObRorBYpt5dADOvRstGDlpwn/Z7Sn19JhMrXIZVvSarvnf
fl0II3IMmzO9ckd8Lpsg9Aoj8d/p1OHgD5G/a5pEMvsGA5GVlkFuuj64LIt0X3+M
0KTJTLjUDRJLIcTgT79SiJTJqtpqeiLlIkt0s2HYRLugDsCjYVnC3C9WYFnDS2ZV
BJZ2YJKh9VkQ9XACYZXPO73X4cvGaOk3rk/yDhmaGsrEMS4nw89qICG3GVx5/XBO
tfxxDZJGqEDwLPPsKTAeOxPHvGwTn2Gkb8L0JiEFw7ZD51SMAsO9nzZHBD09P1EF
jAVSnNJmDfCFyMhhI/c9jfTZGkveEdirFvHlOZ7E6R+xQSAmqjEwOVg7kxU6AlIy
9kQgf4GuW+tQI9lriMJyfC/jSvZMblBa6K0HmdrmchDYxYm5ATmmpN/jgsyXtr9q
WPMbwYsvVvGv4VqTyv8dn0HHabE4ZQASm7tk1GU1mhvRafE312IPaNv2F5SLjqVc
TOViHrPkBoCrTnWeij+c/1Vg7KyJ9ssqQajF5aSsGSgc+qnR62RfLJeyQiBMs8jn
AGCH8RInHuV/pZP8h3bcc+t7CXL/ZynPBo9XV/shSfGwreDFHjQ=
=h8V0
-----END PGP SIGNATURE-----

3
powerdevil-6.1.5.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:050e1c6fcf07da2cd7bfe22a618aa91504bb2b00bd31aa68121b903cde9d845d
size 967780

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmbgCR0ACgkQ11dEg7tX
sY3Pjg//XF+1wW+HnmZjq2cGBvUJkOf1kuEKmCgzksIiSjHL4qDzC4bxrt5zwNQ7
3UdnwkjtL75vBGAP7j/8pu7i6QOIO7RMSDKr5i5k4yzLGMKwm9/jxDWqMJd8EeNw
9hmK5+DvRyin/f/40/fDnpxZSWBc6VtmGoIcIt09TS8e6ZUOnHCzFwxp1StXDlbo
yVLf2LBerj3JaTOH9ZGZ40Ae+6T1RxwlmSkHMVudTjB/BepRybJmb7tioAK8waGK
tf1Yx79wVyjMm5bxeJUNn4BSYJPUwyHqfznm65VLZ23ceHqoh762U4+0HgggtLD8
8JoHLPjK1rQu4O9wd0sCUDiRe6WY5KyzI1s6NpqJjo235/G11SIRiKqx1y/xWG2Z
etQSmqZkDYtGMx82YXMbHz2mRUHFpkYqoHFIFluqXDCH042qXiBQEeEqV6OMUtb6
6A34wKRg7CTBDOmK3HCBrbx67GdVSkvuOZw5keyv7O4DRbfES9wtc12j+vJ+WKDE
5VBkj5q9ODL9jNkgSUnqLSj2eElnL4vicQtR1aaJRtXgE4fWzmgi0JuQvHgeeKS0
HgUHEqL2ofALigvRmkjWA2gEfrQmfb0x6JP45AF+XJN0aexYePxd/CmSY0CjyGH+
L5eiGnQeA1KixO7VPOWx8xJv8OdTR/uaP+5AmsOIDEiBCHse8qw=
=1iNk
-----END PGP SIGNATURE-----

3
powerdevil-6.2.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83c1fd55117757a8b4c4452a2f3047d8f42acc54f37ec045065a28d9264179c2
size 1182148

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmb+kK4ACgkQ11dEg7tX
sY1BLg/7Bm6SMR9zkg14K1XfZnA5CU250paOeNT8QXSctuC8gPUuaTSbfzXAZAy5
5iaMNa8pPQo5h46ahfXN79RbjrJyOVREnVioGB1MIzrG237W1jDQ5xuPzdPgUOiW
WYGZ899VPYJzhUzQ/m3IO2qtU6PBOSjNcDZpEA2za4UJy1HLQfs24yZDrPh8MN0h
HO++j2NAIdFpjy4MWmgkCICg7Hgbv9xlTf48S7cserBxcevnEW2vs7Tn7NEpC1DN
4OOVTmyLjO3b1uRiXNmbEjuWHsOfZCiuX9oMOlpYSvDxV3pfCNNcJLZYAaURCPHW
KWx02lB3GKjCXnm24cU7abJUi3+gHke+eHzmSRtZ0QIWDg5xXKCCni9VoFlwBilG
xtAESqkFSuaWII16qfjiaIckSeXQlzfwtsEj+TT2VNm+uJkZtTZwwM77MEg4xKSs
omykjxIFHS64krVe39yqxMF1M9fXNSK0fzgfDmZpXwdOzR002i99PGZL3ZCa8kW8
HXwUTh79Fv/FK+NRBcyaP5+9V7VGDVfdV0DL8aBt5+f18QhhrHfMpSzG0DdAIFnE
DufCEfkycICyCNKS9CLAZWIhDnKFWweeqsiEaa2pMXwhen6pW5zqml92TPAzwJ6p
R8O7MBEx4L2gq6hVxMKfLwzEDm6K1fgEpBiPDJ7Gs00ty3Sxvfk=
=hANI
-----END PGP SIGNATURE-----

3
powerdevil-6.2.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5bfa068fa31f118784e681eb97b9c49f5a8034c0628b099c0052fdfb129c3e65
size 1187280

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmcOa04ACgkQ11dEg7tX
sY3/rQ/8DFl/1D1cx2EyPg0KAGQS6rpvp6AGFA3Hu03Vu7ZYkbX8VJqODdmE49cm
rpUGudNEeXzxk57uYYWRK9fpe6VhpKH90g50eAEeLZO7ALU5KVg4yshfmYwbj9Wj
RSYbNhoLnY14u1miLgy5q208h701sKO6UwmPHWJkkNUH2xrkCTt6sZR7RvRWS2Oz
ltXZshxI7ATdZZcpsavB2kPtXh51rPYuTN/vMQTxaU0JH2Wai/arh1/a9d2d0VoN
bREH2269jsOtszmZI7PwB3653Iti3DDePKeifxQzE4nxA37hnEToH3/dQtx9t734
dabjsf4lqW6HIsrRhTan4UGC4zI+2AR1n5sHfrri2JYcYoGObLjrQykPDrTZ0pQy
pLmO+BkNsMytExcLdcx+hut1i73o7KUaiHA19EpCrLbGPQpA2kjSTj6nU1IDr2L6
jwQ9FabhyJwRiYF/hcuPLHJM7sft2tEKX+SAqxRNtJOb3zdexavhmqE1FW7Js++7
SwW5GG5Ksc5ECc/p4hq9+RHSnOl0AoW7RBYHDergVmGdipoq1F8rH+c2t+nZT0Lo
IFjFGgdkF/ABrogA/wMP1KOgQEYjdcn3GDnC5PwuQj7lTvU22SR+jUOY20kbT1KK
q0QVJrecTg6zG2I+aY+z7rPpkIxY8tV75O5/Zt4jKjlmnTJtyHg=
=VflO
-----END PGP SIGNATURE-----

236
powerdevil6.changes Normal file
View File

@ -0,0 +1,236 @@
-------------------------------------------------------------------
Tue Oct 15 16:53:54 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.1:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.1
- Changes since 6.2.0:
* update version for new release
* applets/brightness: More robustness for surviving plugin destruction
* daemon: Retry failed DDC/CI brightness write also on monitor wake-up
* daemon: Retry failed DDC/CI reads and writes repeatedly
* applets/brightness: Survive plugin destruction after async wait
* update version for new release
* applets/brightness: Avoid producing duplicate display sliders (kde#493844)
* daemon/actions/dimdisplay: Set brightness separately per display (kde#493111)
-------------------------------------------------------------------
Sat Oct 5 10:44:39 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.0:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.0
- Changes since 6.1.90:
* update version for new release
* applet: fix power profile label not visible when using ppd
* Port popup to PlasmaExtras.Menu (kde#492493)
* daemon: Do not compare const and non-const QMap iterator (kde#493519)
* applets/batterymonitor: React to D-Bus service (un)register events
-------------------------------------------------------------------
Tue Sep 17 14:54:55 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.90:
* New feature release
* For more details see https://kde.org/announcements/plasma/6/6.1.90
- Too many changes to list here
-------------------------------------------------------------------
Tue Sep 10 14:55:28 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.5:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.5
- Changes since 6.1.4:
* update version for new release
-------------------------------------------------------------------
Tue Aug 6 13:29:05 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.4:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.4
- Changes since 6.1.3:
* update version for new release
* daemon: Don't leave dangling Action pointers in idle-time containers (kde#490356,kde#490421)
- Drop patches, now upstream:
* 0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch
-------------------------------------------------------------------
Wed Jul 24 17:23:00 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Add patch to fix crash on display wake up (kde#490356, kde#490421):
* 0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch
-------------------------------------------------------------------
Tue Jul 16 13:41:23 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.3:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.3
- Changes since 6.1.2:
* update version for new release
- Drop patch to enable battery conservation mode control after
whitelisting (boo#1226424):
* 0001-Revert-Added-setting-for-battery-conservation-mode-L.patch
-------------------------------------------------------------------
Tue Jul 2 17:34:34 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.2:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.2
- Changes since 6.1.1:
* daemon/controllers: Reintroduce a mutex around ddca_open_display2() (kde#489169)
* update version for new release
* ddcutildisplay: give some time before changing brightness after the monitor resumes
* core: reload actions on brightness controller changes
* update version for new release
- Rebase 0001-Revert-Added-setting-for-battery-conservation-mode-L.patch
-------------------------------------------------------------------
Tue Jun 25 17:15:54 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.1:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.1
- Changes since 6.1.0:
* update version for new release
* Fix initial UI state of Battery protection setting (kde#488954)
* daemon: Limit KAuth backlighthelper calls to only one at a time (kde#481003)
* skip ddcutil initialization when POWERDEVIL_NO_DDCUTIL is set
* update version for new release
- Rebase 0001-Revert-Added-setting-for-battery-conservation-mode-L.patch
-------------------------------------------------------------------
Mon Jun 17 09:43:38 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Add patch to revert feature until new polkit rules got whitelisted:
* 0001-Revert-Added-setting-for-battery-conservation-mode-L.patch
-------------------------------------------------------------------
Thu Jun 13 10:58:59 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.0:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.0
- Changes since 6.0.90:
* update version for new release
* daemon/controllers/kwinbrightness: remove brightness control of disabled screens
* daemon: Don't disconnect from a null object (kde#487647)
* OSD: Close on focus lost
* OSD: start cleanup timer
-------------------------------------------------------------------
Sat May 25 11:20:12 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.90:
* New feature release
* For more details see https://kde.org/announcements/plasma/6/6.0.90
- Too many changes to list here
-------------------------------------------------------------------
Wed May 22 07:43:21 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.5:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.0.5
- Changes since 6.0.4:
* update version for new release
* kcmodule: Hide profile load/unload fields if battery profiles are absent
* [osd] Force Plasma styling (kde#480254)
-------------------------------------------------------------------
Wed May 15 08:13:04 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Recommend ddcutil-i2c-udev-rules (boo#1224197)
-------------------------------------------------------------------
Wed Apr 17 08:13:55 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.4:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.0.4
- Changes since 6.0.3:
* update version for new release
* actions/dimdisplay: Improve log messages
* actions/dimdisplay: Don't dim when screen changes are inhibited
* daemon: Avoid constantly locking ddcutil display handles (kde#481793)
* daemon: Store label for DDCutilBrightness as QString directly
* actions/handlebuttonevents: Require lid-open again to track kb brightness (kde#482306)
* update version for new release
-------------------------------------------------------------------
Tue Mar 26 18:06:58 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.3:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.0.3
- Changes since 6.0.2:
* update version for new release
* kcmodule: Don't crash when a configured button action is unsupported (kde#482668)
-------------------------------------------------------------------
Wed Mar 13 09:10:38 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.2:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.0.2
- Changes since 6.0.1:
* update version for new release
* actions/dpms: Ignore turn-off triggers when action is disabled (kde#481308,kde#482077)
* actions/powerprofile: guard against empty profiles list in readProperties (kde#483216)
* Check if idle inhibitor is active before blanking the screen (kde#482141)
* Make OSD labels translatable
* update version for new release
-------------------------------------------------------------------
Wed Mar 6 08:40:34 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.1:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.0.1
- Changes since 6.0.0:
* update version for new release
* [dimdisplay] Respect profile configurations
-------------------------------------------------------------------
Mon Mar 4 18:52:31 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Add Provides/Obsoletes to replace Plasma 5
-------------------------------------------------------------------
Wed Feb 21 18:36:41 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.0:
* New bugfix release
* Release announcement not available yet
- Changes since 5.93.0:
* update version for new release
* kcmodule: Remove separator line now that NavigationTabBar provides it
* kbd backlight: Fix double brightness restore on LidOpen-resume
* update version for new release
-------------------------------------------------------------------
Wed Jan 31 17:38:28 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 5.93.0 (6.0 RC 2):
* New bugfix release
* See https://kde.org/announcements/megarelease/6/rc2/ for details
- Changes since 5.92.0:
* RC 1 version dep
* add a version for dependencies so it does not break CI https://invent.kde.org/plasma/bluedevil/-/merge_requests/156
* Allow disabling DDC brightness via env variable
* ddcutil: skip invalid displays (kde#476375)
-------------------------------------------------------------------
Mon Jan 15 21:09:14 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 5.92.0 (6.0 RC 1)
* For more details please see:
https://kde.org/announcements/megarelease/6/rc1/
-------------------------------------------------------------------
Mon Jul 10 09:53:19 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Init powerdevil6

170
powerdevil6.spec Normal file
View File

@ -0,0 +1,170 @@
#
# spec file for package powerdevil6
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define kf6_version 6.5.0
%define qt6_version 6.7.0
%define rname powerdevil
%bcond_without released
Name: powerdevil6
Version: 6.2.1
Release: 0
# Full Plasma 6 version (e.g. 6.0.0)
%{!?_plasma6_bugfix: %define _plasma6_bugfix %{version}}
# Latest ABI-stable Plasma (e.g. 6.0 in KF6, but 6.0.80 in KUF)
%{!?_plasma6_version: %define _plasma6_version %(echo %{_plasma6_bugfix} | awk -F. '{print $1"."$2}')}
Summary: KDE Power Management module
License: GPL-2.0-or-later
URL: https://www.kde.org
Source: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz
%if %{with released}
Source1: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz.sig
Source2: plasma.keyring
%endif
BuildRequires: kf6-extra-cmake-modules >= %{kf6_version}
# Needed by FindLibcap.cmake
BuildRequires: libcap-progs
BuildRequires: pkgconfig
BuildRequires: qt6-gui-private-devel >= %{qt6_version}
BuildRequires: systemd-rpm-macros
BuildRequires: cmake(KF6Auth) >= %{kf6_version}
BuildRequires: cmake(KF6Config) >= %{kf6_version}
BuildRequires: cmake(KF6Crash) >= %{kf6_version}
BuildRequires: cmake(KF6DBusAddons) >= %{kf6_version}
BuildRequires: cmake(KF6DocTools) >= %{kf6_version}
BuildRequires: cmake(KF6GlobalAccel) >= %{kf6_version}
BuildRequires: cmake(KF6I18n) >= %{kf6_version}
BuildRequires: cmake(KF6IdleTime) >= %{kf6_version}
BuildRequires: cmake(KF6KCMUtils) >= %{kf6_version}
BuildRequires: cmake(KF6KIO) >= %{kf6_version}
BuildRequires: cmake(KF6KirigamiPlatform) >= %{kf6_version}
BuildRequires: cmake(KF6Notifications) >= %{kf6_version}
BuildRequires: cmake(KF6NotifyConfig) >= %{kf6_version}
BuildRequires: cmake(KF6Runner) >= %{_plasma6_bugfix}
BuildRequires: cmake(KF6Screen) >= %{_plasma6_bugfix}
BuildRequires: cmake(KF6Solid) >= %{kf6_version}
BuildRequires: cmake(KF6XmlGui) >= %{kf6_version}
BuildRequires: cmake(LibKWorkspace) >= %{_plasma6_bugfix}
BuildRequires: cmake(PlasmaActivities) >= %{_plasma6_bugfix}
BuildRequires: cmake(PlasmaWaylandProtocols)
BuildRequires: cmake(QCoro6)
BuildRequires: cmake(Qt6DBus) >= %{qt6_version}
BuildRequires: cmake(Qt6WaylandClient) >= %{qt6_version}
BuildRequires: cmake(Qt6Widgets) >= %{qt6_version}
BuildRequires: pkgconfig(ddcutil)
BuildRequires: pkgconfig(libcap)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xcb-dpms)
BuildRequires: pkgconfig(xcb-randr)
Requires: kf6-kidletime-plugins
#PrepareForSleep is added to systemd 198, and with Plasma 5.2, will be unconditionaly called
Requires: systemd >= 198
%requires_ge plasma6-workspace-libs
Provides: powerdevil5 = %{version}
Obsoletes: powerdevil5 < %{version}
Obsoletes: powerdevil5-lang < %{version}
# Needed for battery / brightness detection
Recommends: upower
# For i2c dev handling and permissions
Recommends: ddcutil-i2c-udev-rules
# For switching power profiles
Recommends: power-profiles-daemon
%description
KDE Power Management module. Provides kded daemon, DBus helper and KCM for
configuring Power settings.
%lang_package
%prep
%autosetup -p1 -n %{rname}-%{version}
%build
%cmake_kf6
%kf6_build
%install
%kf6_install
%find_lang %{name} --all-name --with-html
rm -rv %{buildroot}%{_kf6_libdir}/libpowerdevil{core,configcommonprivate}.so
%post
%ldconfig
%{systemd_user_post plasma-powerdevil.service}
%preun
%{systemd_user_preun plasma-powerdevil.service}
%postun
%ldconfig
%{systemd_user_postun plasma-powerdevil.service}
%files
%license COPYING*
%doc %{_kf6_htmldir}/en/kcontrol/
%{_kf6_applicationsdir}/kcm_powerdevilprofilesconfig.desktop
%{_kf6_appstreamdir}/org.kde.plasma.battery.appdata.xml
%{_kf6_appstreamdir}/org.kde.plasma.brightness.appdata.xml
%{_kf6_configdir}/autostart/powerdevil.desktop
%{_kf6_dbuspolicydir}/org.kde.powerdevil.backlighthelper.conf
%{_kf6_dbuspolicydir}/org.kde.powerdevil.discretegpuhelper.conf
%{_kf6_debugdir}/batterymonitor.categories
%{_kf6_debugdir}/powerdevil.categories
%{_kf6_libdir}/libpowerdevilconfigcommonprivate.so.*
%{_kf6_libdir}/libpowerdevilcore.so.*
%{_kf6_libexecdir}/kauth/backlighthelper
%{_kf6_libexecdir}/kauth/chargethresholdhelper
%{_kf6_libexecdir}/kauth/discretegpuhelper
%{_kf6_notificationsdir}/powerdevil.notifyrc
%{_kf6_plasmadir}/plasmoids/org.kde.plasma.battery/
%{_kf6_plasmadir}/plasmoids/org.kde.plasma.brightness/
%dir %{_kf6_plugindir}/kf6/krunner
%{_kf6_plugindir}/kf6/krunner/krunner_powerdevil.so
%{_kf6_plugindir}/plasma/kcms/systemsettings/kcm_powerdevilprofilesconfig.so
%dir %{_kf6_plugindir}/powerdevil/
%dir %{_kf6_plugindir}/powerdevil/action
%{_kf6_plugindir}/powerdevil/action/powerdevil_brightnesscontrolaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_dimdisplayaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_dpmsaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_handlebuttoneventsaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_keyboardbrightnesscontrolaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_powerprofileaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_runscriptaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_screenbrightnesscontrolaction.so
%{_kf6_plugindir}/powerdevil/action/powerdevil_suspendsessionaction.so
%dir %{_kf6_qmldir}/org/kde/plasma/private/
%{_kf6_qmldir}/org/kde/plasma/private/batterymonitor/
%{_kf6_qmldir}/org/kde/plasma/private/brightnesscontrolplugin/
%{_kf6_sharedir}/dbus-1/system-services/org.kde.powerdevil.backlighthelper.service
%{_kf6_sharedir}/dbus-1/system-services/org.kde.powerdevil.chargethresholdhelper.service
%{_kf6_sharedir}/dbus-1/system-services/org.kde.powerdevil.discretegpuhelper.service
%{_kf6_sharedir}/dbus-1/system.d/org.kde.powerdevil.chargethresholdhelper.conf
%{_kf6_sharedir}/polkit-1/actions/org.kde.powerdevil.backlighthelper.policy
%{_kf6_sharedir}/polkit-1/actions/org.kde.powerdevil.chargethresholdhelper.policy
%{_kf6_sharedir}/polkit-1/actions/org.kde.powerdevil.discretegpuhelper.policy
%{_libexecdir}/org_kde_powerdevil
%{_userunitdir}/plasma-powerdevil.service
%files lang -f %{name}.lang
%exclude %{_kf6_htmldir}/en/kcontrol
%changelog