Bug 2209858

Summary: Review Request: timg - A terminal image and video viewer
Product: [Fedora] Fedora Reporter: Ryan <errornointernet>
Component: Package ReviewAssignee: Nobody's working on this, feel free to take it <nobody>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: fedora, link, package-review, pemensik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://github.com/hzeller/timg
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 177841    

Description Ryan 2023-05-25 05:58:36 UTC
Spec URL: https://raw.githubusercontent.com/ErrorNoInternet/rpm-specs/main/timg/timg.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/errornointernet/timg/fedora-38-x86_64/05952193-timg/timg-1.4.5-2.fc38.src.rpm
Description: A user-friendly viewer that uses 24-Bit color capabilities and unicode character blocks to display images, animations and videos in the terminal
Fedora Account System Username: errornointernet

COPR URL: https://copr.fedorainfracloud.org/coprs/errornointernet/timg/

Sorry for any mistakes made, this is my first package.
I also need a sponsor.

Comment 2 Fedora Review Service 2023-06-30 08:55:38 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6129269
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2209858-timg/fedora-rawhide-x86_64/06129269-timg/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 3 Petr Menšík 2023-07-08 09:34:06 UTC
I would recommend splitting BuildRequires: on multiple lines. Single line over 200 characters is not nice.

Similarly, %description should contain new lines and description with reasonably short lines. Common legacy value is 80 characters per line. A bit more may make sense on modern server, but 120 would be limit even there. GUI tools obtain information from AppStream files, but rpm -q and dnf info present them as preformatted by the author.

in %build phase, %cmake has to be used. It provides default build flags to package build.

Use %cmake_build and %cmake_install to handle created subdirectory. Own creation of build directory is not necessary, rpm macros will handle that.

I would recommend (optional) to use nicer source archives:
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

when spectool -g *.spec is used to fetch them, they are named as timg-1.4.5.tar.gz that way.

Comment 4 Ryan 2023-07-08 11:16:46 UTC
Hello,

Thanks for the recommendations :)
Here's the full list of changes I've made:

1. Included all the licenses in all the files (Fedora Review)
2. Used `%{url}/archive/v%{version}/%{name}-%{version}.tar.gz` as the source
3. Split BuildRequires onto multiple lines
4. Renamed "g++" dependency to "gcc-c++" (Fedora Review)
5. Split description into shorter lines
6. %build now only contains 2 lines, %cmake and %cmake_build
7. %install now only contains 1 line, %cmake_install

New .spec URL: https://download.copr.fedorainfracloud.org/results/errornointernet/timg/fedora-rawhide-x86_64/06151676-timg/timg.spec
New .srpm URL: https://download.copr.fedorainfracloud.org/results/errornointernet/timg/fedora-rawhide-x86_64/06151676-timg/timg-1.4.5-5.fc39.src.rpm

Comment 5 Artur Frenszek-Iwicki 2023-07-13 18:56:33 UTC
> License: GPL-2.0 AND GPL-2.0-or-later AND MIT
The first item here should be "GPL-2.0-only".
https://spdx.org/licenses/GPL-2.0-only.html

> %files
> %{_mandir}/man1/timg.1.gz
Do not assume man pages will be gzipped. Use a wildcard that can match any compression method (including none).
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages

Another thing is that the upstream repository bundles some third party libraries:
- third_party/stb
- third_party/qoi
Bundling libraries in generally discouraged in Fedora.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling

Upstream CMakeLists seem to support using system-provided versions of these libraries.
stb is available in Fedora as a separate package - you can add "BuildRequires: stb_image-devel stb_image_resize-devel".
For qoi, you'd need to either create a new package and submit it for review, or add "Provides: bundled(qoi)".

Comment 6 Ryan 2023-07-14 04:27:10 UTC
Thanks for your reply, I really appreciate it.

Current changes:
- `GPL-2.0` -> `GPL-2.0-only`
- `timg.1.gz` -> `timg.1*`
- `BuildRequires: zlib-devel` -> `BuildRequires: libdeflate-devel` (upstream change)
- +`BuildRequires: stb_image-devel stb_image_resize-devel`

> For qoi, you'd need to either create a new package and submit it for review, or add "Provides: bundled(qoi)".
I'll submit qoi as a new package.

I'm assuming I should put a `rm -rf third_party` after `%autosetup` in `%prep`?

v1.5.0 introduced sixel support, but libsixel is not yet packaged in Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=1936772).
So I guess I'll be packaging that too? I'm not sure how exactly though, do I submit a new bug, or "take over" existing one?

Comment 8 Ryan 2023-07-29 06:39:10 UTC
Changes:
- Bumped version to 1.5.1
- Removed third_party/stb (uses Fedora-provided package now)
- Disabled libsixel support for now (libsixel isn't in the Fedora repositories yet)

libsixel review request: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2227397

New .spec URL: https://download.copr.fedorainfracloud.org/results/errornointernet/timg/fedora-rawhide-x86_64/06221733-timg/timg.spec
New .srpm URL: https://download.copr.fedorainfracloud.org/results/errornointernet/timg/fedora-rawhide-x86_64/06221733-timg/timg-1.5.1-1.fc39.src.rpm