pyamsoft / pstate-frequency

Easily control Intel p-state driver on Linux
https://pyamsoft.blogspot.com/
GNU General Public License v2.0
172 stars 19 forks source link

Add RPM Spec #25

Closed bensallen closed 5 months ago

bensallen commented 8 years ago

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)
pyamsoft commented 8 years ago

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.

bensallen commented 8 years ago

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.

ozky commented 7 years ago

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.

pyamsoft commented 7 years ago

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:

Hope this helps.

pyamsoft commented 5 months ago

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!