%global debug_package %{nil} %global _missing_build_ids_terminate_build 0 Name: process_pillz Version: 0.1.0 Release: 0.1.beta%{?dist} Summary: Automatic performance profile switching daemon for Linux License: LGPL-2.1 ExclusiveArch: x86_64 URL: https://github.com/Llamatron2112/process_pillz Source0: https://github.com/Llamatron2112/process_pillz/archive/v0.1.0-beta.tar.gz BuildRequires: golang >= 1.21 BuildRequires: make BuildRequires: systemd-rpm-macros BuildRequires: git Requires: systemd Requires: dbus Requires: tuned Requires: /usr/bin/renice Recommends: scx-schedulers %description Process Pillz is a Linux daemon that automatically switches system performance profiles based on running processes. It monitors for specific processes (like games or applications) and applies optimized system configurations including CPU schedulers, TuneD profiles, and process nice values. Features: - Automatic profile switching based on running processes - SCX scheduler support for advanced CPU scheduling - TuneD integration for system optimization - Process nice value management - Systemd user service integration %prep %autosetup -n %{name}-0.1.0-beta %build # Set Go environment for build export GOPROXY=https://proxy.golang.org,direct export GOSUMDB=sum.golang.org export CGO_ENABLED=0 # Build the binary using the project's Makefile make build %install # Install using the project's Makefile with DESTDIR make install DESTDIR=%{buildroot} PREFIX=%{_prefix} # Install documentation install -d %{buildroot}%{_docdir}/%{name} install -m 644 README.md %{buildroot}%{_docdir}/%{name}/ install -m 644 LICENSE %{buildroot}%{_docdir}/%{name}/ %files %license LICENSE %doc %{_docdir}/%{name}/README.md %{_bindir}/%{name} %{_datadir}/%{name}/ %config(noreplace) %{_sysconfdir}/systemd/user/%{name}.service %config(noreplace) %{_sysconfdir}/systemd/user/%{name}-restarter.service %config(noreplace) %{_sysconfdir}/systemd/user/%{name}-restarter.path %post # Reload systemd user daemon for all users # Note: This only affects the system-wide user service templates /usr/bin/systemctl --global daemon-reload >/dev/null 2>&1 || : %preun # Stop the service for all users before uninstalling # Note: This is a best-effort approach since we can't easily iterate all users if [ $1 -eq 0 ]; then # Only on removal, not upgrade /usr/bin/systemctl --global disable %{name}.service >/dev/null 2>&1 || : fi %postun # Reload systemd user daemon after uninstall if [ $1 -eq 0 ]; then /usr/bin/systemctl --global daemon-reload >/dev/null 2>&1 || : fi %changelog * Fri July 11 2025 Package Maintainer - 0.1.0-0.1.beta - Initial RPM package for Process Pillz - Automatic performance profile switching daemon - SCX scheduler and TuneD integration - Systemd user service support - Configuration management and examples - Fixed COPR build compatibility issues - Fixed source URL to point to correct GitHub release # Build dependencies and runtime requirements: # # Build Requirements: # - golang >= 1.21 (required for building) # - make (uses project Makefile) # - systemd-rpm-macros (for systemd macros) # - git (may be needed for version info) # # Runtime Requirements: # - systemd (for user services) # - dbus (for system integration) # - tuned (for performance profile management) # - renice (for process priority management) # - scx-schedulers (recommended for advanced scheduling) # # Installation Notes: # - Binary installs to /usr/bin/process_pillz # - Systemd user services install to /etc/systemd/user/ # - Example configuration installs to /usr/share/process_pillz/ # - Documentation installs to /usr/share/doc/process_pillz/ # # Post-installation: # Users will need to: # 1. Copy example config: cp /usr/share/process_pillz/process_pillz.yaml.example ~/.config/process_pillz.yaml # 2. Edit configuration as needed # 3. Enable service: systemctl --user enable process_pillz # 4. Start service: systemctl --user start process_pillz # # Permissions: # Users may need to be added to appropriate groups or have sudo configured # for renice operations, depending on their security setup.