File deckifier.spec of Package deckifier

%define TRUP_SOURCE /etc/trup/source.conf
%define BRANCH unstable
%define REPO devel:microos:yuga

Name:           deckifier
Version:        20240111.331e87a
Release:        0
Summary:        Missing bits for gamescope-session
License:        MIT
URL:            https://github.com/TobiPeterG/deckifier
Requires:       lightdm
BuildRequires:  lightdm
Requires:       gamescope-session-steam
BuildRequires:  sudo
Requires:       sudo
BuildRequires:  polkit
Requires:       jupiter-hw-support
BuildRequires:  jupiter-hw-support
Recommends:     (deckifier-session-kde or deckifier-session-gnome)
Conflicts:      gamescope-session-steam-generic
Requires:       polkit
Requires:       extest-32bit
BuildRequires:  steam
Requires:       steam
Requires:       steam-powerbuttond
BuildArch:      noarch
Source0:        %{name}-%{version}.tar.xz

%description
Missing bits for gamescope-session to run the Steam session.

%prep
%setup -q -n %{name}-%{version}

%build

%install
cp -rv deckifier/usr %{buildroot}/usr
cp -rv deckifier/etc %{buildroot}/etc
#fix /bin/env RPM dependencies
%{__sed} -i '1s|^#!/usr/bin/env xdg-open|#!/usr/bin/xdg-open|' %{buildroot}/usr/share/applications/*.desktop
#set trup branch and repo
%{__sed} -i "s/^REPO=.*/REPO=%{REPO}/" %{buildroot}%{TRUP_SOURCE}
%{__sed} -i "s/^BRANCH=.*/BRANCH=%{BRANCH}/" %{buildroot}%{TRUP_SOURCE}
%{__sed} -i "s/^OLD_REPO=.*/OLD_REPO=%{REPO}/" %{buildroot}%{TRUP_SOURCE}
%{__sed} -i "s/^OLD_BRANCH=.*/OLD_BRANCH=%{BRANCH}/" %{buildroot}%{TRUP_SOURCE}

mkdir -p %{buildroot}/usr/share/applications/steam
cp /usr/share/applications/steam.desktop %{buildroot}/usr/share/applications/steam/steam.desktop
sed -i "s,Exec=/usr/bin/steam,Exec=env LD_PRELOAD=/usr/lib/libextest.so /usr/bin/steam," %{buildroot}/usr/share/applications/steam/steam.desktop

ln -s /usr/share/applications/steam/steam.desktop %{buildroot}/etc/skel/Desktop/steam.desktop



%post
%systemd_user_post gamescope-session.service
%systemd_post bluetooth-workaround.service
%systemd_post steamos-startup.service

%preun
%systemd_user_preun gamescope-session.service
%systemd_preun bluetooth-workaround.service
%systemd_preun steamos-startup.service

%postun
%systemd_user_postun_with_restart gamescope-session.service
%systemd_postun_with_restart bluetooth-workaround.service
%systemd_postun_with_restart steamos-startup.service


%files
%config(noreplace)/etc/bluetooth/*
%config(noreplace)/etc/dconf/*
/usr/share/applications/steam
%dir /usr/share/polkit-1/localauthority.conf.d
/usr/share/polkit-1/localauthority.conf.d/*
/usr/share/polkit-1/rules.d/*
%config(noreplace)/etc/sudoers.d/*
/usr/lib/systemd/*
%config(noreplace)/etc/xdg/*
%dir /etc/trup
%config(noreplace) /etc/trup/source.conf
/usr/share/applications/*
/usr/share/icons/valve
/usr/share/icons/valve/*
%dir /etc/bluetooth
%dir /etc/dconf
%dir /usr/lib/systemd
%dir /etc/lightdm/lightdm.conf.d
%dir /etc/skel/Desktop
%dir /etc/skel/.config
%dir /etc/skel/.config/autostart
%config(noreplace)/etc/lightdm/lightdm.conf
%config(noreplace)/etc/lightdm/lightdm.conf.d/00-autologin-user.conf
%config(noreplace)/etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
%config(noreplace)/etc/skel/.config/autostart/*
%config(noreplace)/etc/skel/Desktop/*
/usr/share/color
/usr/share/color/*
/usr/bin/factory-reset
/usr/bin/steamos-select-branch
/usr/bin/steamos-session-select
/usr/bin/steamos-update
/usr/bin/steam-vr-launcher
/usr/bin/steamos-startup-gamescope
/usr/bin/steamos-factory-reset-config
/usr/bin/trup
/usr/lib/udev/rules.d/30-steamdeck.rules
/usr/bin/steamos-polkit-helpers/steamos-factory-reset

%changelog
openSUSE Build Service is sponsored by