diff --git a/supergfxctl-user.conf b/supergfxctl-user.conf new file mode 100644 index 0000000..4a22fdb --- /dev/null +++ b/supergfxctl-user.conf @@ -0,0 +1,3 @@ +# Type Name ID GECOS [HOME] +u supergfxctl - "supergfx daemon" - +m supergfxctl video - - - diff --git a/supergfxctl.changes b/supergfxctl.changes index 14ee2e0..19f6a4b 100644 --- a/supergfxctl.changes +++ b/supergfxctl.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Nov 18 11:07:05 UTC 2024 - RN + +- Added patch for user groups +- Removed `users`, `sudo`, `adm` and `wheel` groups +- Added `video` group and separated `supergfxctl` + ------------------------------------------------------------------- Thu Oct 03 16:16:22 UTC 2024 - RN diff --git a/supergfxctl.spec b/supergfxctl.spec index 3202265..3bc2653 100644 --- a/supergfxctl.spec +++ b/supergfxctl.spec @@ -26,13 +26,18 @@ License: MPL-2.0 URL: https://gitlab.com/asus-linux/supergfxctl Source0: %{name}-%{version}.tar.gz Source1: vendor.tar.zst +Source2: %{name}-user.conf Group: System/Daemons +## Patch for user-groups +Patch1: user-group.patch + BuildRequires: cargo-packaging BuildRequires: pkgconfig BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(systemd) +BuildRequires: sysuser-tools Requires: systemd Conflicts: bbswitch @@ -44,11 +49,14 @@ Conflicts: system76-power %description supergfxctl is a super graphics mode controller for laptops with hybrid nvidia. +%sysusers_requires + %prep -%autosetup -a1 +%autosetup -a1 -p1 %build %cargo_build +%sysusers_generate_pre %{SOURCE2} %{name} %{name}-user.conf %install %cargo_install @@ -64,7 +72,9 @@ install -D -m 0644 data/supergfxd.preset %{buildroot}%{_presetdir}/99-supergfxd. install -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE install -D -m 0644 README.md %{buildroot}%{_datadir}/doc/%{name}/README.md -%pre +install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}-user.conf + +%pre -f %{name}.pre %service_add_pre supergfxd.service %post @@ -94,6 +104,7 @@ fi %{_unitdir}/supergfxd.service %{_presetdir}/99-supergfxd.preset %{_udevrulesdir}/90-supergfxd-nvidia-pm.rules +%{_sysusersdir}/%{name}-user.conf %ghost %attr(0644,root,root) %{_sysconfdir}/modprobe.d/supergfxd.conf %config %{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf %dir %{_datadir}/doc/%{name} diff --git a/user-group.patch b/user-group.patch new file mode 100644 index 0000000..1334531 --- /dev/null +++ b/user-group.patch @@ -0,0 +1,33 @@ +diff --git a/data/org.supergfxctl.Daemon.conf b/data/org.supergfxctl.Daemon.conf +index 77fa627..9bc654f 100644 +--- a/data/org.supergfxctl.Daemon.conf ++++ b/data/org.supergfxctl.Daemon.conf +@@ -2,24 +2,16 @@ + "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> + +- +- +- +- +- +- +- +- +- ++ ++ + + + +- ++ + + + +- +- ++ + + +