%global date 20170503 %global vdate %(x=%{date}; echo "${x:0:4}-${x:4:2}-${x:6:2}") %global srcdir %{name}-sourcecode-c5e511a2cc6ca3ab84187056aeb3a1f85027d63e %global py_setup st-setup.py Name: dxf2gcode Version: %{date} Release: 1%{?dist} Summary: 2D drawings to CNC machine compatible G-Code converter License: GPLv3+ and MIT Url: https://sourceforge.net/p/dxf2gcode/wiki/Home/ Source0: https://sourceforge.net/projects/%{name}/files/DXF2GCODE_development_Source_%{vdate}.zip # Upstream reference: https://sourceforge.net/p/dxf2gcode/tickets/91/ Patch0: %{name}-0001-Add-support-for-system-wide-installation.patch # Upstream reference: https://sourceforge.net/p/dxf2gcode/tickets/92/ Patch1: %{name}-0002-Fix-issues-tracking-system-URL.patch # Upstream reference: https://sourceforge.net/p/dxf2gcode/tickets/93/ Patch2: %{name}-0003-Fix-AttributeError-object-has-no-attribute-update.patch BuildArch: noarch BuildRequires: /usr/bin/git BuildRequires: /usr/bin/convert BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: python3-devel BuildRequires: python3-qt5 BuildRequires: qt5-linguist %if 0%{?fedora} > 25 BuildRequires: %{py3_dist pyopengl} %else BuildRequires: python3-pyopengl %endif Requires: /usr/bin/pstoedit Requires: hicolor-icon-theme Requires: python3-qt5 %if 0%{?fedora} > 25 Requires: %{py3_dist pyopengl} %else Requires: python3-pyopengl %endif %description %{name} is a tool for converting 2D (DXF, PDF, PS) drawings to CNC machine compatible GCode. It has the following features: - Integration in EMC2, - Fully adjustable Postprocessor, - G0 moves reduction by route optimization, - Import of DXF and PDF, - Improved accuracy for splines import by Line and Arc's, - Mill parameter specification by layers, - Drag knife and lathe support, - Breaks a.k.a Tabs support, - AutoCAD Blocks and Inserts, - Multiple tools, - Multiple language support: English, German, French, Russian, - 3D viewer. %prep %autosetup -S git -n %{srcdir} # remove superfluous shebang sed -i '/^#!\/usr\/bin\/python/d' source/globals/helperfunctions.py # generate some useful data for Help->About menu item sed -i -e 's/\$Author\$/Christian Kohloffel/g' \ -e 's/\$Date\$/%{vdate}/g' \ -e 's/\$Revision\$//g' \ source/globals/constants.py %build pushd source # convert the icon file convert images/dxf2gcode_logo.png images/%{name}.svg # regenerate *images5_rc.py and *ui5.py files python3 ./make_py_uic.py 5 # regenerate translation files lrelease-qt5 i18n/*.ts %py3_build popd %install pushd source %py3_install desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml popd %find_lang %{name} --with-qt --without-mo %post /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -f %{name}.lang %license source/COPYING %{_bindir}/%{name} %{python3_sitelib}/* %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/i18n %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/* %{_datadir}/appdata/*.appdata.xml %changelog * Wed Sep 06 2017 Damian Wrobel - 20170503-1 - Initial RPM release.