File oneplus6-helpers.spec of Package oneplus6-helpers

#
# spec file for package mobile-helpers
#
# Copyright (c) 2022 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:           oneplus6-helpers
Version:        0.5.7
Release:        1%{?dist}
Summary:        Necessary Oneplus 6 files
License:        GPL-2.0-only AND GPL-3.0-or-later
URL:            https://gitlab.com/slem.os/%{name}
Source0:        devel.repomd.xml.key
Source1:        sdm845.repomd.xml.key
Source3:        mobile-helpers-boot.service
Source4:        mobile-helpers-start.sh
Source5:        sdm845-setup.service
Source6:        sdm845-setup
Source7:        71-oneplus6.rules 
Source9:        quick-suspend-resume.conf
Source10:       10-oneplus6-dracut.conf
Source11:       devicemodules.conf
Source19:       config.toml
Source12:       opensuse-profile.sh
Source13:       99-automount-sd.rules
Source14:       UPower.conf
Source15:       q6voiced.conf
Source16:       sdm845-audio-fix.conf
Source18:       greetd
Source21:       opensuse-background.png
Source26:       menuback.png
Source27:       lockscreen.png
Source23:       90-feedbackd-spmi.rules
Source25:       opensuse-plamo-gtk-theme.sh
Source28:       gtk.css
Source29:       90-modem-manager.rules
Source30:       90-wifi-hotspot.rules
Source31:       oneplus-tweaks
Source32:       oneplus-tweaks.service
Source33:       91-modem-manager.rules
Source34:       call_audio_idle_suspend_workaround.sh
Source35:       call_audio_idle_suspend_workaround.service
Source36:       51-qcom-sdm845.conf
Source37:       81-libssc-oneplus-enchilada.rules
#Source38:       ssc-iio-sensor-proxy.conf
Source39:       hexagonrpc-sdsp.conf
Source40:       10-pipewire-libcamera.conf
BuildRequires:  alsa
BuildRequires:  pam
BuildRequires:  systemd-rpm-macros
BuildRequires:  ModemManager
BuildRequires:  upower
BuildRequires:  dracut
BuildRequires:  wireplumber
BuildRequires:  pipewire
#Requirements for Wifi, Modem and GPU
Requires:       pd-mapper
Requires:       qrtr
Requires:       libqrtr1
Requires:       tqftpserv
Requires:       q6voiced
Requires:       libtinyalsa2
Requires:       tinyalsa
Requires:       alsa-ucm-conf-sdm845
Requires:       rmtfs
Requires:       ModemManager >= 1.18.10
Requires:       libqmi-tools
Requires:       NetworkManager-wwan
Requires:       callaudiod
Requires:       pulseaudio-utils
#Requirements for Camera
Requires:       gstreamer-plugins-libcamera
Requires:       libcamera-base0_5
Requires:       libcamera0_5
Requires:       libcamera-tools
Requires:       libpisp
Requires:       snapshot
Requires:       ffmpeg
#General requirements
Requires:       plymouth
Requires:       plymouth-branding-openSUSE
Requires:       python3-pyserial
Requires:       python3-requests
Requires:       upower
Requires:       tar
Requires:       flatpak
Requires:       at-spi2-core
#Requirements for Oneplus
Requires:       libdrm_freedreno1 
Requires:       libvulkan_freedreno
Requires:       qbootctl
Requires:       bootmac
Requires:       swclock-offset
Requires:       firmware-oneplus-sdm845
Requires:       hexagonrpc
Requires:       ssc
Requires:       iio-sensor-proxy
Requires:       minimal-initramfs
Requires:       buffybox-unl0kr
Requires:       buffybox-unl0kr-dracut
Requires:       libinput-tools
#Require the openSUSE logos
Requires:       distribution-logos-openSUSE
Requires:       distribution-logos-openSUSE-icons
Recommends:     geoclue2
Suggests:       avahi
Requires:       pulseaudio >= 14.0
#Requires:      ((pulseaudio >= 14.0) or (pipewire-pulseaudio and pipewire-alsa))
Requires:       pipewire
Conflicts:      tlp

BuildArch:      noarch

%description
Shell independent setup helpers for the PinePhone.
Includes configuration scripts for proper modem
initialization and system setup.

%package -n plasma-helpers
Summary:        Plasma Mobile scripts
Requires:       ModemManager
Conflicts:      ofono
#Requires:       greetd
#work around sddm getting recommended in Plasma and replacing greetd
#Conflicts:      sddm

%description -n plasma-helpers
%{summary}.

%prep

%build

%install
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/mobile-helpers %{SOURCE0} %{SOURCE1} %{SOURCE19} %{SOURCE28} %{SOURCE14} %{SOURCE11}
%{__install} -Dm0644 -t %{buildroot}%{_unitdir} %{SOURCE3} %{SOURCE5} %{SOURCE32}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/profile.d/ %{SOURCE12} %{SOURCE25}
%{__install} -Dm0755 -t %{buildroot}%{_bindir} %{SOURCE4}  %{SOURCE6} %{SOURCE31} %{SOURCE34}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/pam.d/ %{SOURCE18}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/wallpapers/ %{SOURCE21} %{SOURCE26} %{SOURCE27}
%{__install} -Dm0644 -t %{buildroot}%{_udevrulesdir} %{SOURCE23}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/polkit-1/rules.d/ %{SOURCE29} %{SOURCE30} %{SOURCE33}
%{__install} -Dm0644 -t %{buildroot}%{_unitdir}/ModemManager.service.d/ %{SOURCE9}
#%{__install} -Dm0644 -t %{buildroot}%{_unitdir}/iio-sensor-proxy.service.d/ %{SOURCE38}
%{__install} -Dm0644 -t %{buildroot}%{_unitdir}/alsa-restore.service.d/ %{SOURCE16}
%{__install} -Dm0644 -t %{buildroot}%{_udevrulesdir} %{SOURCE7} %{SOURCE37}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/dracut.conf.d/ %{SOURCE10}
%{__install} -Dm0644  %{SOURCE15} %{buildroot}%{_sysconfdir}/conf.d/q6voiced
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/hexagonrpcd/ %{SOURCE39}
%{__install} -Dm0644 -t %{buildroot}%{_userunitdir} %{SOURCE35}
%{__install} -Dm0644 -t %{buildroot}%{_userunitdir}/pipewire.service.d/ %{SOURCE40}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/wireplumber/wireplumber.conf.d/ %{SOURCE36}


%pre -n %{name}
%service_add_pre mobile-helpers-boot.service call_audio_idle_suspend_workaround.service

%post -n %{name}
%service_add_post mobile-helpers-boot.service call_audio_idle_suspend_workaround.service
systemctl --user enable call_audio_idle_suspend_workaround.service

%preun -n %{name}
%service_del_preun mobile-helpers-boot.service call_audio_idle_suspend_workaround.service

%postun -n %{name}
%service_del_postun_without_restart mobile-helpers-boot.service call_audio_idle_suspend_workaround.service

%files
%attr(0755,root,root) %dir %{_datadir}/mobile-helpers/
%attr(0644,root,root) %{_datadir}/mobile-helpers/{config.toml,devel.repomd.xml.key,sdm845.repomd.xml.key,gtk.css,UPower.conf,devicemodules.conf}
%config %{_sysconfdir}/pam.d/*
%config %{_sysconfdir}/profile.d/opensuse-profile.sh
%dir %{_sysconfdir}/conf.d/
%config %{_sysconfdir}/conf.d/*
%{_unitdir}/*
%{_bindir}/*
%{_udevrulesdir}/*
%{_datadir}/wallpapers/
%{_sysconfdir}/dracut.conf.d/
%{_userunitdir}/*
%{_userunitdir}/pipewire.service.d/*
%{_datadir}/wireplumber/wireplumber.conf.d/*
%dir %{_datadir}/hexagonrpcd/
%{_datadir}/hexagonrpcd/*

%files -n plasma-helpers
%config %{_sysconfdir}/profile.d/opensuse-plamo-gtk-theme.sh
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/rules.d/
%{_datadir}/polkit-1/rules.d/*

%changelog
openSUSE Build Service is sponsored by