# git ls-remote git://github.com/vlachoudis/bCNC/ %global git_commit 523f1ec75d839de5d599420bb5b751f905324463 %global git_date 20221017 %global git_short_commit %(echo %{git_commit} | cut -c -8) %global git_suffix %{git_date}git%{git_short_commit} Name: bCNC Version: 0.9.14.52~%{git_suffix} Release: 6%{?dist} Summary: GRBL CNC command sender, autoleveler and G-code editor # GPL-2.0-only: # setup.py # bCNC/lib/svgcode.py # BSD-3-Clause: # bCNC/lib/ttf.py # MIT: # tests/arduino-loopback/test-loopback.py License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND MIT URL: https://github.com/vlachoudis/%{name} Source0: %{url}/archive/%{git_commit}/%{name}-%{git_suffix}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: desktop-file-utils BuildRequires: ImageMagick BuildRequires: findutils BuildRequires: js-jquery BuildRequires: sed # for tests BuildRequires: python3dist(pytest) Requires: hicolor-icon-theme Requires: js-jquery Requires: python3-utils Requires: python3-numpy-stl Provides: bundled(fastclick) Provides: bundled(svgcode) = 0.2 Patch0: bCNC-0.9.14.52-locale-fix.patch Patch2: bCNC-0.9.14.52-system-paths.patch # https://github.com/vlachoudis/bCNC/pull/1755 Patch3: bCNC-0.9.14.52-packages-fix.patch # https://github.com/vlachoudis/bCNC/issues/1761 # https://bugzilla.redhat.com/show_bug.cgi?id=2142632 Patch4: bCNC-0.9.14.52-opencv-relax-deps.patch %description GRBL CNC command sender, autoleveler, G-code editor, digitizer, CAM and swiss army knife for all your CNC needs. %prep %autosetup -n %{name}-%{git_commit} -p1 # Icon convert magick bCNC/bCNC.png -resize 256x256 ./bCNC.png # Unbundle python3-utils and python3-numpy-stl pushd bCNC/lib rm -f python_utils/* rmdir python_utils rm -f stl/* rmdir stl popd # Drop shebangs pushd bCNC sed -i '1 { /^#!/ d }' __main__.py bmain.py popd for f in bCNC.desktop bCNC.ini bCNC.xbm bCNC.png icons images do mv "bCNC/$f" ./ done # Drop artifacts pushd bCNC rm -f {bCNC.bat,bCNC.ini,bCNC.xbm,make-exe.bat} # Remove bytecode rm -f lib/python_utils/compat.py* popd # Unbundle jQuery pushd bCNC/pendant rm -f jquery-2.1.4.min.js ln -s %{_datadir}/javascript/jquery/latest/jquery.min.js jquery-2.1.4.min.js popd # Drop tests, because it uses PIP to install specific package versions # we don't have in Fedora (pyautogui). Todo: fix upstream rm -rf tests %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # Binary install -Dpm 0755 bCNC.sh %{buildroot}%{_bindir}/bCNC # Icon install -Dpm 0644 bCNC.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/bCNC.png # Desktop file mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install -m 0644 --add-category="Utility" \ --dir=%{buildroot}%{_datadir}/applications \ bCNC.desktop # Config install -Dpm 0644 bCNC.ini %{buildroot}%{_sysconfdir}/bCNC.ini # Bitmap file install -Dpm 0644 bCNC.xbm %{buildroot}%{_datadir}/%{name}/bCNC.xbm # Icons mv icons %{buildroot}%{_datadir}/%{name} # Images mv images %{buildroot}%{_datadir}/%{name} # Man page install -Dpm 0644 bCNC.1 %{buildroot}%{_mandir}/man1/bCNC.1 %pyproject_save_files bCNC #%%check #%%pytest %files -f %{pyproject_files} %license LICENSE.md %doc README.md %{_bindir}/bCNC %config(noreplace) %{_sysconfdir}/bCNC.ini %{_mandir}/man1/* %{_datadir}/icons/hicolor/256x256/apps/bCNC.png %{_datadir}/applications/bCNC.desktop %{_datadir}/bCNC %changelog * Fri Jan 02 2026 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-6 - Repackaged according to new python packaging guidelines - Fixed according to the review Related: rhbz#1684603 * Wed Nov 23 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-5 - Fixed according to the review Related: rhbz#1684603 * Mon Nov 14 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-4 - Fixed according to the review Related: rhbz#1684603 * Thu Nov 10 2022 Jaroslav Škarvada - 0.9.14.52-20221017git523f1ec7-3 - Fixed according to the review Related: rhbz#1684603 * Tue Nov 1 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-2 - Fixed according to the review Related: rhbz#1684603 * Mon Oct 17 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-1 - New snapshot * Mon Oct 17 2022 Jaroslav Škarvada - 0.9.14.52~20210908git36896e5f-1 - Updated according to the review Related: rhbz#1684603 * Wed Sep 8 2021 Jaroslav Škarvada - 0.9.14.52-0.2.20210908git36896e5f - New version * Fri Feb 8 2019 Jaroslav Škarvada - 0.9.14.52-0.1.beta - Initial release