File pinephone-helpers.spec of Package pinephone-helpers

#
# spec file for package pinephone-helpers
#
# Copyright (c) 2025 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/
#

%define dracutlibdir %{_prefix}/lib/dracut

Name:           pinephone-helpers
Version:        0.5.4
Release:        1%{?dist}
Summary:        Necessary PinePhone files
License:        GPL-2.0-only AND GPL-3.0-or-later
URL:            https://gitlab.com/slem.os/%{name}
Source0:        HiFi.conf
Source1:        VoiceCall.conf
Source2:        PinePhone.conf
Source3:        pinephone-boot.service
Source4:        pp-start.sh
Source5:        pinephone-modem-boot.service
Source6:        eg25_setup.sh
Source7:        90-modem-eg25.rules
Source8:        repomd.xml.key
Source9:        device-hook
Source10:       pinephone-gps.service
Source12:       opensuse-profile.sh
Source13:       99-automount-sd.rules
Source14:       boot.script
Source15:       10-pinephone-dracut.conf 
Source16:       devicemodules.conf
Source17:       kwinwrapper
Source18:       greetd
Source19:       config.toml
Source20:       10-proximity.rules
Source21:       opensuse-background.png
Source23:       20-pinephone-led.rules
Source24:       90-pinephone.conf
Source25:       opensuse-plamo-gtk-theme.sh
Source26:       menuback.png
Source27:       lockscreen.png
Source28:       gtk.css
Source29:       90-modem-manager.rules
Source30:       90-wifi-hotspot.rules
 
BuildRequires:  alsa
BuildRequires:  pam
BuildRequires:  systemd-rpm-macros
BuildRequires:  dracut
#Modem, GPU and sensors
Requires:       atinout
Requires:       eg25-manager
Requires:       gpsd
Requires:       iio-sensor-proxy
#FDE
Requires:       minimal-initramfs
Requires:       buffybox-unl0kr
Requires:       buffybox-unl0kr-dracut
Requires:       u-boot-tools
Requires:       busybox-static
#Requirements for Camera
Requires:       gstreamer-plugins-libcamera
Requires:       libcamera-base0_5
Requires:       libcamera0_5
Requires:       libcamera-tools
Requires:       libpisp
Requires:       snapshot
Requires:       ffmpeg
#General
Requires:       plymouth
Requires:       python3-pyserial
Requires:       python3-requests
#Require the openSUSE logos
Requires:       distribution-logos-openSUSE
Requires:       distribution-logos-openSUSE-icons
Recommends:     geoclue2
Suggests:       avahi
Requires:       pipewire-pulseaudio
#Requires:       ((pulseaudio >= 14.0) or (pipewire-pulseaudio and pipewire-alsa))
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}/alsa/ucm2/PinePhone/ %{SOURCE0} %{SOURCE1} %{SOURCE2}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/pp-helpers %{SOURCE8} %{SOURCE19} %{SOURCE28}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/mobile-helpers %{SOURCE14} %{SOURCE16}
%{__install} -Dm0644 -t %{buildroot}%{_unitdir} %{SOURCE3} %{SOURCE5} %{SOURCE10}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/profile.d/ %{SOURCE12} %{SOURCE25}
%{__install} -Dm0755 -t %{buildroot}%{_sysconfdir}/gpsd/ %{SOURCE9}
%{__install} -Dm0755 -t %{buildroot}%{_bindir} %{SOURCE6} %{SOURCE4} %{SOURCE17}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/pam.d/ %{SOURCE18}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/wallpapers/ %{SOURCE21} %{SOURCE26} %{SOURCE27}
%{__install} -Dm0644 -t %{buildroot}%{_udevrulesdir} %{SOURCE7} %{SOURCE20} %{SOURCE23}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/dracut.conf.d/ %{SOURCE15}
%{__install} -Dm0644 -t %{buildroot}%{_sysconfdir}/pulse/daemon.conf.d/ %{SOURCE24}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/polkit-1/rules.d/01-org.freedesktop.ModemManager.rules %{SOURCE29}
%{__install} -Dm0644 -t %{buildroot}%{_datadir}/polkit-1/rules.d/  %{SOURCE30}

%pre -n %{name}
%service_add_pre pinephone-boot.service pinephone-gps.service pinephone-modem-boot.service

%post -n %{name}
%service_add_post pinephone-boot.service pinephone-gps.service pinephone-modem-boot.service

%preun -n %{name}
%service_del_preun pinephone-boot.service pinephone-gps.service pinephone-modem-boot.service

%postun -n %{name}
%service_del_postun_without_restart pinephone-boot.service pinephone-gps.service pinephone-modem-boot.service

%files
%attr(0755,root,root) %dir %{_datadir}/pp-helpers/
%attr(0644,root,root) %{_datadir}/pp-helpers/{config.toml,repomd.xml.key,gtk.css}
%attr(0755,root,root) %dir %{_datadir}/mobile-helpers/
%attr(0644,root,root) %{_datadir}/mobile-helpers/{devicemodules.conf,boot.script}
%config %{_sysconfdir}/pam.d/*
%config %{_sysconfdir}/profile.d/opensuse-profile.sh
%config %{_sysconfdir}/pulse/
%{_datadir}/alsa/ucm2/PinePhone/
%{_sysconfdir}/gpsd/
%{_bindir}/*
%{_unitdir}/*
%{_udevrulesdir}/*
%{_datadir}/wallpapers/
%{_sysconfdir}/dracut.conf.d/

%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