File power-options.spec of Package power-options

Name: power-options
Version: 1.1.0~0
Release: 0
Summary: Linux GUI application for blazingly fast and simple power-management. 
License: MIT
URL: https://github.com/TheAlexDev23/power-options
Source0:        %{name}-%{version}.tar.zst
Source1:        vendor.tar.zst
Requires: acpid
Requires: gtk4
Requires: glib2
Requires: zsh
Requires: pciutils
Requires: usbutils
Requires: pango
Requires: yad
Recommends: xset
Recommends: xautolock
Recommends: xrandr
Recommends: brightnessctl
Recommends: net-tools
BuildRequires: acpid
#Requires: pciutils
#Requires: usbutils
BuildRequires: rust
BuildRequires: cargo
BuildRequires: systemd-rpm-macros
BuildRequires:  cargo-packaging
BuildRequires: glib2-devel
BuildRequires: gtk4-devel
BuildRequires: gdk-pixbuf-devel
BuildRequires: libgraphene-devel
BuildRequires: libadwaita-devel
BuildRequires: libsoup-devel
BuildRequires: webkit2gtk3-devel
BuildRequires: xdotool-devel
BuildRequires: xdotool
BuildRequires: pkgconfig
BuildRequires: pkgconfig(gdk-3.0)
ExclusiveArch:  %{rust_tier1_arches}
%description
All-In-One blazingly fast Linux GUI Application for simple and advanced power management on any device.Power Options can be a drop in replacement for any power-saving application, including TLP, auto-cpufreq, cpupower-gui, etc. Power Options covers all of the most common power saving settings and adds additional ones not present in any other application.

%prep
%autosetup -p1 -a1
#export RUSTUP_TOOLCHAIN=stable
#cd crates/power-daemon-mgr
#cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
#cd ../frontend-gtk
#cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"


%build
#export RUSTUP_TOOLCHAIN=stable
#cd crates/power-daemon-mgr
#cargo build --frozen --release
#
#cd ../frontend-gtk
#cargo build --frozen --release
%{cargo_build}

%install
install -Dm755 "target/release/power-daemon-mgr" "%{buildroot}%{_bindir}/power-daemon-mgr"
"%{buildroot}%{_bindir}/power-daemon-mgr" -v generate-base-files --path "%{buildroot}" --program-path "%{_bindir}/power-daemon-mgr"

install -Dm755 "target/release/frontend-gtk" "%{buildroot}%{_bindir}/power-options-gtk"
install -Dm755 "icon.png" "%{buildroot}%{_datadir}/icons/power-options-gtk.png"
install -Dm755 "install/power-options-gtk.desktop" "%{buildroot}%{_datadir}/applications/power-options-gtk.desktop"


%files
%{_bindir}/power-daemon-mgr
%{_bindir}/power-options-gtk
%{_datadir}/icons/power-options-gtk.png
%{_datadir}/applications/power-options-gtk.desktop
%{_sysconfdir}/acpi/events/power-options
%{_prefix}/lib/systemd/system/power-options.service
%{_prefix}/lib/udev/rules.d/85-power-daemon.rules
%{_prefix}/share/dbus-1/system.d/power-daemon.conf

%post
%systemd_post power-options.service

%preun
%systemd_preun power-options.service

%postun
%systemd_postun_with_restart power-options.service

%changelog
* Wed Sep 18 2024 Leo Puvilland <luna@craftcat.dev> - 1.1.0
- Update to v1.1.0
* Mon Sep 16 2024 Leo Puvilland <luna@craftcat.dev> - 1.0.1
- Initial Package
openSUSE Build Service is sponsored by