pstate-frequency
pstate-frequency copied to clipboard
Add RPM Spec
Unsure where you'd want this in the repo, so including a quick RPM spec below.
Name: pstate-frequency
Version: 3.4.0
Release: 1
License: MIT
Summary: Easily control Intel p-state driver on Linux
Url: https://pyamsoft.github.io/pstate-frequency
Group: System
Source0: https://github.com/pyamsoft/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Requires: kernel-tools
Requires: coreutils
Requires: grep
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Pstate-frequency is able to adjust the Intel p-state driver values for the minimum and maximum scaling frequencies and the state of turbo boost.
%prep
%setup -q
%install
make PREFIX=%{_prefix} DESTDIR=%{buildroot} INCLUDE_SYSTEMD_UNIT=0 INCLUDE_BASH_COMPLETION=0 INCLUDE_UDEV_RULE=0 install
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%doc %{_docdir}/%{name}/README.md
%doc %{_docdir}/%{name}/LICENSE
%changelog
* Wed Apr 20 2016 3.4.0-1
- Initial release (v3.4.0-1)
I apologize as I am not too familiar with the RPM package structure.
How is this file meant to be used? Is it similar to an Arch Linux PKGBUILD, which is just a bash script executed by a special command? Assuming I have the snippet you show above, how would I use this to install pstate-frequency on an RPM based box?
If it is similar to the Arch PKGBUILD, I believe it would find a comfortable home in the
assets/rpm directory that could be created.
One would build it with rpmbuild -ba pstate-frequency.spec. pstate-frequency-%{version}.tar.gz would need to be in %{_topdir}/SOURCES already, typically ~/rpmbuild/SOURCES. To automate that a bit more we would need to create a small bash wrapper that creates the tarball from the running checkout first.
You should enable in that spec file udev rules and systemd service and files as distros use them,bash is default in most distos enable it too. Pstate-frequency need to change to enable install path by default to /usr/lib,systemd service files are installed there in many distros.
Hi there.
I hope I am understanding you correctly. The makefile "should" by default install the systemd, and shell completion files to /usr/{lib,share} as the location is required for programs like systemd and shell completion.
The default make file installs:
- The script to /usr/local
- Systemd service files and shell completion files to /usr/lib/systemd and /usr/share/bash_completion/completions and /usr/share/zsh/site-functions
- README and copy of License to /usr/local/share/doc/pstate-frequency
- Power Plans to /etc/pstate-frequency.d
Hope this helps.
Hi, its been a little while (8 years) :)
Just writing to let you know that after so long, I finally remembered this was a thing and copied the rpm spec into the source tree at assets/rpm
Though a bit has changed when the spec was originally wrote, so thus I was not able to use the originally included file, I believe I have a working spec. I don't have a bare metal RPM machine, but I did test the build in a Fedora 39 container.
After so long, I understand that life can change, but I just wanted to write to update you both. Thank you for your contribution to the project, I hope you have a good day!