File gcodeworkshop.spec of Package gcodeworkshop
#
# spec file for package gcodeworkshop
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define srcver 2025-02
Name: gcodeworkshop
Version: 2025.02
Release: 0
Summary: Text editor for CNC programmers
License: GPL-3.0-or-later
URL: https://github.com/GCodeProjects/GCodeWorkShop
Source0: %{url}/archive/refs/tags/%{srcver}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6SerialPort)
BuildRequires: cmake(Qt6Network)
BuildRequires: cmake(Qt6Core5Compat)
BuildRequires: cmake(Qt6PrintSupport)
BuildRequires: hicolor-icon-theme
BuildRequires: desktop-file-utils
Recommends: %{name}-lang
%description
GCodeWorkShop is a fork of EdytorNC, a text editor for CNC programmers.
%lang_package
%prep
%autosetup -p1 -n GCodeWorkShop-%{srcver}
sed -i '/xdg-open/d' install/linux/%{name}.desktop
sed -i 's|\(share/doc/\)|\1packages/|' %{name}_top.pro
%build
%qmake6 %{name}_top.pro \
PREFIX=%{_prefix}
%qmake6_build
%qmake6_build i18n
%install
%qmake6_install
desktop-file-edit --remove-category="Development" %{buildroot}%{_datadir}/applications/%{name}.desktop
desktop-file-edit --add-category="Science;Robotics" %{buildroot}%{_datadir}/applications/%{name}.desktop
%find_lang %{name} --with-qt --all-name
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%files
%doc %{_defaultdocdir}
%{_bindir}/%{name}
%{_bindir}/gcodefileserver
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/examples/
%{_datadir}/%{name}/examples/0100.nc
%{_datadir}/%{name}/examples/cnc_tips.txt
%{_datadir}/%{name}/examples/FANUC0M.nc
%{_datadir}/%{name}/examples/FANUC0T.nc
%{_datadir}/%{name}/examples/FLANGE.nc
%{_datadir}/%{name}/examples/HAAS.nc
%{_datadir}/%{name}/examples/HK.nc
%{_datadir}/%{name}/examples/macro7.nc
%{_datadir}/%{name}/examples/OSP5020M.nc
%{_datadir}/%{name}/examples/OSP7000L.nc
%{_datadir}/%{name}/examples/PHILIPS.nc
%{_datadir}/%{name}/examples/SINUMERIK840D.nc
%{_datadir}/%{name}/examples/SINUMERIK850.nc
%{_datadir}/%{name}/examples/TOKARKA.NC
%{_datadir}/mime/packages/application-x-g-code.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/edytornc.png
%{_datadir}/icons/hicolor/*/mimetypes/application-x-g-code.png
%license LICENSE
%files lang -f %{name}.lang
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/lang
%changelog