mirror of
https://abf.rosa.ru/djam/asusctl.git
synced 2025-02-23 16:52:57 +00:00
154 lines
5.1 KiB
RPMSpec
154 lines
5.1 KiB
RPMSpec
%global debug_package %{nil}
|
|
|
|
%global rpm_dkms_opt 1
|
|
|
|
# Use hardening ldflags.
|
|
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
|
|
|
%define vendor_id 386fd37e8a3185dba7ec57dacdb025fc
|
|
%define rustver 1.83.0
|
|
|
|
Summary: Control fan speeds, LEDs, graphics modes, and charge levels for ASUS notebooks
|
|
Name: asusctl
|
|
Version: 6.0.12
|
|
Release: 1
|
|
License: MPLv2
|
|
Group: System/Kernel and hardware
|
|
URL: https://gitlab.com/asus-linux/asusctl
|
|
Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz
|
|
#Source1: %{url}/uploads/99346eba22c845fcdc7570ad6abbea7b/vendor_%{name}_%{version}.tar.xz
|
|
Source1: https://gitlab.com/-/project/20328305/uploads/%{vendor_id}/vendor_%{name}_%{version}.tar.xz
|
|
Source2: cargo_config
|
|
Source1000: %{name}.rpmlintrc
|
|
Patch0: %{name}-makefile.patch
|
|
%if %{mdvver} > 201610
|
|
BuildRequires: rust
|
|
BuildRequires: cargo
|
|
%endif
|
|
BuildRequires: cmake
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
BuildRequires: pkgconfig(libudev)
|
|
BuildRequires: pkgconfig(gtk+-3.0)
|
|
BuildRequires: pkgconfig(gdk-3.0)
|
|
BuildRequires: pkgconfig(systemd)
|
|
BuildRequires: desktop-file-utils
|
|
BuildRequires: imagemagick
|
|
BuildRequires: curl
|
|
BuildRequires: git-core
|
|
Requires: %{_lib}appindicator3-gir0.1
|
|
Recommends: power-profiles-daemon
|
|
|
|
%description
|
|
asus-nb-ctrl is a utility for Linux to control many aspects of various
|
|
ASUS laptops but can also be used with non-Asus laptops with reduced features.
|
|
|
|
It provides an interface for rootless control of some system functions such as
|
|
fan speeds, keyboard LEDs, battery charge level, and graphics modes.
|
|
asus-nb-ctrl enables third-party apps to use the above with dbus methods.
|
|
|
|
%files
|
|
%doc LICENSE README.md
|
|
%{_bindir}/asusd
|
|
%{_bindir}/asusd-user
|
|
%{_bindir}/asusctl
|
|
%{_userunitdir}/asusd-user.service
|
|
%{_unitdir}/asusd.service
|
|
%{_udevrulesdir}/99-asusd.rules
|
|
%{_datadir}/dbus-1/system.d/asusd.conf
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_yellow.png
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_green.png
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_red.png
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_blue.png
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_orange.png
|
|
%{_datadir}/icons/hicolor/*/apps/asus_notif_white.png
|
|
%{_datadir}/icons/hicolor/scalable/status/gpu-compute.svg
|
|
%{_datadir}/icons/hicolor/scalable/status/gpu-hybrid.svg
|
|
%{_datadir}/icons/hicolor/scalable/status/gpu-integrated.svg
|
|
%{_datadir}/icons/hicolor/scalable/status/gpu-nvidia.svg
|
|
%{_datadir}/icons/hicolor/scalable/status/gpu-vfio.svg
|
|
%{_datadir}/icons/hicolor/scalable/status/notification-reboot.svg
|
|
%{_datadir}/asusd/
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
%package rog-gui
|
|
Summary: An experimental GUI for %{name}
|
|
Requires: %{name}
|
|
|
|
%description rog-gui
|
|
A one-stop-shop GUI tool for asusd/asusctl. It aims to provide most controls,
|
|
a notification service, and ability to run in the background.
|
|
|
|
%files rog-gui
|
|
%doc LICENSE rog-anime/README.md rog-anime/data/diagonal-template.png
|
|
%{_bindir}/rog-control-center
|
|
%{_datadir}/applications/rog-control-center.desktop
|
|
%{_datadir}/icons/hicolor/*/apps/rog-control-center.png
|
|
%{_datadir}/rog-gui
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
%prep
|
|
#autosetup
|
|
%setup -q
|
|
#setup -D -T -a 1
|
|
|
|
#patch0 -p1
|
|
|
|
#mv Cargo.lock{,.bak}
|
|
#cargo_prep
|
|
#mv Cargo.lock{.bak,}
|
|
#sed -i 's|replace-with = "local-registry"|replace-with = "vendored-sources"|' .cargo/config
|
|
#cat %{SOURCE2} >> .cargo/config
|
|
|
|
%if %{mdvver} <= 201610
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |\
|
|
sh -s -- -y --profile default --default-toolchain %{rustver}
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%build
|
|
#export RUSTFLAGS="%{rustflags}"
|
|
#cargo_build
|
|
|
|
%if %{mdvver} <= 201610
|
|
source "$HOME/.cargo/env"
|
|
%endif
|
|
|
|
cargo build --release
|
|
#--frozen
|
|
#--offline
|
|
#--config .cargo/config.toml
|
|
|
|
%install
|
|
#export RUSTFLAGS="%{rustflags}"
|
|
#mkdir -p "%{buildroot}/%{_bindir}" "%{buildroot}%{_docdir}"
|
|
%make_install
|
|
|
|
# install icons
|
|
for x in 16 24 32 48 64 96 128 256; do
|
|
install -d %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/
|
|
|
|
pushd data/icons
|
|
convert -resize ${x}x${x} asus_notif_yellow.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_yellow.png
|
|
convert -resize ${x}x${x} asus_notif_green.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_green.png
|
|
convert -resize ${x}x${x} asus_notif_red.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_red.png
|
|
convert -resize ${x}x${x} asus_notif_blue.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_blue.png
|
|
convert -resize ${x}x${x} asus_notif_orange.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_orange.png
|
|
convert -resize ${x}x${x} asus_notif_white.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/asus_notif_white.png
|
|
popd
|
|
|
|
pushd rog-control-center/data
|
|
convert -resize ${x}x${x} rog-control-center.png %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/rog-control-center.png
|
|
popd
|
|
|
|
done
|
|
|
|
# install unit service && udev roles
|
|
install -Dm0644 data/asusd.rules %{buildroot}%{_udevrulesdir}/99-asusd.rules
|
|
install -Dm0644 data/asusd.service %{buildroot}%{_unitdir}/asusd.service
|
|
|
|
|
|
desktop-file-validate %{buildroot}/%{_datadir}/applications/rog-control-center.desktop
|