File LACT.spec of Package LACT
#
# 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/
#
Name: LACT
Version: 0.7.0
Release: 0
Summary: Linux AMDGPU Controller
License: MIT
URL: https://github.com/ilya-zlobintsev/LACT
Source: https://github.com/ilya-zlobintsev/LACT/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.xz
Source2: series
Patch1: dont-strip-it.patch
Patch2: install-headless.patch
Patch3: service-use-headless.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: clang-devel
BuildRequires: pkgconfig(gtk4)
BuildRequires: pkgconfig(libdrm)
BuildRequires: blueprint-compiler
BuildRequires: pkgconfig(libadwaita-1)
BuildRequires: pkgconfig(systemd)
Requires: %{name}-daemon = %{version}-%{release}
%description
This application allows you to control your AMD GPU on a Linux system.
%package daemon
Summary: Linux AMDGPU Controller - headless binary
%description daemon
This application allows you to control your AMD GPU on a Linux system.
This package holds a headless binary without all the GUI dependencies.
%prep
%autosetup -a 1 -p 1
%build
%{cargo_build} -p lact --no-default-features --features=adw
mv target/release/lact{,-headless}
%{cargo_build} -p lact --features=adw
%install
%make_install PREFIX="%{_prefix}"
%pre
%service_add_pre lactd.service
%preun
%service_del_preun lactd.service
%post
%service_add_post lactd.service
%postun
%service_del_postun lactd.service
%files
%license LICENSE
%doc *.md
%{_bindir}/lact
%{_datadir}/applications/io.github.lact-linux.desktop
%{_datadir}/pixmaps/io.github.lact-linux.png
%{_datadir}/icons/hicolor/scalable/apps/io.github.lact-linux.svg
%files daemon
%{_bindir}/lact-headless
%{_unitdir}/lactd.service
%license LICENSE
%doc *.md
%changelog