%global commit 68fbb708e29df23ef54b2f3fc16669df29ed7d6b %global shortcommit %(c=%{commit}; echo ${c:0:7}) %{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)} %{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}} %{?python_enable_dependency_generator} Name: linuxcnc %global name_uc LinuxCNC Version: 2.10.0 Release: 33%{?dist} Summary: Realtime and Simulated CNC Control License: GPL-2.0-or-later AND LGPL-2.0-only AND LGPL-2.1-or-later AND BSL-1.0 AND Apache-2.0 AND BSD-1-Clause AND FSFAP AND MIT URL: http://linuxcnc.org/ Source0: https://github.com/%{name_uc}/%{name}/tarball/%{shortcommit} #Source0: https://github.com/%%{name_uc}/%%{name}/archive/refs/heads/master.zip #Patch3: %%{name}-0003-Allow-to-overwrite-default-CXXFLAGS.patch #Patch4: %%{name}-0004-Make-sure-all-compilations-honors-CPPFLAGS.patch BuildRequires: automake gcc-c++ zlib-devel libasan libtsan BuildRequires: pkgconfig(libudev) pkgconfig(libusb-1.0) pkgconfig(libtirpc) BuildRequires: pkgconfig(glib-2.0) pkgconfig(gtk+-3.0) BuildRequires: procps kmod python3-Yapps intltool tcl-devel tk-devel BuildRequires: bwidget tkimg tclx python3-gobject readline-devel python3-tkinter BuildRequires: boost-python3-devel libGLU-devel libXmu-devel python3-devel BuildRequires: desktop-file-utils psmisc ImageMagick asciidoc help2man BuildRequires: python3-pyupgrade Requires: tcl-%{name} = %{version} Requires: python3-%{name} = %{version} Requires: bwidget, python3-tkinter, boost-python3, tkimg %if 0%{?fedora} < 41 Requires: pygtk2 %else Requires: python3-gobject %endif #, xdg-utils Requires: python3-pyopengl python3-qt5 python3-scipy blt Requires: glade glade-libs gtksourceview4 xde-menu hicolor-icon-theme # if this is an initial installation, require the config, for an update # the user probably already has a configuration in his home directory Recommends: %{name}-config = %{version} Obsoletes: %{name} < 2.0.9-6 %description %{name_uc} controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more. This package only builds the simulated version! %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for %{name} %package config Summary: Sample configuration files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{python3} Buildarch: noarch %description config Configuration files for %{name}. Examples to use for initialization of various machines. Required for initial installation, application won't start without an initial configuration. %package -n tcl-%{name} Summary: Tcl files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Provides: tcl(Hal) = %{version} tcl(Linuxcnc) = %{version} tcl(Ngcgui) = %{version} %description -n tcl-%{name} Tcl files for %{name} %package -n python3-%{name} Summary: Python files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} AutoReq: no %description -n python3-%{name} Python files for %{name} %prep #%%{gpgverify} %autosetup -p1 -n %{name_uc}-%{name}-%{shortcommit} #%%autosetup -p1 -n %%{name}-master %build export CPPFLAGS="$(pkg-config --cflags python3)" export CPPFLAGS="-I%{_includedir}/readline5" export LDFLAGS="-L%{_libdir}/readline5 %{build_ldflags}" export CXXFLAGS="%{optflags} -Wl,--as-needed" sed -i 's#lib/tcltk/linuxcnc#%{tcl_sitearch}/linuxcnc%{version}#g' \ lib/python/rs274/options.py %if 0%{?fedora} >= 41 sed -i 's#python3.12 python3.11#python3.13 python3.12 python3.11#g' \ src/m4/ax_python.m4 sed -i 's|#include |#define _DEFAULT_SOURCE\n#include "sys/time.h"\n#include |g' \ src/emc/rs274ngc/gcodemodule.cc %endif for f in `find src/po/gmoccapy/ -name '*.po'`; do sed -i 's#charset=CHARSET#charset=UTF-8#g' $f; done # update FSF address... damn, those guys move around a lot # ... anyways, better make sure they get their mail %global oa1 675 Mass Ave, Cambridge, MA 02139, USA %global oa2 59 Temple Place, Suite 330, Boston, MA\\s+02111(\\-1307)?\\s+USA %global an 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA %global re_oa %{oa1}|%{oa2} set +x echo "Updating FSF address:" for f in `find . -type f -regextype posix-extended -regex '.*\.(c|cc|h|hh|scm|py|pl|inx|tcl|txt)$'`; do if grep -zqP "%{re_oa}" $f; then perl -0777 -i -pe 's/%{re_oa}/%{an}/g' $f echo "$f" fi done set -x # Correct depricated regex syntax -> SyntaxWarning: invalid escape sequence pyupgrade --exit-zero-even-if-changed src/emc/ini/update_ini.py pyupgrade --exit-zero-even-if-changed src/emc/usr_intf/qtplasmac/qtplasmac-materials.py pyupgrade --exit-zero-even-if-changed src/emc/usr_intf/pncconf/data.py pyupgrade --exit-zero-even-if-changed src/emc/usr_intf/stepconf/stepconf.py pyupgrade --exit-zero-even-if-changed lib/python/linux_event.py pyupgrade --exit-zero-even-if-changed lib/python/pyngcgui.py pyupgrade --exit-zero-even-if-changed lib/python/qtvcp/lib/gcode_utility/hole_circle.py pyupgrade --exit-zero-even-if-changed lib/python/qtvcp/lib/qt_ngcgui/ngcgui.py pyupgrade --exit-zero-even-if-changed lib/python/qtvcp/lib/ripper/gcode_ripper.py pyupgrade --exit-zero-even-if-changed lib/python/qtvcp/widgets/basic_probe.py pyupgrade --exit-zero-even-if-changed lib/python/qtvcp/widgets/versa_probe.py pyupgrade --exit-zero-even-if-changed tests/trajectory-planner/circular-arcs/run_all_tests.py pyupgrade --exit-zero-even-if-changed tests/motion-logger/basic/test-ui.py #export CPPFLAGS="${CPPFLAGS} -fsanitize=undefined -fPIE -fno-omit-frame-pointer" #export CPPFLAGS="${CPPFLAGS} -fPIE" pushd src sed -i -e 's#\(EMC2_TCL_DIR=\)${prefix}/lib/tcltk/%{name}#\1%{tcl_sitearch}/%{name}%{version}#g' \ -e 's#\(EMC2_TCL_LIB_DIR=\)${prefix}/lib/tcltk/%{name}#\1%{tcl_sitearch}/%{name}%{version}#g' \ -e 's#\(EMC2_LANG_DIR=\)${prefix}/share/%{name}/tcl/msgs#\1%{tcl_sitearch}/%{name}/tcl/msgs#g' \ -e 's#\(EMC2_RTLIB_DIR=\)${prefix}/lib/%{name}#\1%{_libdir}/%{name}#g' \ configure.ac autoreconf -ifv #--disable-build-documentation \ %configure --enable-non-distributable=yes \ --without-libmodbus \ --with-realtime=uspace \ --with-boost-python=boost_python%{python3_version_nodots} %set_build_flags %make_build %install pushd src %make_install SITEPY=%{python3_sitelib} \ DESTDIR=%{buildroot} \ DIR="install -p -d -m 0755" \ EXE="install -p -m 0755" \ FILE="install -p -m 0644" \ SETUID="install -p -m 0755" popd # move X11 app-defaults to the correct location mv %{buildroot}%{_sysconfdir}/X11 %{buildroot}%{_datadir}/ # linuxcnc.x86_64: E: shared-library-not-executable chmod +x %{buildroot}%{_libdir}/lib{posemath,pyplugin,rs274,tooldata}.so.0 chmod +x %{buildroot}%{_libdir}/lib{linuxcnchal,linuxcncini,nml}.so.0 # install icon files for x in 16 32 48; do mkdir -p %{buildroot}%{_datadir}/icons/hicolor/$x'x'$x/apps convert linuxcncicon.png -resize $x'x'$x -background transparent -extent $x'x'$x \ %{buildroot}%{_datadir}/icons/hicolor/$x'x'$x/apps/linuxcncicon.png done # icon file is installed in a fixed-size directory, but has a largely incorrect # size. Some desktop environments (e.g. GNOME) display them incorrectly. for icon in dimensions fullscreen_close fullscreen_open \ jog_speed_fast jog_speed_slow select_file \ skip_optional_active skip_optional_inactive; do convert %{buildroot}%{_datadir}/gmoccapy/icons/classic/32x32/actions/$icon.png \ -resize 32x32 -gravity center -background transparent -extent 32x32 \ %{buildroot}%{_datadir}/gmoccapy/icons/classic/32x32/actions/$icon.png done # install desktop files for app in debian/extras/usr/share/applications/*.desktop; do desktop-file-install \ --dir %{buildroot}%{_datadir}/applications \ ${app} done # not sure if/why 'lib' can't be hardcoded %global _lib32 /lib # correct tcl/tk installation directory install -d %{buildroot}%{tcl_sitearch} mv %{buildroot}%{_prefix}%{_lib32}/tcltk/%{name} %{buildroot}%{tcl_sitearch}/%{name}%{version} rm -rf %{buildroot}%{_prefix}%{_lib32}/tcltk %global _simdir /examples/sample-configs/sim ln -sf ../../../../..%{_datadir}/%{name}/ncfiles %{buildroot}%{_docdir}/%{name}/examples/nc_files ln -sf ../../../../../nc_files/remap-subroutines/qt_auto_probe_tool.ngc \ %{buildroot}%{_docdir}/%{name}%{_simdir}/woodpecker/python/qt_auto_probe_tool.ngc echo "Checking 'nc_files' is not a file" if [ -f %{buildroot}%{_docdir}/%{name}/examples/nc_files ]; then rm %{buildroot}%{_docdir}/%{name}/examples/nc_files echo " file 'nc_files' deleted!" fi pyupgrade --exit-zero-even-if-changed %{buildroot}/%{_bindir}/halcompile # fix a bunch of line endings sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/table.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/saddle.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/head.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/carousel.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/base.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/axis/vismach/VMC_toolchange/arm.stl sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/woodpecker/compensate.py sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/woodpecker/help_files/help.css sed -i 's/\r$//' %{buildroot}%{_docdir}/%{name}%{_simdir}/woodpecker/woodpecker_/images/'QTvcp Widgets_files'/blank_data/inject.css sed -i 's/\r$//' %{buildroot}%{_bindir}/z_level_compensation # spurious-executable-perm chmod -x %{buildroot}%{_docdir}/%{name}%{_simdir}/woodpecker/tool_icons/{\ ball_end_mill,ballend_straight,center_drill,drill,spiral_ball_end,probe,\ gauge,not_found,spiral_downcut_2F,spiral_upcut,surfacing,tapered_ball_end,\ upcut_spiral,vbit-60,vbit-90,vbit-90deg}.png # TODO convert setup_designer to Fedora. For now, just give a message and exit sed -i -e 's|\(#!/bin/bash\)|\1\n\necho -e "\nSetup Designer needs to be rewritten for Fedora.\n"\ echo -e "You will need to access the raw file in your %{_bindir} directory"\ echo -e "and convert packages, commands, and directories to their Fedora"\ echo -e "equivalents.\n"\n\nexit|' %{buildroot}%{_bindir}/setup_designer # a primitive help message sed -i -e 's#\(import sys\)#\1\ if len(sys.argv) > 1:\ print("Z level compensation")\ print("for LinuxCNC")\ sys.exit()\n\n#' %{buildroot}%{_bindir}/z_level_compensation #tool_mmap_read # generate missing man pages for app in melfagui millturngui modcompile qtplasmac_gcode \ tool_watch xyzab-tdr-gui setup_designer z_level_compensation; do help2man --no-discard-stderr "%{buildroot}%{_bindir}/$app" \ --version-option=version --output=%{buildroot}%{_mandir}/man1/$app.1 done # some symlinks were shifted, probably when their config dirs were 'orphaned' # these are my best guesses as to where they pointed to originally #ln -sfn ../../remap/rack-toolchange/nc_subroutines \ # %%{buildroot}%%{_docdir}/%%{name}%%{_simdir}/axis/orphans/iocontrol-removed/nc_subroutines #ln -sfn ../../panelui-demo/tool.tbl \ # %%{buildroot}%%{_docdir}/%%{name}%%{_simdir}/axis/orphans/iocontrol-removed/tool.tbl # the .so-s don't strip to the satisfaction of the linter, # maybe they're just shy for f in `find %{buildroot}/ -name '*.so*'`; do strip -sv $f; done # remove the shebang line in python library modules for lib in `find %{buildroot}%{python3_sitelib}/ -type f -regex '.*\.py'` \ %{buildroot}%{_datadir}/qtvcp/panels/spindle_belts/spindle_belts_handler.py; do sed '1{\@^#!/usr/bin/\(env \|\)python@d}' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done # delete some zero length files find %{buildroot}/%{tcl_sitearch}/%{name}%{version}/ -size 0 -delete find %{buildroot}%{_docdir}/%{name}/examples/sample-configs/ -size 0 -delete # src/libnml/cms/cms_cfg.cc: my_hostent_ptr = gethostbyname(my_hostname); # src/libnml/cms/cms_cfg.cc: buffer_hostent_ptr = gethostbyname(buffer_host); # src/libnml/buffer/tcpmem.cc: server_host_entry = gethostbyname(BufferHost); # src/emc/usr_intf/sockets.c: hostinfo = gethostbyname(hostname); %check %{make_build} -C src pycheck V=1 #./scripts/runtests -u tests/build/ %find_lang %{name} %find_lang gmoccapy %files -f gmoccapy.lang -f %{name}.lang %{_bindir}/* %{_libdir}/%{name} %{_prefix}%{_lib32}/%{name} %{_mandir}/man?/* %config(noreplace) %{_sysconfdir}/%{name} #%%{_sysconfdir}/init.d/realtime %{_datadir}/applications/%{name}.desktop %{_datadir}/applications/%{name}-stepconf.desktop %{_datadir}/applications/%{name}-latency.desktop %exclude %{_datadir}/applications/%{name}-latency-histogram.desktop %exclude %{_datadir}/applications/%{name}-pncconf.desktop %exclude %{_datadir}/applications/%{name}-[d,g,h,i,m,u]*.desktop # share ownership if this dir with xorg. %{_datadir}/X11/app-defaults/Tk%{name_uc} %{_libdir}/lib*.so.0 #%%{_libdir}/%%{name}/canterp.so %exclude %{_libdir}/*.a %{_datadir}/icons/hicolor/??x??/apps/%{name}icon.png %license COPYING COPYING.more #%%exclude %%{_mandir}/man3/MODULE_LICENSE.3rtapi.gz #%%license %%{_mandir}/man3/MODULE_LICENSE.3rtapi.gz %doc TODO ISSUE_TEMPLATE.md docs/README.adoc #%%{python3_sitelib}/%%{name}/* %files config %{_docdir}/%{name} %{_datadir}/%{name} %{_datadir}/axis %{_datadir}/glade/catalogs/hal_python.xml %{_datadir}/glade/pixmaps/hicolor/22x22/actions/widget-gladevcp-*.png %{_datadir}/gmoccapy %{_datadir}/gscreen %{_datadir}/gtksourceview-4/language-specs/gcode.lang %{_datadir}/qtvcp %exclude %{_docdir}/%{name}/examples/sample-configs/sim/qtplasmac/LICENSE %exclude %{_datadir}/gmoccapy/icons/material/LICENSE %exclude %{_datadir}/gmoccapy/icons/material-light/LICENSE %license COPYING COPYING.more %doc configs/maintainer.txt %files -n tcl-%{name} %{tcl_sitearch}/%{name}%{version} %license COPYING COPYING.more %doc TODO README.md %files -n python3-%{name} %pycached %{python3_sitelib}/*.py %{python3_sitelib}/%{name}.so %{python3_sitelib}/_hal.so %{python3_sitelib}/_togl.so %{python3_sitelib}/gcode.so %{python3_sitelib}/lineardeltakins.so %{python3_sitelib}/rotarydeltakins.so %{python3_sitelib}/gladevcp %{python3_sitelib}/gmoccapy %{python3_sitelib}/gscreen %{python3_sitelib}/plasmac %{python3_sitelib}/pncconf %{python3_sitelib}/pyui %{python3_sitelib}/qtvcp %{python3_sitelib}/rs274 %{python3_sitelib}/stepconf %{python3_sitelib}/touchy %license COPYING COPYING.more %doc TODO README.md %files devel %{_includedir}/%{name}/ %{_libdir}/lib*.so #%%{_datadir}/%%{name}/ncfiles/M102.c <- actually a config file %license COPYING COPYING.more %doc TODO README.md %changelog * Fri Oct 25 2024 pappy 2.10.0-33 - Latest upstream * Sat Oct 19 2024 pappy 2.10.0-32 - Latest upstream * Thu Oct 03 2024 pappy 2.10.0-31 - Latest upstream * Thu Sep 26 2024 pappy 2.10.0-30 - Latest upstream * Sun Sep 15 2024 pappy 2.10.0-29 - Latest upstream * Sun Sep 08 2024 pappy 2.10.0-28 - Latest upstream * Mon Aug 26 2024 pappy 2.10.0-27 - Latest upstream * Wed Jul 10 2024 pappy 2.10.0-26 - Latest upstream * Wed Jun 19 2024 pappy 2.10.0-25 - Latest upstream * Fri May 24 2024 pappy 2.10.0-24 - Latest upstream * Thu Apr 25 2024 pappy 2.10.0-23 - Latest upstream Fedora 40 * Mon Apr 01 2024 pappy 2.10.0-22 - Latest upstream Happy April Fools 🙃 * Sat Mar 16 2024 pappy 2.10.0-21 - Latest upstream Happy St Patrick's ☘ * Thu Feb 22 2024 pappy 2.10.0-20 - Latest upstream * Wed Feb 14 2024 pappy 2.10.0-19 - Latest upstream, happy Valentine's ❤️ * Sun Jan 21 2024 pappy 2.10.0-18 - Latest upstream * Thu Jan 04 2024 pappy 2.10.0-17 - Latest upstream * Wed Dec 27 2023 pappy 2.10.0-16 - Latest upstream * Sat Dec 02 2023 pappy 2.10.0-15 - Latest upstream * Sun Nov 19 2023 pappy 2.10.0-14 - Latest upstream - drop libgpoid-devel requirement * Sun Sep 24 2023 pappy 2.10.0-13 - Latest upstream - Drop python files back into site-python. There has to be - an easier way ... * Tue Jul 11 2023 pappy 2.10.0-12 - Latest upstream - Yapps update for fedora-review * Sun May 07 2023 pappy 2.10.0-11 - Latest upstream * Tue Apr 18 2023 pappy 2.10.0-10 - Hoist python files out of site-python to - site-python/linuxcnc - Restore Axis DRO OpenGL readouts, fixed upstream * Sun Mar 19 2023 pappy 2.10.0-9 - FSF address correction built into spec file * Mon Mar 06 2023 pappy 2.10.0-8 - latest upstream * Fri Feb 17 2023 pappy 2.10.0-7 - latest upstream * Wed Feb 08 2023 pappy 2.10.0-6 - glnav.py patch * Wed Feb 08 2023 pappy 2.10.0-5 - Latest upstream * Sat Feb 04 2023 pappy 2.10.0-4 - One more try at this OpenGL thing with the latest upstream * Fri Feb 03 2023 pappy 2.10.0-3 - move sample config files back to their original location - and adjust symlinks accordingly * Wed Feb 01 2023 pappy 2.10.0-2 - Sebastian Kuzminsky's - force pyOpenGL to GLX patch * Sun Jan 29 2023 pappy 2.10.0-1 - Stopped running, update to latest upstream * Sun Nov 27 2022 pappy 2.9.0-11 - Update to Fedora 37 * Wed Sep 21 2022 pappy 2.9.0-10 - Update to latest source * Wed Sep 21 2022 pappy 2.9.0-9 - Update to Fedora 36 * Fri Nov 19 2021 pappy 2.9.0-8 - Update to latest source * Fri Nov 19 2021 pappy 2.9.0-7 - Update to Fedora 35 * Fri Jan 22 2021 pappy 2.9.0-7 - Moved .desktop files that launch documentation into - doc package (there are some targets in the source - but they don't get built (or just not installed?)) - Renamed doc package config and made it required because - axis won't run without at least one configuration - file. * Thu Dec 31 2020 pappy 2.9.0-6 - py 3.9 removed array.tostring() function x 3 - Yippie, it works! * Thu Dec 31 2020 pappy 2.9.0-5 - py 3.9 removed array.tostring() function x 2 * Thu Dec 31 2020 pappy 2.9.0-4 - py 3.9 removed array.tostring() function * Thu Dec 31 2020 pappy 2.9.0-3 - Install config files * Tue Sep 1 2020 pappy 2.9.0-2 - My shot at a package for this * Tue Sep 1 2020 spike 2.9.0-2.20200901giteac9994 - Updated to lastest git common on upstream master branch - Added 'AutoReq: No' to -devel package since rpm is silly :( - Fixed globs for shared object files according to fedora packaging - guidelines (specify version explicitly) - Fixed ambiguous python shebang of qtdragon_handler.py