2024-11-05 00:08:05 +01:00
|
|
|
#
|
|
|
|
# spec file for package supergfxctl
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-12-27 23:55:35 +01:00
|
|
|
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
|
|
|
|
|
|
|
Name: supergfxctl
|
2024-09-25 03:56:56 +02:00
|
|
|
Version: 5.2.4
|
2023-12-27 23:55:35 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Super graphics mode controller
|
|
|
|
License: MPL-2.0
|
|
|
|
URL: https://gitlab.com/asus-linux/supergfxctl
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2023-12-28 17:39:13 +01:00
|
|
|
Source1: vendor.tar.zst
|
2024-11-18 14:14:44 +01:00
|
|
|
Source2: %{name}-user.conf
|
2024-11-23 01:02:43 +01:00
|
|
|
Source3: prime-run.sh
|
2024-03-09 20:43:53 +01:00
|
|
|
Group: System/Daemons
|
2023-12-27 23:55:35 +01:00
|
|
|
|
2024-11-18 14:14:44 +01:00
|
|
|
## Patch for user-groups
|
2024-11-23 01:02:43 +01:00
|
|
|
Patch1: user-group.patch
|
2024-11-18 14:14:44 +01:00
|
|
|
|
2024-11-18 17:45:44 +01:00
|
|
|
## Upstream GPU detection patch
|
2024-11-23 01:02:43 +01:00
|
|
|
Patch2: GPUDetection.patch
|
2024-11-18 17:45:44 +01:00
|
|
|
|
2023-12-27 23:55:35 +01:00
|
|
|
BuildRequires: cargo-packaging
|
|
|
|
BuildRequires: pkgconfig
|
2024-11-23 01:02:43 +01:00
|
|
|
BuildRequires: sysuser-tools
|
2023-12-27 23:55:35 +01:00
|
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
|
|
BuildRequires: pkgconfig(libudev)
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
Requires: systemd
|
|
|
|
|
2024-11-05 00:08:05 +01:00
|
|
|
Conflicts: bbswitch
|
2023-12-27 23:55:35 +01:00
|
|
|
Conflicts: bumblebee
|
|
|
|
Conflicts: bumblebee-status-module-nvidia-optimus-manager
|
|
|
|
Conflicts: suse-prime
|
|
|
|
Conflicts: system76-power
|
|
|
|
|
2024-11-18 16:21:46 +01:00
|
|
|
%sysusers_requires
|
|
|
|
|
2023-12-27 23:55:35 +01:00
|
|
|
%description
|
|
|
|
supergfxctl is a super graphics mode controller for laptops with hybrid nvidia.
|
|
|
|
|
|
|
|
%prep
|
2024-11-18 14:14:44 +01:00
|
|
|
%autosetup -a1 -p1
|
2023-12-27 23:55:35 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%cargo_build
|
2024-11-18 14:14:44 +01:00
|
|
|
%sysusers_generate_pre %{SOURCE2} %{name} %{name}-user.conf
|
2023-12-27 23:55:35 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
%cargo_install
|
|
|
|
|
|
|
|
mkdir -p "%{buildroot}%{_bindir}"
|
|
|
|
install -D -m 0755 target/release/supergfxd %{buildroot}%{_bindir}/supergfxd
|
|
|
|
install -D -m 0755 target/release/supergfxctl %{buildroot}%{_bindir}/supergfxctl
|
|
|
|
install -D -m 0644 data/90-supergfxd-nvidia-pm.rules %{buildroot}%{_udevrulesdir}/90-supergfxd-nvidia-pm.rules
|
|
|
|
install -D -m 0644 data/org.supergfxctl.Daemon.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf
|
|
|
|
install -D -m 0644 data/supergfxd.service %{buildroot}%{_unitdir}/supergfxd.service
|
|
|
|
install -D -m 0644 data/supergfxd.preset %{buildroot}%{_presetdir}/99-supergfxd.preset
|
|
|
|
|
|
|
|
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
|
|
|
|
install -D -m 0644 README.md %{buildroot}%{_datadir}/doc/%{name}/README.md
|
|
|
|
|
2024-11-18 14:14:44 +01:00
|
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}-user.conf
|
|
|
|
|
2024-11-23 01:02:43 +01:00
|
|
|
install -D -m 0755 %{SOURCE3} %{buildroot}%{_bindir}/prime-run
|
|
|
|
|
2024-11-18 14:14:44 +01:00
|
|
|
%pre -f %{name}.pre
|
2023-12-27 23:55:35 +01:00
|
|
|
%service_add_pre supergfxd.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post supergfxd.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun supergfxd.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun_with_restart supergfxd.service
|
2023-12-28 07:42:23 +01:00
|
|
|
if [ -e %{_sysconfdir}/modprobe.d/nvidia.conf ]
|
2023-12-27 23:55:35 +01:00
|
|
|
then
|
|
|
|
if grep -q "# options nvidia-drm.modeset=1" %{_sysconfdir}/modprobe.d/nvidia.conf
|
|
|
|
then
|
|
|
|
echo "optional nvidia-drm.modeset=1" > %{_sysconfdir}/modprobe.d/nvidia.conf
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/supergfxd
|
|
|
|
%{_bindir}/supergfxctl
|
2024-11-23 01:02:43 +01:00
|
|
|
%{_bindir}/prime-run
|
2023-12-27 23:55:35 +01:00
|
|
|
%{_unitdir}/supergfxd.service
|
|
|
|
%{_presetdir}/99-supergfxd.preset
|
|
|
|
%{_udevrulesdir}/90-supergfxd-nvidia-pm.rules
|
2024-11-18 14:14:44 +01:00
|
|
|
%{_sysusersdir}/%{name}-user.conf
|
2024-11-05 05:40:21 +01:00
|
|
|
%ghost %attr(0644,root,root) %{_sysconfdir}/modprobe.d/supergfxd.conf
|
2023-12-27 23:55:35 +01:00
|
|
|
%config %{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf
|
|
|
|
%dir %{_datadir}/doc/%{name}
|
|
|
|
%{_datadir}/doc/%{name}/*
|
|
|
|
|
|
|
|
%changelog
|