Bug 1998755

Summary: Review Request: pt2-clone 1.32 - ProTracker 2 clone
Product: [Fedora] Fedora Reporter: Jonathan S. <js-fedora>
Component: Package ReviewAssignee: Wen Liang <wenliang>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: package-review, wenliang
Target Milestone: ---Keywords: Reopened
Target Release: ---Flags: ppisar: fedora-review?
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-10 18:57:18 UTC 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 Jonathan S. 2021-08-28 17:16:54 UTC
Spec URL: https://nil.im/pt2-clone.spec
SRPM URL: https://nil.im/pt2-clone-1.32-1.fc34.src.rpm
Description: ProTracker 2 clone for Windows/macOS/Linux

Aims to be a highly accurate clone of the classic ProTracker 2.3D software for
Amiga.
Has additional audio filters and audio mixer improvements to make it sound
close to a real Amiga computer.

What is ProTracker? Read about it on Wikipedia.

Fedora Account System Username: js

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

This is my first package and I need a sponsor. I've been active in pkgsrc previously, which I used on NetBSD and macOS, but have recently migrated my main machine to Fedora. While pkgsrc does work on Fedora, having native packages is nicer, so I want to get into packaging software I am missing for Fedora, since using a system as my main system for me also means contributing.

Comment 1 Wen Liang 2021-10-19 01:33:36 UTC
Hi js-fedora, it seems that there are two primary issues related to the SPEC file:

1. It is missing the changelog entry.
2. Can you refer to the guideline here(https://docs.fedoraproject.org/en-US/packaging-guidelines/#_summary_and_description) to reword the description and avoid any grammar/syntactic error ?


The rpmlint test results were attached.

```
[wenliang@localhost x86_64]$ rpmlint pt2-clone-1.32-1.fc32.x86_64.rpm 
pt2-clone.x86_64: W: spelling-error %description -l en_US macOS -> ma Cos, mac OS, mac-OS
pt2-clone.x86_64: E: no-changelogname-tag
pt2-clone.x86_64: W: no-documentation
pt2-clone.x86_64: W: no-manual-page-for-binary pt2-clone
1 packages and 0 specfiles checked; 1 errors, 3 warnings.

[wenliang@localhost x86_64]$ rpmlint pt2-clone-debuginfo-1.32-1.fc32.x86_64.rpm pt2-clone-debuginfo.x86_64: E: no-changelogname-tag
1 packages and 0 specfiles checked; 1 errors, 0 warnings.

[wenliang@localhost x86_64]$ rpmlint pt2-clone-debugsource-1.32-1.fc32.x86_64.rpm 
pt2-clone-debugsource.x86_64: E: no-changelogname-tag
1 packages and 0 specfiles checked; 1 errors, 0 warnings.

[wenliang@localhost SRPMS]$ rpmlint pt2-clone-1.32-1.fc32.src.rpm 
pt2-clone.src: W: spelling-error %description -l en_US macOS -> ma Cos, mac OS, mac-OS
pt2-clone.src: E: no-changelogname-tag
1 packages and 0 specfiles checked; 1 errors, 1 warnings.
```

Comment 2 Jonathan S. 2021-10-29 09:29:37 UTC
1.) Given this package is new, I was thinking it should just contain a change log that it was imported - with the date of it actually being imported. Should I already add that to the .spec file and add a placeholder date?

2.) The rpmlint warnings are because of the "word" "macOS". Should I just remove all mentions of macOS and instead change it to something like "cross-platform"?

3.) In the meantime, this has happened:

https://github.com/8bitbubsy/pt2-clone/issues/19

I suppose this obsoleted this bug entirely, or is this not Fedora's problem but upstream's problem?

Comment 3 Wen Liang 2022-01-02 23:26:25 UTC
Hi Jonathan, beyond the rpmlint issues, my package review was posted as following:


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

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




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

C/C++:
[x]: If your application is a C or C++ application you must list a BuildRequires against gcc, gcc-c++ or clang.
[x]: If your library includes standard C or C++ headers, you must list BuildRequires against gcc, gcc-c++, or clang to install the needed standards conforming headers.
[-]: If at runtime you use cpp to process C or C++ language headers then you have no choice but to use Requires for gcc, gcc-c++, or clang to install the required headers for a standard conforming C or C++ application.
 
Generic:
[!]: rpmlint must be run on the source rpm and all binary rpms the build produces. The output should be posted in the review.
[x]: The package must be named according to the Package Naming Guidelines .
[x]: The spec file name must match the base package %{name}, in the format %{name}.spec unless your package has an exemption.
[!]: The package must meet the Packaging Guidelines .
[x]: The package must be licensed with a Fedora approved license and meet the Licensing Guidelines.
[x]: The License field in the package spec file must match the actual license.
[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 must be included in %license.
[x]: The spec file must be written in American English.
[x]: The spec file for the package MUST be legible. 
[x]: The sources used to build the package must match the upstream source, as provided in the spec URL. Reviewers should use sha256sum for this task as it is used by the sources file once imported into git. If no upstream URL can be specified for this package, please see the Source URL Guidelines for how to deal with this.
[x]: The package MUST successfully compile and build into binary rpms on at least one primary architecture.
[x]: If the package does not successfully compile, build or work on an architecture, then those architectures should be listed in the spec in ExcludeArch. Each architecture listed in ExcludeArch MUST have a bug filed in bugzilla, describing the reason that the package does not compile/build/work on that architecture. The bug number MUST be placed in a comment, next to the corresponding ExcludeArch line. 
[x]: All build dependencies must be listed in BuildRequires.
[!]: The spec file MUST handle locales properly. This is done by using the %find_lang macro. Using %{_datadir}/locale/* is strictly forbidden.
[x]: Packages must NOT bundle copies of system libraries.
[-]: If the package is designed to be relocatable, the packager must state this fact in the request for review, along with the rationalization for relocation of that specific package. Without this, use of Prefix: /usr is considered a blocker.
[x]: A package must own all directories that it creates. If it does not create a directory that it uses, then it should require a package which does create that directory.
[x]: A Fedora package must not list a file more than once in the spec file’s %files listings. (Notable exception: license texts in specific situations)
[x]: Permissions on files must be set properly. Executables should be set with executable permissions, for example.
[x]: Each package must consistently use macros.
[x]: The package must contain code, or permissible content.
[-]: Large documentation files must go in a -doc subpackage. (The definition of large is left up to the packager’s best judgement, but is not restricted to size. Large can refer to either size or quantity).
[-]: If a package includes something as %doc, it must not affect the runtime of the application. To summarize: If it is in %doc, the program must run properly if it is not present. 
[x]: Static libraries must be in a -static package.
[x]: Development files must be in a -devel package.
[-]: In the vast majority of cases, devel packages must require the base package using a fully versioned dependency: Requires: %{name}%{?_isa} = %{version}-%{release}
[x]: Packages must NOT contain any .la libtool archives, these must be removed in the spec if they are built.
[!]: Packages containing GUI applications must include a %{name}.desktop file, and that file must be properly installed with desktop-file-install in the %install section. If you feel that your packaged GUI application does not need a .desktop file, you must put a comment in the spec file with your explanation.
[x]: Packages must not own files or directories already owned by other packages. The rule of thumb here is that the first package to be installed should own the files or directories that other packages may rely upon. This means, for example, that no package in Fedora should ever share ownership with any of the files or directories owned by the filesystem or man package. If you feel that you have a good reason to own a file or directory that another package owns, then please present that at package review time.
[x]: All filenames in rpm packages must be valid UTF-8.
[x]: Packages being added to the distribution MUST NOT depend on any packages which have been marked as being deprecated.



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

Generic:
[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]: The reviewer should test that the package builds in mock.
[x]: The package should compile and build into binary rpms on all supported architectures.
[x]: The reviewer should test that the package functions as described. A package should not segfault instead of running, for example.
[-]: If scriptlets are used, those scriptlets must be sane. This is vague, and left up to the reviewers judgement to determine sanity.
[-]: Usually, subpackages other than devel should require the base package using a fully versioned dependency.
[-]: The placement of pkgconfig(.pc) files depends on their usecase, and this is usually for development purposes, so should be placed in a -devel pkg. A reasonable exception is that the main pkg itself is a devel tool not installed in a user runtime, e.g. gcc or gdb. 
[x]: If the package has file dependencies outside of /etc, /bin, /sbin, /usr/bin, or /usr/sbin consider requiring the package which provides the file instead of the file itself. 
[!]: your package should contain man pages for binaries/scripts. If it doesn’t, work with upstream to add them where they make sense.

Comment 4 Wen Liang 2022-01-02 23:39:44 UTC
(In reply to Jonathan S. from comment #2)
> 1.) Given this package is new, I was thinking it should just contain a
> change log that it was imported - with the date of it actually being
> imported. Should I already add that to the .spec file and add a placeholder
> date?

Your idea looks good to me. 

> 2.) The rpmlint warnings are because of the "word" "macOS". Should I just
> remove all mentions of macOS and instead change it to something like
> "cross-platform"?

how about changing into `mac OS`? (as suggested by the rpmlint)

Comment 5 Wen Liang 2022-01-04 02:36:44 UTC
Hi @js-fedora, let me summarize what you need to change in the next step:
 

1.rpmlint detected some issues in the package. As suggested by rpmlint, you may change macOS into mac OS. You may also add changelog entry as you proposed and add the man page for binary pt2-clone in the upstream. 

2. Since the package contains the GUI application, and the GUI applications must include a %{name}.desktop file, and that file must be properly installed with desktop-file-install in the %install section. For details on how to do that, you can take a look here, https://docs.fedoraproject.org/en-US/packaging-guidelines/#_desktop_files.
If you feel that your packaged GUI application does not need a .desktop file, you must put a comment in the spec file with your explanation.

3. The spec file does not handle locales properly. This is done by using the %find_lang macro. For details, you can refer here, https://docs.fedoraproject.org/en-US/packaging-guidelines/#_handling_locale_files.


In the meantime, for the item 2 and 3 above, I will follow up to propose my solution later.

Comment 6 Wen Liang 2022-01-31 18:03:18 UTC
For the item2 above, my solution would be:


- Add `BuildRequires: desktop-file-utils` to help ensure the .desktop file safety and spec-compliance
- the `install` and `file` section should be 

```
%install
%cmake_install
mkdir -p $RPM_BUILD_ROOT/usr/share/applications/
cat > $RPM_BUILD_ROOT/usr/share/applications/%{name}.desktop <<'EOF'
[Desktop Entry]
Name=pt2-clone
GenericName=ProTracker 2 clone
Comment=ProTracker 2 clone
Exec=pt2-clone
Icon=pt2-clone # or you can define the full path to the icon file
Terminal=false
Type=Application
Categories=Graphics;
EOF

%files
%{_bindir}/pt2-clone
%{_datadir}/applications/%{name}.desktop
%license LICENSE 
```

Then after using the rpmbuild to build the package, you will find that the .rpm file contains the `pt2-clone.desktop` file
```
[wenliang@localhost x86_64]$ rpm2cpio pt2-clone-1.32-1.fc32.x86_64.rpm | cpio -tv | grep .desktop
-rw-r--r--   1 root     root          223 Jan 31 12:54 ./usr/share/applications/pt2-clone.desktop
```

Comment 7 Wen Liang 2022-01-31 19:17:07 UTC
For the item 3 mentioned above, I just noticed that there was no translation file included in the source, then you can skip adding the `%find_lang` macro. Thanks. ( Please ignore item3 above)

Comment 8 Wen Liang 2022-11-21 02:20:11 UTC
No response from the reporter for long time, thus close the bug.

Comment 9 Jonathan S. 2023-07-30 17:57:15 UTC
Hi!

Sorry for the delay, I thought it wouldn't be accepted anyway because of the above mentioned bug. Since nobody from RH legal has said no, here's an updated .spec and srpm.

Spec: https://nil.im/pt2-clone.spec
SRPM: https://nil.im/pt2-clone-1.49-1.fc39.src.rpm

In the meantime, I've become a packager, so no longer need a sponsor.

Comment 10 Wen Liang 2023-08-10 18:55:29 UTC
Since there are (In reply to Jonathan S. from comment #9)
> Hi!
> 
> Sorry for the delay, I thought it wouldn't be accepted anyway because of the
> above mentioned bug. Since nobody from RH legal has said no, here's an
> updated .spec and srpm.
Since there is license/legal status issue, maybe it is a better idea to not make it a Fedora package then. Thanks for the update though.

> 
> Spec: https://nil.im/pt2-clone.spec
> SRPM: https://nil.im/pt2-clone-1.49-1.fc39.src.rpm
rpmlint complains something about the file permissions, you may take a look:
```
[wenliang@localhost Downloads]$ rpmlint pt2-clone-1.49-1.fc39.src.rpm
pt2-clone.src: W: strange-permission pt2-clone.spec 600
```

> 
> In the meantime, I've become a packager, so no longer need a sponsor.

Congats!