%global date 20170701 %global commit0 a9a4ec75db12dd69290c87ff5ed8a7998911ff4b %global shortcommit0 %(c=%{commit0}; echo ${c:0:12}) %global the_owner jpcgt Name: flatcam Version: 8.5 Release: 6.%{date}git%{shortcommit0}%{?dist} Summary: 2D Computer-Aided PCB Manufacturing License: MIT Url: http://flatcam.org/ Source0: https://bitbucket.org/%{the_owner}/%{name}/get/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz # Reported upstream as: https://bitbucket.org/jpcgt/flatcam/pull-requests/74 Patch0: https://bitbucket.org/dwrobel/%{name}/commits/bf0c59ba2b9c78815270607f6d814e93af410cf8/raw#/%{name}.appdata.xml BuildArch: noarch BuildRequires: /usr/bin/git BuildRequires: python2-devel BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: %{py2_dist simplejson} Requires: PyQt4 Requires: %{py2_dist numpy} Requires: %{py2_dist scipy} # as %{py2_dist svg-path} doesn't work we're forced to use direct Requires: Requires: python2-svg-path Requires: %{py2_dist matplotlib} Requires: python2-matplotlib-qt4 Requires: %{py2_dist rtree} Requires: %{py2_dist shapely} Requires: hicolor-icon-theme %description A program for preparing CNC jobs for making PCBs on a CNC router. Among other things, it can take a Gerber file generated by your favorite PCB CAD program, and create G-Code for Isolation routing. %prep %autosetup -S git -n %{the_owner}-%{name}-%{shortcommit0} rm -f setup_ubuntu.sh setup_ubuntu.sh upgrade_geos.sh %build %py2_build %install %py2_install # install icon file install -d %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/ ln -sfr %{buildroot}%{_datadir}/%{name}/%{name}_icon128_inv.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png # install desktop file install -p -D %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop # install and validate appdata install -p -m 0644 -D %{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml %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 %license LICENSE %doc README.md %{_bindir}/%{name} %{python2_sitelib}/* %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/* %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/* %{_datadir}/appdata/*.appdata.xml %changelog * Thu Aug 24 2017 Damian Wrobel - 8.5-6.20170701gita9a4ec75db12 - Add direct Requires instead of %%{py2_dist svg-path} macro. * Thu Aug 24 2017 Damian Wrobel - 8.5-5.20170701gita9a4ec75db12 - Switch to use python2dist macros, - Add upstream link to AppData patch. * Tue Aug 22 2017 Damian Wrobel - 8.5-4.20170701gita9a4ec75db12 - Drop patches upstream merged, - Add AppData metadata. * Wed May 31 2017 Damian Wrobel - 8.5-3.20170519git58f66ca8664b - Install .desktop and icons files. * Sat May 27 2017 Damian Wrobel - 8.5-2.20170519git58f66ca8664b - Fix startup script. * Tue May 23 2017 Damian Wrobel - 8.4.20151026-1 - Initial RPM release.