2023-12-27 23:55:35 +01:00
|
|
|
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
|
|
|
|
|
|
|
Name: supergfxctl
|
2024-03-28 21:34:36 +01:00
|
|
|
Version: 5.2.1
|
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-03-09 20:43:53 +01:00
|
|
|
Group: System/Daemons
|
2023-12-27 23:55:35 +01:00
|
|
|
|
|
|
|
BuildRequires: cargo-packaging
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
|
|
BuildRequires: pkgconfig(libudev)
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
Requires: systemd
|
|
|
|
|
|
|
|
Conflicts: bumblebee
|
|
|
|
Conflicts: bumblebee-status-module-nvidia-optimus-manager
|
|
|
|
Conflicts: bbswitch
|
|
|
|
Conflicts: suse-prime
|
|
|
|
Conflicts: system76-power
|
|
|
|
|
|
|
|
%description
|
|
|
|
supergfxctl is a super graphics mode controller for laptops with hybrid nvidia.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -a1
|
|
|
|
|
|
|
|
%build
|
|
|
|
%cargo_build
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre supergfxd.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post supergfxd.service
|
2024-06-12 20:18:28 +02:00
|
|
|
if [ ! -e %{_sysconfdir}/modprobe.d/supergfxd.conf ]
|
2024-06-12 20:00:59 +02:00
|
|
|
then
|
|
|
|
systemctl enable supergfxd.service
|
|
|
|
fi
|
2023-12-27 23:55:35 +01:00
|
|
|
|
|
|
|
%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/supergfxd.conf ]
|
2023-12-27 23:55:35 +01:00
|
|
|
then
|
|
|
|
rm %{_sysconfdir}/modprobe.d/supergfxd.conf
|
|
|
|
fi
|
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
|
|
|
|
%{_unitdir}/supergfxd.service
|
|
|
|
%{_presetdir}/99-supergfxd.preset
|
|
|
|
%{_udevrulesdir}/90-supergfxd-nvidia-pm.rules
|
|
|
|
%config %{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf
|
|
|
|
%dir %{_datadir}/doc/%{name}
|
|
|
|
%{_datadir}/doc/%{name}/*
|
|
|
|
|
|
|
|
%changelog
|