File steamos-manager.spec of Package steamos-manager

#
# spec file for package steamos-manager
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# 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:           steamos-manager
Version:        0+git20251117.e966573
Release:        0
Summary:        Abstraction for Steam's interactions with the operating system
License:        MIT
URL:            https://github.com/bazzite-org/steamos-manager
Source0:        %{name}-%{version}.tar.xz
Source1:        vendor.tar.zst
Patch0:         user-steamos-manager-service.patch
BuildRequires:  cargo
BuildRequires:  cargo-packaging
BuildRequires:  clang-devel
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  glib2-devel
BuildRequires:  rust
BuildRequires:  speech-dispatcher-devel
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libinput)
BuildRequires:  pkgconfig(libseat)
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(systemd)
BuildRequires:  pkgconfig(xkbcommon)

%description
SteamOS Manager is a system daemon that aims to abstract
Steam's interactions with the operating system. The goal
is to have a standardized interface so that SteamOS
specific features in the Steam client, e.g. TDP management,
can be exposed in any Linux distro that provides an
implementation of this DBus API.

%prep
%autosetup -p1 -a1

%build
%{cargo_build}

%install
# See Makefile
# Create the necessary directories
install -d -m0755 %{buildroot}%{_datadir}/dbus-1/interfaces/
install -d -m0755 %{buildroot}%{_datadir}/dbus-1/services/
install -d -m0755 %{buildroot}%{_datadir}/dbus-1/system-services/
install -d -m0755 %{buildroot}%{_sysconfdir}/dbus-1/system.d/
install -d -m0755 %{buildroot}%{_unitdir}/
install -d -m0755 %{buildroot}%{_userunitdir}/

install -D -m755 target/release/steamos-manager %{buildroot}%{_bindir}/steamos-manager
install -D -m755 target/release/steamosctl %{buildroot}%{_bindir}/steamosctl
install -D -m644 -t "%{buildroot}%{_datadir}/steamos-manager/devices" "data/devices/"*

install -m644 "data/platform.toml" "%{buildroot}%{_datadir}/steamos-manager/"
install -D -m644 -t "%{buildroot}%{_datadir}/dbus-1/interfaces/" "data/interfaces/"*

install -m644 data/system/com.steampowered.SteamOSManager1.service %{buildroot}%{_datadir}/dbus-1/system-services/
install -m644 data/system/com.steampowered.SteamOSManager1.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
install -m644 data/system/steamos-manager.service %{buildroot}%{_unitdir}/

install -m644 data/user/com.steampowered.SteamOSManager1.service %{buildroot}%{_datadir}/dbus-1/services/
install -m644 data/user/steamos-manager.service %{buildroot}%{_userunitdir}/
install -m644 data/user/steamos-manager-session-cleanup.service %{buildroot}%{_userunitdir}/

# Currently fails to compile
#%%check
#cargo test --release

%pre
%systemd_pre steamos-manager.service
%systemd_user_pre steamos-manager.service steamos-manager-session-cleanup.service

%post
%systemd_post steamos-manager.service
%systemd_user_post steamos-manager.service steamos-manager-session-cleanup.service

%preun
%systemd_preun steamos-manager.service
%systemd_user_preun steamos-manager.service steamos-manager-session-cleanup.service

%postun
%systemd_postun_with_restart steamos-manager.service
%systemd_user_postun_with_restart steamos-manager.service steamos-manager-session-cleanup.service

%files
%doc README.md
%license LICENSE
%{_bindir}/steamosctl
%{_bindir}/steamos-manager
%dir %{_datadir}/steamos-manager/
%dir %{_datadir}/steamos-manager/devices
%{_datadir}/steamos-manager/devices/*

%{_datadir}/steamos-manager/platform.toml
%{_datadir}/dbus-1/interfaces/*

%{_datadir}/dbus-1/system-services/com.steampowered.SteamOSManager1.service
%config %{_sysconfdir}/dbus-1/system.d/com.steampowered.SteamOSManager1.conf
%{_unitdir}/steamos-manager.service

%{_datadir}/dbus-1/services/com.steampowered.SteamOSManager1.service
%{_userunitdir}/steamos-manager.service
%{_userunitdir}/steamos-manager-session-cleanup.service

%changelog
openSUSE Build Service is sponsored by