public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/electron-cash] rawhide: spec modernization fixes rhbz#2377250
@ 2026-06-20 22:49 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-06-20 22:49 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/electron-cash
            Branch : rawhide
            Commit : e9ff09222306fa0716dca51b5d44fb8438193397
            Author : Filipe Rosset <filiperosset@fedoraproject.org>
            Date   : 2026-06-14T20:36:53-03:00
            Stats  : +32/-19 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/electron-cash/c/e9ff09222306fa0716dca51b5d44fb8438193397?branch=rawhide

            Log:
            spec modernization fixes rhbz#2377250

Signed-off-by: Filipe Rosset <filiperosset@fedoraproject.org>

---
diff --git a/electron-cash.spec b/electron-cash.spec
index 7f480f5..daf1988 100644
--- a/electron-cash.spec
+++ b/electron-cash.spec
@@ -1,6 +1,6 @@
 Name:           electron-cash
 Version:        4.4.5
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A lightweight Bitcoin Cash client
 
 License:        MIT
@@ -24,7 +24,6 @@ BuildArch:      noarch
 ExcludeArch:    %{ix86}
 
 BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
 BuildRequires:  python3-qt5-devel
 BuildRequires:  desktop-file-utils
 BuildRequires:  gettext
@@ -37,12 +36,7 @@ Requires:       qt5-qtbase
 Requires:       qt5-qtsvg
 Requires:       qt5-qtmultimedia
 
-# Manually from contrib/requirements/requirements-binaries.txt
-Requires:       python3-qt5
-Requires:       python3-pycryptodomex
-Requires:       python3-psutil
-Requires:       python3-cryptography
-Requires:       python3-zxing-cpp >= 2.0.0
+# Python dependencies are automatically generated by the dependency generator
 
 Recommends:     libsecp256k1-abc
 Requires:       zbar
@@ -63,15 +57,23 @@ it does not download the Bitcoin block chain.
 %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
 %autosetup -p1 -n electron_cash-%{version}
 
+# Relax PyQt5 and zxing-cpp version constraints to match Fedora packaging
+sed -i -E 's/PyQt5>=[0-9.]+,<=?[0-9.]+/PyQt5>=5.12.3/' contrib/requirements/requirements.txt contrib/requirements/requirements-binaries.txt
+sed -i -E 's/PyQt5-sip<=?[0-9.]+/PyQt5-sip/' contrib/requirements/requirements.txt contrib/requirements/requirements-binaries.txt
+sed -i -E 's/zxing-cpp>=[0-9.]+/zxing-cpp>=2.2.0/' contrib/requirements/requirements.txt contrib/requirements/requirements-binaries.txt
+
 #pre-built bundled library
 rm -v ./electroncash/*.so*
 
 #pre-built tor binary
 rm -v ./electroncash/tor/bin/tor
 
-#budled libraries
+#bundled libraries
 rm -rfv ./packages/
 
+%generate_buildrequires
+%pyproject_buildrequires -r -x gui
+
 %build
 pyrcc5 icons.qrc -o electroncash_gui/qt/icons_rc.py
 
@@ -81,10 +83,14 @@ install -D %{SOURCE4} electroncash_plugins/fusion/protobuf/fusion.proto
 protoc --proto_path=electroncash/ --python_out=electroncash/ electroncash/paymentrequest.proto
 protoc --proto_path=electroncash_plugins/fusion/protobuf/ --python_out=electroncash_plugins/fusion/ electroncash_plugins/fusion/protobuf/fusion.proto
 
-%{py3_build}
+%{pyproject_wheel}
 
 %install
-%{py3_install}
+%{pyproject_install}
+%pyproject_save_files -l electroncash electroncash_gui electroncash_plugins
+
+# Clean up unwanted share dir installed inside site-packages by setup.py wheel build
+rm -rf %{buildroot}%{python3_sitelib}/builddir
 
 # Remove shebang lines from .py files that aren't executable, and
 # remove executability from .py files that don't have a shebang line:
@@ -95,31 +101,38 @@ find %{buildroot} -name \*.py \
   -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
   -exec chmod a-x {} \; \) \)
 
+# Manually install desktop file, icons, and appdata/metainfo xml
+# because PEP 517 build fails to install them system-wide
 desktop-file-install                                    \
---dir=%{buildroot}%{_datadir}/applications              \
-%{buildroot}%{_datadir}/applications/%{name}.desktop
+  --dir=%{buildroot}%{_datadir}/applications            \
+  electron-cash.desktop
+
+install -D -p -m 0644 icons/electron-cash.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
+install -D -p -m 0644 icons/electron-cash.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
+install -D -p -m 0644 icons/electron-cash.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
+install -D -p -m 0644 org.electroncash.ElectronCash.appdata.xml %{buildroot}%{_datadir}/metainfo/org.electroncash.ElectronCash.appdata.xml
 
 
 %check
+%pyproject_check_import -e "electroncash.utils.macos" -e "electroncash.qrreaders.osxqrdetect" -e "electroncash.plot" -e "electroncash.websockets" -e "electroncash_gui.qt.console2*" -e "electroncash_plugins.keepkey*" -e "electroncash_plugins.ledger*" -e "electroncash_plugins.satochip*" -e "electroncash_plugins.shuffle_deprecated*" -e "electroncash_plugins.trezor*"
+desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
 appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/org.electroncash.ElectronCash.appdata.xml
 
-%files
+%files -f %{pyproject_files}
 %doc AUTHORS
 %doc README.rst
 %doc RELEASE-NOTES
-%license LICENCE
 %{_bindir}/%{name}
 %{_datadir}/icons/hicolor/256x256/apps/%{name}.png
 %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
 %{_datadir}/pixmaps/%{name}.png
 %{_datadir}/applications/%{name}.desktop
 %{_datadir}/metainfo/org.electroncash.ElectronCash.appdata.xml
-%{python3_sitelib}/electroncash/
-%{python3_sitelib}/electroncash_gui/
-%{python3_sitelib}/electroncash_plugins/
-%{python3_sitelib}/Electron_Cash-%{version}-py%{python3_version}.egg-info
 
 %changelog
+* Sun Jun 14 2026 Filipe Rosset <filiperosset@fedoraproject.org> - 4.4.5-3
+- spec modernization fixes rhbz#2377250
+
 * Thu Jun 04 2026 Python Maint <python-maint@redhat.com> - 4.4.5-2
 - Rebuilt for Python 3.15
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-20 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-20 22:49 [rpms/electron-cash] rawhide: spec modernization fixes rhbz#2377250 Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox