Bug 1767998 (mbpfan) - Review Request: mbpfan - A simple daemon to control fan speed on all MacBook/MacBook Pros
Summary: Review Request: mbpfan - A simple daemon to control fan speed on all MacBook/...
Keywords:
Status: CLOSED ERRATA
Alias: mbpfan
Product: Fedora
Classification: Fedora
Component: Package Review
Version: 31
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-01 20:18 UTC by Lyes Saadi
Modified: 2020-01-12 01:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-12 01:41:11 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description Lyes Saadi 2019-11-01 20:18:18 UTC
Spec URL: https://gitlab.com/LyesSaadi/spec/blob/master/mbpfan/mbpfan.spec

SRPM URL:
Copr Repo available, link to SRPM: https://copr-be.cloud.fedoraproject.org/results/lyessaadi/mbpfan/fedora-31-x86_64/01083317-mbpfan/mbpfan-2.2.0-2.fc31.src.rpm 
And for Koji enthusiasts: https://koji.fedoraproject.org/koji/taskinfo?taskID=38715566 

Description:
This is an enhanced version of Allan McRae mbpfan

mbpfan is a daemon that uses input from coretemp module and sets the
fan speed using the applesmc module. This enhanced version assumes any
number of processors and fans (max. 10).

* It only uses the temperatures from the processors as input.
* It requires coretemp and applesmc kernel modules to be loaded.
* It requires root use
* It daemonizes or stays in foreground
* Verbose mode for both syslog and stdout
* Users can configure it using the file /etc/mbpfan.conf

Fedora Account System Username: lyessaadi

Note: This is my first ever contribution to Fedora. So, I'll need a sponsor.
Note2: This package is for MacBook users. So, without appropriate hardware, you won't be able to test it.

Comment 1 Dominik 'Rathann' Mierzejewski 2019-11-09 17:27:11 UTC
Some quick comments:

https://gitlab.com/LyesSaadi/spec/blob/master/mbpfan/mbpfan.spec#L9
It's a matter of preference, but I'd recommend putting each build dependency in a separate line and sorting them alphabetically.

https://gitlab.com/LyesSaadi/spec/blob/master/mbpfan/mbpfan.spec#L30
Please use %make_build macro unless you have a good reason not to. I don't see Fedora-mandated compiler flags being used during build, so please try adding %set_build_flags before calling make and if that doesn't help, you might need to patch the Makefile.

https://gitlab.com/LyesSaadi/spec/blob/master/mbpfan/mbpfan.spec#L32
You can fold each mkdir+cp pair into install -Dp call to make it shorter, but do at least use cp -p to preserve build-time timestamps.

Comment 2 Dominik 'Rathann' Mierzejewski 2019-11-09 17:28:47 UTC
Also, you should run the tests (https://github.com/linux-on-mac/mbpfan#run-the-tests-optional) in %check section, if possible.

Comment 3 Lyes Saadi 2019-11-09 17:41:51 UTC
> It's a matter of preference, but I'd recommend putting each build dependency in a separate line and sorting them alphabetically.

> You can fold each mkdir+cp pair into install -Dp call to make it shorter, but do at least use cp -p to preserve build-time timestamps.

I'll do it. Thanks for the advice :D!

> Please use %make_build macro unless you have a good reason not to. I don't see Fedora-mandated compiler flags being used during build, so please try adding %set_build_flags before calling make and if that doesn't help, you might need to patch the Makefile.

Yeah, just a little reason. The make file tries to install the systemd service in /lib instead of /usr/lib (it only creates the folder, though). So, I thought it was maybe better not to, especially that the program is pretty simple to install manually. If you think I should do otherwise, tell me, I was myself not sure if I should do it or not.

> Also, you should run the tests (https://github.com/linux-on-mac/mbpfan#run-the-tests-optional) in %check section, if possible.

The tests are optional and might fail if the fans are running too fast. While installing from source, it is easy to understand to it's just a false positive, a user using DNF won't and it'll print some scary errors.

See https://github.com/linux-on-mac/mbpfan/issues/198

Thank you a lot for looking into my spec file :)!

Comment 4 Lyes Saadi 2019-11-09 18:22:09 UTC
I've updated the spec file :)! And made a koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=38865485 !

I hope everything is good :D!

Comment 5 Andrew Gaul 2019-11-09 22:39:31 UTC
> > Also, you should run the tests (https://github.com/linux-on-mac/mbpfan#run-the-tests-optional) in %check section, if possible.
> 
> The tests are optional and might fail if the fans are running too fast.
> While installing from source, it is easy to understand to it's just a false
> positive, a user using DNF won't and it'll print some scary errors.
> 
> See https://github.com/linux-on-mac/mbpfan/issues/198

I co-maintain mbpfan and prefer not running the tests.  Previously we recommended this when mbpfan worked in a more manual configuration way but we are moving towards automatically detecting everything and requiring no input from the user.

Comment 7 Robert-André Mauchin 🐧 2019-12-10 21:02:36 UTC
 - Use a better name for your archive:

Source0:    https://github.com/linux-on-mac/mbpfan/archive/v%{version}/%{name}-%{version}.tar.gz

 - Not ok: you need to build with Fedora's build flags:

%build
%set_build_flags
%make_build

 - You need to add the SystemD scriptlets:

https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd

BuildRequires: systemd-rpm-macros

[…]

%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

 - Remove the executable bits 

mbpfan.x86_64: W: spurious-executable-perm /usr/share/man/man8/mbpfan.8.gz

you should specify mode with -m:

%install
# Installing the binary
install -Dpm 0755 -t %{buildroot}%{_sbindir}/ bin/%{name}

# Installing the systemd service
install -Dpm 0644 -t %{buildroot}%{_unitdir}/ %{name}.service

# Installing the configuration file
install -Dpm 0644 -t %{buildroot}/etc/ %{name}.conf

# Installing the manual
install -Dpm 0644 -t %{buildroot}%{_mandir}/man8/ %{name}.8.gz

Comment 8 Robert-André Mauchin 🐧 2019-12-10 21:03:31 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- systemd_post is invoked in %post, systemd_preun in %preun, and
  systemd_postun in %postun for Systemd service files.
  Note: Systemd service file(s) in mbpfan
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Scriptlets/#_scriptlets


===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "GPL (v3 or later)", "GNU Lesser
     General Public License (v3 or later)". 22 files have unknown license.
     Detailed output of licensecheck in
     /home/bob/packaging/review/mbpfan/review-mbpfan/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: mbpfan-2.2.1-1.fc32.x86_64.rpm
          mbpfan-debuginfo-2.2.1-1.fc32.x86_64.rpm
          mbpfan-debugsource-2.2.1-1.fc32.x86_64.rpm
          mbpfan-2.2.1-1.fc32.src.rpm
mbpfan.x86_64: W: spelling-error %description -l en_US coretemp -> core temp, core-temp, compete
mbpfan.x86_64: W: spelling-error %description -l en_US applesmc -> applesauce
mbpfan.x86_64: W: spelling-error %description -l en_US daemonizes -> demonizes, demonize, simonizes
mbpfan.x86_64: W: spelling-error %description -l en_US syslog -> slog
mbpfan.x86_64: W: spelling-error %description -l en_US stdout -> stout, std out, std-out
mbpfan.x86_64: W: spelling-error %description -l en_US conf -> con, cone, cons
mbpfan.x86_64: W: spurious-executable-perm /usr/share/man/man8/mbpfan.8.gz
mbpfan.src: W: spelling-error %description -l en_US coretemp -> core temp, core-temp, compete
mbpfan.src: W: spelling-error %description -l en_US applesmc -> applesauce
mbpfan.src: W: spelling-error %description -l en_US daemonizes -> demonizes, demonize, simonizes
mbpfan.src: W: spelling-error %description -l en_US syslog -> slog
mbpfan.src: W: spelling-error %description -l en_US stdout -> stout, std out, std-out
mbpfan.src: W: spelling-error %description -l en_US conf -> con, cone, cons
4 packages and 0 specfiles checked; 0 errors, 13 warnings.

Comment 9 Lyes Saadi 2019-12-10 22:07:16 UTC
Thanks a lot Robert-André Mauchin for your review!

Here's the updated spec file: https://gitlab.com/LyesSaadi/spec/blob/master/mbpfan/mbpfan.spec
And the updated koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=39479572

> - Not ok: you need to build with Fedora's build flags:

Dominik 'Rathann' Mierzejewski already asked me to do that. I have no idea why, but I mixed %make_build and %make_install... Sorry about that.

Comment 10 Robert-André Mauchin 🐧 2019-12-10 22:50:30 UTC
Ok, package approved. You still need to find a sponsor:
https://fedoraproject.org/wiki/How_to_get_sponsored_into_the_packager_group

Comment 11 Igor Raits 2019-12-21 16:37:11 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/mbpfan

Comment 12 Fedora Update System 2019-12-21 21:06:38 UTC
FEDORA-2019-8f2dde35e7 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-8f2dde35e7

Comment 13 Fedora Update System 2019-12-21 21:13:17 UTC
FEDORA-2019-e73317656f has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-e73317656f

Comment 14 Fedora Update System 2019-12-23 19:06:03 UTC
FEDORA-2019-8f2dde35e7 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-8f2dde35e7

Comment 15 Fedora Update System 2019-12-26 14:14:24 UTC
mbpfan-2.2.1-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-e73317656f

Comment 16 Fedora Update System 2020-01-04 22:15:36 UTC
mbpfan-2.2.1-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2020-01-04 22:22:50 UTC
mbpfan-2.2.1-2.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-8f2dde35e7

Comment 18 Fedora Update System 2020-01-12 01:41:11 UTC
mbpfan-2.2.1-2.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.