Bug 2244124 - Review Request: crow-translate - A simple and lightweight translator
Summary: Review Request: crow-translate - A simple and lightweight translator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-13 21:34 UTC by Artem
Modified: 2024-06-10 01:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-01 19:38:21 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 6524378 to 6524428 (446 bytes, patch)
2023-10-13 22:19 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6524428 to 6947075 (2.40 KB, patch)
2024-01-24 15:34 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6947075 to 7485148 (1.69 KB, patch)
2024-05-24 16:14 UTC, Fedora Review Service
no flags Details | Diff

Description Artem 2023-10-13 21:34:50 UTC
Spec URL: https://atim.fedorapeople.org/crow-translate.spec
SRPM URL: https://atim.fedorapeople.org/crow-translate-2.10.10-1.fc39.src.rpm

Description:
Crow Translate is a simple and lightweight translator written in C++ / Qt that
allows you to translate and speak text using Google, Yandex, Bing,
LibreTranslate and Lingva translate API. You may also be interested in my
library QOnlineTranslator used in this project.

Fedora Account System Username: atim

Comment 1 Artem 2023-10-13 21:34:53 UTC
This package built on koji:  https://koji.fedoraproject.org/koji/taskinfo?taskID=107461088

Comment 3 Fedora Review Service 2023-10-13 22:19:10 UTC
Created attachment 1993820 [details]
The .spec file difference from Copr build 6524378 to 6524428

Comment 4 Benson Muite 2023-10-14 06:08:25 UTC
Is it possible to unbundle qonlinetranslator, qhotkey, qtaskbarcontrol and singleapplication
and package them separately?

Comment 5 Artem 2023-10-14 09:44:09 UTC
(In reply to Benson Muite from comment #4)

Filed upstream issue https://github.com/crow-translate/crow-translate/issues/615

I think some of them could unbundled, but some not since they are modified versions of original modules. For example 'qhotkey' i've also bundle for QOwnNotes and it could be reused in this case https://src.fedoraproject.org/rpms/qownnotes/blob/f39/f/qownnotes.spec#_23

Comment 8 Robert-André Mauchin 🐧 2023-10-28 09:31:40 UTC
could you try to unbundle the stuff?

Comment 9 Artem 2023-10-28 12:08:42 UTC
(In reply to Robert-André Mauchin 🐧 from comment #8)
> could you try to unbundle the stuff?

No, explanation in Specfile:
# https://github.com/crow-translate/crow-translate/issues/615#issuecomment-1762779870

Comment 10 Beck Liu 2023-12-19 12:30:04 UTC
Take the review.

1. update to the latest release for now.

2. I think the licenses listed are not correct. Since the bundled dependencies are not avoidable, so you should add their licenses to license field.

3.
> %global appid io.crow_translate.CrowTranslate

The variable is not used.

Comment 11 Artem 2024-01-24 15:18:42 UTC
(In reply to Beck Liu from comment #10)
> 1. update to the latest release for now.

Done. 

> 2. I think the licenses listed are not correct. Since the bundled
> dependencies are not avoidable, so you should add their licenses to license
> field.

Indeed, fixed.

> 3.
> > %global appid io.crow_translate.CrowTranslate
> 
> The variable is not used.

Fixed.

Thanks for review!

---

https://download.copr.fedorainfracloud.org/results/atim/playground/fedora-rawhide-x86_64/06947009-crow-translate/crow-translate.spec
https://download.copr.fedorainfracloud.org/results/atim/playground/fedora-rawhide-x86_64/06947009-crow-translate/crow-translate-2.11.1-1.fc40.src.rpm

Comment 12 Fedora Review Service 2024-01-24 15:34:33 UTC
Created attachment 2010225 [details]
The .spec file difference from Copr build 6524428 to 6947075

Comment 13 Fedora Review Service 2024-01-24 15:34:35 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6947075
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2244124-crow-translate/fedora-rawhide-x86_64/06947075-crow-translate/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 14 Artem 2024-02-14 19:47:30 UTC
Hello. If there is no more issues can we proceed please?

Comment 16 Robert-André Mauchin 🐧 2024-05-22 12:59:25 UTC
 - Release: 1%{?dist}

Use %autorelease

- # The entire source code is GPL-3.0-only except bundled libs:
# GPL-3.0-or-later: qonlinetranslator
# BSD-3-Clause:     qhotkey
#                   qtaskbarcontrol
#                   singleapplication
# MIT:              singleapplication
License: GPL-3.0-only

You should add them all to the license tag then. We don't simplify the tag anymore in the latest guidelines.


[!]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/icons/hicolor/310x310/apps,
     /usr/share/icons/hicolor/44x44, /usr/share/icons/hicolor/150x150,
     /usr/share/icons/hicolor/150x150/apps,
     /usr/share/icons/hicolor/310x310, /usr/share/icons/hicolor/44x44/apps


These directory are uncommon and are not owned by hicolor-icon-theme. Own them in your SPEC.

[!]: Package contains no bundled libraries without FPC exception.

Seek a FPC exception for bundling 3rd party libraries, or package them. Nothing prevents you from doing it but you'all to modify the CMakelists. For example:

diff -up crow-translate-2.11.1/CMakeLists.txt.orig crow-translate-2.11.1/CMakeLists.txt
--- crow-translate-2.11.1/CMakeLists.txt.orig	2024-01-04 10:54:43.000000000 +0100
+++ crow-translate-2.11.1/CMakeLists.txt	2024-05-22 14:47:34.771176980 +0200
@@ -59,6 +59,7 @@ endif()
 
 option(WITH_PORTABLE_MODE "Enable portable functionality" OFF)
 option(WITH_KWAYLAND "Use KWayland for better Wayland integration" ON)
+option(USE_EXTERNAL_SINGLEAPPLICATION "Use external QtSingleApplication library" OFF)
 
 find_package(ECM REQUIRED NO_MODULE)
 list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -66,7 +67,15 @@ list(APPEND CMAKE_MODULE_PATH ${ECM_MODU
 set(QAPPLICATION_CLASS QApplication)
 option(QHOTKEY_INSTALL OFF)
 
-add_subdirectory(src/third-party/singleapplication)
+if(USE_EXTERNAL_SINGLEAPPLICATION)
+  set(qtsingleapplication_libs libQt5Solutions_SingleApplication-2.6 Qt5Solutions_SingleApplication-2.6)
+  find_library(QTSINGLEAPPLICATION_LIBRARY NAMES ${qtsingleapplication_libs})
+  add_compile_definitions(USE_EXTERNAL_SINGLEAPPLICATION=1)
+  message(STATUS "Using external SingleApplication library")
+else()
+  add_subdirectory(src/third-party/singleapplication)
+  set(QTSINGLEAPPLICATION_LIBRARY SingleApplication::SingleApplication)
+endif()
 add_subdirectory(src/third-party/qhotkey)
 add_subdirectory(src/third-party/qtaskbarcontrol)
 add_subdirectory(src/qonlinetranslator)
@@ -225,7 +234,7 @@ target_include_directories(${PROJECT_NAM
 set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_NAME})
 
 target_link_libraries(${PROJECT_NAME} PRIVATE
-    SingleApplication::SingleApplication
+    ${QTSINGLEAPPLICATION_LIBRARY}
     QHotkey::QHotkey
     QTaskbarControl::QTaskbarControl
     QOnlineTranslator::QOnlineTranslator
diff -up crow-translate-2.11.1/src/main.cpp.orig crow-translate-2.11.1/src/main.cpp
--- crow-translate-2.11.1/src/main.cpp.orig	2024-05-22 14:35:02.492746107 +0200
+++ crow-translate-2.11.1/src/main.cpp	2024-05-22 14:52:49.852842075 +0200
@@ -20,7 +20,11 @@
 #include "cli.h"
 #include "cmake.h"
 #include "mainwindow.h"
+#ifndef USE_EXTERNAL_SINGLEAPPLICATION
 #include "singleapplication.h"
+#else
+#include "QtSolutions/qtsingleapplication.h"
+#endif
 
 #ifdef Q_OS_UNIX
 #include "ocr/ocr.h"
@@ -61,7 +65,11 @@ int launchGui(int argc, char *argv[])
     QIcon::setThemeName("hicolor");
 #endif
 
+#ifndef USE_EXTERNAL_SINGLEAPPLICATION
     SingleApplication app(argc, argv);
+#else
+    QtSingleApplication app(argc, argv);
+#endif
 
     AppSettings().setupLocalization();
 
diff -up crow-translate-2.11.1/src/mainwindow.cpp.orig crow-translate-2.11.1/src/mainwindow.cpp
--- crow-translate-2.11.1/src/mainwindow.cpp.orig	2024-05-22 14:35:08.224703786 +0200
+++ crow-translate-2.11.1/src/mainwindow.cpp	2024-05-22 14:50:50.833724064 +0200
@@ -25,7 +25,11 @@
 #include "qtaskbarcontrol.h"
 #include "screenwatcher.h"
 #include "selection.h"
+#ifndef USE_EXTERNAL_SINGLEAPPLICATION
 #include "singleapplication.h"
+#else
+#include "QtSolutions/qtsingleapplication.h"
+#endif
 #include "trayicon.h"
 #include "ocr/ocr.h"
 #include "ocr/screengrabbers/abstractscreengrabber.h"
@@ -87,7 +91,11 @@ MainWindow::MainWindow(QWidget *parent)
     connect(m_orientationWatcher, &ScreenWatcher::screenOrientationChanged, this, &MainWindow::setOrientation);
 
     // Show the main window if a secondary instance has been started
+#ifndef USE_EXTERNAL_SINGLEAPPLICATION
     connect(qobject_cast<SingleApplication *>(QCoreApplication::instance()), &SingleApplication::instanceStarted, this, &MainWindow::open);
+#else
+    connect(qobject_cast<QtSingleApplication *>(QCoreApplication::instance()), &QtSingleApplication::instanceStarted, this, &MainWindow::open);
+#endif
 
     // Selection requests
     connect(&Selection::instance(), &Selection::requestedSelectionAvailable, ui->sourceEdit, &SourceTextEdit::replaceText);



Although they use a fork of QtSingleApplication (https://github.com/itay-grudev/SingleApplication/tree/aede311d28d20179216c5419b581087be2a8409f ) so this patch can't apply as is, but you get the gist of it.


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

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



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

C/C++:
[x]: Provides: bundled(gnulib) in place as required.
     Note: Sources not installed
[x]: Package does not contain kernel modules.
[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]: Package contains no static executables.
[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.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "GNU General Public License v3.0 or
     later", "BSD 3-Clause License", "MIT License", "*No copyright* MIT
     License". 8168 files have unknown license. Detailed output of
     licensecheck in /home/bob/packaging/review/crow-translate/review-crow-
     translate/licensecheck.txt
[X]: License file installed when any subpackage combination is installed.
[!]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/icons/hicolor/310x310/apps,
     /usr/share/icons/hicolor/44x44, /usr/share/icons/hicolor/150x150,
     /usr/share/icons/hicolor/150x150/apps,
     /usr/share/icons/hicolor/310x310, /usr/share/icons/hicolor/44x44/apps
[X]: %build honors applicable compiler flags or justifies otherwise.
[!]: Package contains no bundled libraries without FPC exception.
[X]: Changelog in prescribed format.
[X]: Sources contain only permissible code or content.
[-]: 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).
[-]: Package is named according to the Package Naming Guidelines.
[-]: 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.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 14278 bytes in 1 files.
[!]: 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]: The License field must be a valid SPDX expression.
[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]: Package contains desktop file if it is a GUI application.
[x]: Package installs a %{name}.desktop using desktop-file-install or
     desktop-file-validate if there is such a file.
[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]: 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.
[?]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %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]: Spec use %global instead of %define unless justified.

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

Generic:
[!]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
     Note: Arch-ed rpms have a total of 3399680 bytes in /usr/share
[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]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: crow-translate-2.11.1-1.fc41.x86_64.rpm
          crow-translate-debuginfo-2.11.1-1.fc41.x86_64.rpm
          crow-translate-debugsource-2.11.1-1.fc41.x86_64.rpm
          crow-translate-2.11.1-1.fc41.src.rpm
============================================================================================================== rpmlint session starts ==============================================================================================================
rpmlint: 2.5.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
rpmlintrc: [PosixPath('/tmp/tmpj5mcbii0')]
checks: 32, packages: 4

crow-translate.spec:38: W: unversioned-explicit-provides bundled(qonlinetranslator)
crow-translate.spec:39: W: unversioned-explicit-provides bundled(qhotkey)
crow-translate.spec:40: W: unversioned-explicit-provides bundled(qtaskbarcontrol)
crow-translate.spec:41: W: unversioned-explicit-provides bundled(singleapplication)
crow-translate.x86_64: W: no-manual-page-for-binary crow
======================================================================== 4 packages and 0 specfiles checked; 0 errors, 5 warnings, 16 filtered, 0 badness; has taken 0.8 s =========================================================================

Comment 17 Artem 2024-05-24 15:56:54 UTC
(In reply to Robert-André Mauchin 🐧 from comment #16)

> These directory are uncommon and are not owned by hicolor-icon-theme. Own them in your SPEC.

This look like unnecessary files. I removed them for now and opened upstream issue https://github.com/crow-translate/crow-translate/issues/685. Waiting for upstream approval.

> Seek a FPC exception for bundling 3rd party libraries, or package them. Nothing prevents you from doing it but you'all to modify the CMakelists. For example:

Fedora guidelines says: 
  > Fedora packages SHOULD make every effort to avoid having multiple, separate, upstream projects bundled together in a single package.

Not MUST. And i already asked about this upstream. Also documented in Spec. Upstream answer is:
  > Consider submodules in this repo as a way to avoid copy-pasting the code

I don't want patching this downstream and i don't want fight with upstream. I've already learned this lesson. If someone really wants this please submit upstream patch.

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

---

New build:

https://download.copr.fedorainfracloud.org/results/atim/playground/fedora-rawhide-x86_64/07484998-crow-translate/crow-translate.spec
https://download.copr.fedorainfracloud.org/results/atim/playground/fedora-rawhide-x86_64/07484998-crow-translate/crow-translate-2.11.1-1.fc41.src.rpm

Comment 18 Fedora Review Service 2024-05-24 16:14:49 UTC
Created attachment 2034972 [details]
The .spec file difference from Copr build 6947075 to 7485148

Comment 19 Fedora Review Service 2024-05-24 16:14:51 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/7485148
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2244124-crow-translate/fedora-rawhide-x86_64/07485148-crow-translate/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 20 Robert-André Mauchin 🐧 2024-06-01 13:21:12 UTC
Package approved.

Comment 21 Fedora Admin user for bugzilla script actions 2024-06-01 18:39:17 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/crow-translate

Comment 22 Fedora Update System 2024-06-01 19:34:16 UTC
FEDORA-2024-08bf32f8a7 (crow-translate-2.11.1-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-08bf32f8a7

Comment 23 Fedora Update System 2024-06-01 19:38:21 UTC
FEDORA-2024-08bf32f8a7 (crow-translate-2.11.1-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2024-06-01 19:45:06 UTC
FEDORA-2024-7c7b8ec9ad (crow-translate-2.11.1-2.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-7c7b8ec9ad

Comment 25 Fedora Update System 2024-06-01 19:45:44 UTC
FEDORA-2024-7be9bf38ff (crow-translate-2.11.1-2.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-7be9bf38ff

Comment 26 Fedora Update System 2024-06-02 02:18:35 UTC
FEDORA-2024-7be9bf38ff 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-2024-7be9bf38ff \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-7be9bf38ff

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

Comment 27 Fedora Update System 2024-06-02 02:50:32 UTC
FEDORA-2024-7c7b8ec9ad has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-7c7b8ec9ad \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-7c7b8ec9ad

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

Comment 28 Fedora Update System 2024-06-10 01:27:50 UTC
FEDORA-2024-7c7b8ec9ad (crow-translate-2.11.1-2.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 29 Fedora Update System 2024-06-10 01:51:55 UTC
FEDORA-2024-7be9bf38ff (crow-translate-2.11.1-2.fc39) 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.