Bug 2149953 - Review Request: rust-cfonts - Sexy ANSI fonts for the console
Summary: Review Request: rust-cfonts - Sexy ANSI fonts for the console
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: blinxen
QA Contact: Fedora Extras Quality Assurance
URL: https://crates.io/crates/cfonts
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-01 12:35 UTC by Alessio
Modified: 2023-09-15 18:44 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-30 20:52:36 UTC
Type: ---
Embargoed:
h-k-81: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 5537301 to 6345368 (1.64 KB, patch)
2023-08-26 07:07 UTC, Fedora Review Service
no flags Details | Diff

Description Alessio 2022-12-01 12:35:26 UTC
Spec URL: https://alciregi.fedorapeople.org/rustrpm/rust-cfonts.spec
SRPM URL: https://alciregi.fedorapeople.org/rustrpm/rust-cfonts-1.1.0-1.fc37.src.rpm
Description: This is a silly little command line tool for sexy ANSI fonts
in the console. Give your cli some love.
Fedora Account System Username: alciregi

Successful koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=94784705

Comment 1 Fabio Valentini 2023-02-15 22:33:14 UTC
Two Quick Comments:

It looks like you're adding a license file from upstream to the SRPM file, but then do nothing with it?
You will probably want to do something like "cp -pav %{SOURCE1} ." at the end of %prep, and then use that file (i.e. replace the "# FIXME: no license file detected" warnings in both file lists - in the case of the subpackage for the actual binary, with `%license LICENSE`, and in the case of the "-devel" subpackage, with `%license %{crate_instdir}/LICENSE`.

You will also need to determine the license of everything that's statically linked into your binaries.
You can use the %cargo_license / %cargo_license_summary macros for this, i.e. adding something like this after %cargo_build:

%cargo_license_summary
%{cargo_license} > LICENSE.dependencies

The first one prints a summary to the build log (which you can use for determining the License tag of the "-n %{crate}" subpackage), the second one writes a file into the builddir that contains a complete license breakdown for all statically linked components (which you can include with %license LICENSE.dependencies) in the subpackage for the binary, as well.

You can take a look at rpm-sequoia for an example of how to handle this:
https://src.fedoraproject.org/rpms/rust-rpm-sequoia/blob/rawhide/f/rust-rpm-sequoia.spec

Comment 3 Jakub Kadlčík 2023-02-17 13:58:19 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5537301
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2149953-rust-cfonts/fedora-rawhide-x86_64/05537301-rust-cfonts/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 4 blinxen 2023-03-26 17:54:03 UTC
Taking this review

Some comments / issues with the package:

- The upstream project does not include a license file in `Cargo.toml`. I can see that you add it manually but it would be nice if you could push the change to upstream. Maybe by specifying `license-file` [1]?.
- The license path for the `devel` package is wrong. It should be `%license %{crate_instdir}/LICENSE`.
- `rust2rpm` always adds the `%doc` directive to `devel` packages. I am not sure if this is actually required as I couldn't find anything about it in the guidelines but I think adding it shouldn't hurt. Something like `%doc %{crate_instdir}/README.md`

[1] https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields

Comment 5 Fabio Valentini 2023-03-26 22:21:27 UTC
(In reply to blinxen from comment #4)
> Taking this review
> 
> Some comments / issues with the package:
> 
> - The upstream project does not include a license file in `Cargo.toml`. I
> can see that you add it manually but it would be nice if you could push the
> change to upstream. Maybe by specifying `license-file` [1]?.

No. The `license-file` field in Cargo.toml is supposed to only be used if the license is non-standard (i.e. custom license with no corresponding SPDX identifier).

> - The license path for the `devel` package is wrong. It should be `%license
> %{crate_instdir}/LICENSE`.

That *would* be true, but the upstream Cargo.toml specifies files to include, and `LICENSE` is not among the listed files. So it cannot be referenced this way unless the `include` setting in Cargo.toml is also fixed to include the "LICENSE" file. Otherwise it will not get copied to %{crate_instdir}.

> - `rust2rpm` always adds the `%doc` directive to `devel` packages. I am not
> sure if this is actually required as I couldn't find anything about it in
> the guidelines but I think adding it shouldn't hurt. Something like `%doc
> %{crate_instdir}/README.md`

Yes, this line seems to be missing from the -devel subpackage's files:

%doc %{crate_instdir}/README.md

Comment 6 Alessio 2023-03-27 08:48:29 UTC
Sorry. I missed a piece.
Apart adding %doc %{crate_instdir}/README.md, should we ask upstream to fix or enhance something in the Cargo.toml file in order to avoid to manually include the LICENSE file?

Thanks.

Comment 7 Fabio Valentini 2023-03-27 08:55:20 UTC
> Apart adding %doc %{crate_instdir}/README.md, should we ask upstream to fix or enhance something in the Cargo.toml file in order to avoid to manually include the LICENSE file?

Yes. They are distributing sources that don't include their own license file. :(

The list of files here needs to include a "LICENSE" file:
https://github.com/dominikwilkowski/cfonts/blob/released/rust/Cargo.toml#L14

And there needs to be a copy (or symlink) of the file in the "rust" directory.
Please report this with the upstream project.

Also note that while the project's Cargo.toml references "../README.md" as its "readme" file, this is not really defined behaviour unless the "README.md" file is also included in the list of files to "include".

---

Additionally, the "%package -n %{crate}" subpackage is still missing a License tag that contains the licenses that are printed by %cargo_license_summary.

Comment 8 Alessio 2023-03-27 10:31:39 UTC
Ok. I will contact upstream.

About missing License tag. Doesn't
%license LICENSE.dependencies
where LICENSE.dependencies is generated by %{cargo_license}
is sufficient?

Comment 9 Fabio Valentini 2023-03-27 10:35:48 UTC
(In reply to Alessio from comment #8)
> Ok. I will contact upstream.

Thanks!

> About missing License tag. Doesn't
> %license LICENSE.dependencies
> where LICENSE.dependencies is generated by %{cargo_license}
> is sufficient?

No:
https://docs.fedoraproject.org/en-US/legal/license-field/#_rust_packages

Comment 10 Alessio 2023-03-27 11:04:16 UTC
Ah.
So the License tag of the spec file, should be
License: Apache-2.0 AND GPL-3.0-or-later AND ISC AND MIT
considering that 
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# GPL-3.0-or-later
# ISC
# MIT
# MIT OR Apache-2.0
is the output of %cargo_license_summary.
Or should it be
License: Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND GPL-3.0-or-later AND ISC AND MIT AND (MIT OR Apache-2.0)

Thank you.

Comment 11 Fabio Valentini 2023-03-27 11:42:13 UTC
According to the latest guidance from Red Hat legal, the latter is the preferred form.
c.f. https://docs.fedoraproject.org/en-US/legal/license-field/#_conjunctive_and_licensing
and  https://docs.fedoraproject.org/en-US/legal/license-field/#_combined_disjunctive_and_conjunctive_license_expressions

Comment 12 Fabio Valentini 2023-07-30 16:43:12 UTC
Are you still interested in this package?

Comment 13 Alessio 2023-07-31 10:35:00 UTC
(In reply to Fabio Valentini from comment #12)
> Are you still interested in this package?

I would be interested, but I fear that I lack some concepts and knowledge :-/

Comment 14 Fabio Valentini 2023-07-31 12:23:59 UTC
The spec does look good to me, with the exception of the missing license tag + breakdown for the binary subpackage.

Adding 

"""
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# GPL-3.0-or-later
# ISC
# MIT
# MIT OR Apache-2.0
License:        Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND GPL-3.0-or-later AND ISC AND MIT AND (MIT OR Apache-2.0)
"""

as discussed in https://bugzilla.redhat.com/show_bug.cgi?id=2149953#c10 is the only thing that's still missing, as far as I can see.

===

The only other problem is that the current version (cfonts 1.1.0) has an outdated dependency and doesn't build right now.
The suppors-color crate has been updated to version 2, which cfonts is not compatible with yet.
You might want to ask upstream about bumping the supports-color dependency (if possible).

I also commented on the upstream ticket that you raised, hopefully I could clear some things up.

Comment 15 Alessio 2023-07-31 13:26:37 UTC
Thank you @decathorpe

Comment 17 Fedora Review Service 2023-08-26 07:07:51 UTC
Created attachment 1985374 [details]
The .spec file difference from Copr build 5537301 to 6345368

Comment 18 Fedora Review Service 2023-08-26 07:07:54 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6345368
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2149953-rust-cfonts/fedora-rawhide-x86_64/06345368-rust-cfonts/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 19 Fabio Valentini 2023-08-26 17:52:34 UTC
Thanks for the update! Looks good to me, just one minor issue left:

> License:        Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND GPL-3.0-or-later AND ISC AND MIT AND (MIT OR Apache-2.0)

This license tag only applies to the "%package     -n %{crate}" subpackage, please move it there.
The license tag for the SRPM (and also inherited by all *-devel subpackages) should remain just "GPL-3.0-or-later".

Other than that, package is ready for approval.

Comment 20 Alessio 2023-08-27 05:58:33 UTC
Ok, thank you Fabio.
I updated the spec file. Is that okay?

Comment 21 Fabio Valentini 2023-08-28 12:49:11 UTC
Yup, looks good to me, thank you.
I defer to blinxen for the final review and actual approval, since they already assigned this to themselves.

Comment 22 blinxen 2023-08-30 19:48:32 UTC
Looks good to me too!!

APPROVED

Package Review
==============

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



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

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
     Note: Using prebuilt packages
[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. No licenses
     found. Please check the source files for licenses manually.
[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.
[x]: 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.
[-]: 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.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[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 must own all directories that it creates.
[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]: 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 must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[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:
[x]: Reviewer should test that the package builds in mock.
[x]: 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).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in cfonts ,
     rust-cfonts-devel , rust-cfonts+default-devel
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Spec use %global instead of %define unless justified.
     Note: %define requiring justification: %define autorelease(e:s:pb:n)
     %{?-p:0.}%{lua:
[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]: 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.

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

Generic:
[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.


Rpmlint
-------
Checking: cfonts-1.1.2-1.fc40.x86_64.rpm
          rust-cfonts-devel-1.1.2-1.fc40.noarch.rpm
          rust-cfonts+default-devel-1.1.2-1.fc40.noarch.rpm
          rust-cfonts-debugsource-1.1.2-1.fc40.x86_64.rpm
          rust-cfonts-1.1.2-1.fc40.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmp8_r3vpt2')]
checks: 31, packages: 5

cfonts.x86_64: W: no-manual-page-for-binary cfonts
rust-cfonts+default-devel.noarch: W: no-documentation
 5 packages and 0 specfiles checked; 0 errors, 2 warnings, 0 badness; has taken 0.2 s




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 4

cfonts.x86_64: W: no-manual-page-for-binary cfonts
rust-cfonts+default-devel.noarch: W: no-documentation
 4 packages and 0 specfiles checked; 0 errors, 2 warnings, 0 badness; has taken 0.1 s



Source checksums
----------------
https://crates.io/api/v1/crates/cfonts/1.1.2/download#/cfonts-1.1.2.crate :
  CHECKSUM(SHA256) this package     : 2a4d36e7854c995338cdb426337e950cd201809f5888959fb06d3d0a9f99e763
  CHECKSUM(SHA256) upstream package : 2a4d36e7854c995338cdb426337e950cd201809f5888959fb06d3d0a9f99e763


Requires
--------
cfonts (rpmlib, GLIBC filtered):
    ld-linux-x86-64.so.2()(64bit)
    libc.so.6()(64bit)
    libgcc_s.so.1()(64bit)
    libgcc_s.so.1(GCC_3.0)(64bit)
    libgcc_s.so.1(GCC_3.3)(64bit)
    libgcc_s.so.1(GCC_4.2.0)(64bit)
    libm.so.6()(64bit)
    rtld(GNU_HASH)

rust-cfonts-devel (rpmlib, GLIBC filtered):
    (crate(exitcode/default) >= 1.1.2 with crate(exitcode/default) < 2.0.0~)
    (crate(rand/default) >= 0.8.5 with crate(rand/default) < 0.9.0~)
    (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0~)
    (crate(serde/derive) >= 1.0.0 with crate(serde/derive) < 2.0.0~)
    (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0~)
    (crate(strum/default) >= 0.25.0 with crate(strum/default) < 0.26.0~)
    (crate(strum_macros/default) >= 0.25.0 with crate(strum_macros/default) < 0.26.0~)
    (crate(supports-color/default) >= 2.0.0 with crate(supports-color/default) < 3.0.0~)
    (crate(terminal_size/default) >= 0.2.3 with crate(terminal_size/default) < 0.3.0~)
    cargo

rust-cfonts+default-devel (rpmlib, GLIBC filtered):
    cargo
    crate(cfonts)

rust-cfonts-debugsource (rpmlib, GLIBC filtered):



Provides
--------
cfonts:
    cfonts
    cfonts(x86-64)

rust-cfonts-devel:
    crate(cfonts)
    rust-cfonts-devel

rust-cfonts+default-devel:
    crate(cfonts/default)
    rust-cfonts+default-devel

rust-cfonts-debugsource:
    rust-cfonts-debugsource
    rust-cfonts-debugsource(x86-64)



Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review --no-colors --prebuilt --rpm-spec --name rust-cfonts --mock-config /var/lib/copr-rpmbuild/results/configs/child.cfg
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic
Disabled plugins: Haskell, Java, fonts, R, Ocaml, C/C++, Perl, Python, SugarActivity, PHP
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 23 Fedora Admin user for bugzilla script actions 2023-08-30 20:30:48 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-cfonts

Comment 24 Fedora Update System 2023-08-30 20:51:52 UTC
FEDORA-2023-9351f57531 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9351f57531

Comment 25 Fedora Update System 2023-08-30 20:52:36 UTC
FEDORA-2023-9351f57531 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 26 Alessio 2023-08-30 20:57:02 UTC
Thank you @h-k-81 
Thank you @decathorpe

Comment 27 Fedora Update System 2023-08-30 21:08:45 UTC
FEDORA-2023-2b675c99b5 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2b675c99b5

Comment 28 Fabio Valentini 2023-08-30 21:16:47 UTC
Looks like the NEEDINFO was accidental?

Comment 29 Fedora Update System 2023-08-31 01:49:01 UTC
FEDORA-2023-2b675c99b5 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-2b675c99b5 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2b675c99b5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 30 Fedora Update System 2023-09-15 18:44:36 UTC
FEDORA-2023-2b675c99b5 has been pushed to the Fedora 39 stable repository.
If problem still persists, 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.