diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72bc5ee..a1613f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: rust-arraydeque/* rust-nonempty/* rust-rust-ini0.20/* + t2fanrd/* dir_names: "true" - name: "Increase Disk Space" diff --git a/.github/workflows/copr-webhooks.yml b/.github/workflows/copr-webhooks.yml index ceea222..55ba5ae 100644 --- a/.github/workflows/copr-webhooks.yml +++ b/.github/workflows/copr-webhooks.yml @@ -12,6 +12,7 @@ on: - "rust-arraydeque/*" - "rust-nonempty/*" - "rust-rust-ini0.20/*" + - "t2fanrd/*" jobs: copr-webhook: diff --git a/build-packages.sh b/build-packages.sh index 1ed6c28..7ef589f 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -2,7 +2,7 @@ set -e if [ $# -eq 0 ]; then - packages=( "t2linux-config" "t2linux-audio" "rust-tiny-dfr" "kernel" "copr-sharpenedblade-t2linux-release" "rust-arraydeque" "rust-nonempty" "rust-rust-ini0.20" ) + packages=( "t2linux-config" "t2linux-audio" "rust-tiny-dfr" "kernel" "copr-sharpenedblade-t2linux-release" "rust-arraydeque" "rust-nonempty" "rust-rust-ini0.20" "t2fanrd" ) else packages=( "$@" ) fi diff --git a/t2fanrd/t2fanrd.service b/t2fanrd/t2fanrd.service new file mode 100644 index 0000000..db5ee56 --- /dev/null +++ b/t2fanrd/t2fanrd.service @@ -0,0 +1,34 @@ +[Unit] +Description=T2FanRD daemon to manage fan curves for t2 macs + +[Service] +Type=exec +ExecStart=t2fanrd +Restart=always + +PrivateTmp=true +ProtectSystem=true +ProtectHome=true +ProtectClock=true +ProtectHostname=true +ProtectControlGroups=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectKernelModules=true +ProtectProc=invisible +PrivateDevices=true +PrivateNetwork=true +NoNewPrivileges=true +DevicePolicy=closed +KeyringMode=private +LockPersonality=true +MemoryDenyWriteExecute=true +PrivateUsers=yes +RemoveIPC=yes +RestrictNamespaces=yes +RestrictRealtime=yes +RestrictSUIDSGID=yes +SystemCallArchitectures=native + +[Install] +WantedBy=multi-user.target diff --git a/t2fanrd/t2fanrd.spec b/t2fanrd/t2fanrd.spec new file mode 100644 index 0000000..4dec1e4 --- /dev/null +++ b/t2fanrd/t2fanrd.spec @@ -0,0 +1,68 @@ +%global forgeurl https://github.com/GnomedDev/T2FanRD +%global commit 68859ca5f858d542444c64391faa90678afb6995 +%forgemeta -iv + +%bcond_without check + +# prevent library files from being installed +%global __cargo_is_lib() 0 + +%global crate t2fanrd + +Name: t2fanrd +Version: 0.1.0 +Release: 1%{?dist} +Summary: Simple Fan Daemon for T2 Macs + +SourceLicense: GPL-3.0-or-later +License: GPL-3.0-or-later AND Apache-2.0 OR MIT AND MIT + +URL: %{forgeurl} +Source0: %{forgesource} +Source1: t2fanrd.service + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: systemd-rpm-macros + +%description +Simple Fan Daemon for T2 Macs. + +%prep +%forgeautosetup -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install +install -Dpm0644 -t %{buildroot}%{_unitdir} %{SOURCE1} + +%if %{with check} +%check +%cargo_test +%endif + +%post +%systemd_post %{crate}.service + +%preun +%systemd_preun %{crate}.service + +%postun +%systemd_postun_with_restart %{crate}.service + +%files +%license LICENCE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/%{crate} +%{_unitdir}/%{crate}.service + +%changelog +%autochangelog