%global date 20170701
%global commit0 a9a4ec75db12dd69290c87ff5ed8a7998911ff4b
%global shortcommit0 %(c=%{commit0}; echo ${c:0:12})
%global the_owner jpcgt
Name: flatcam
Version: 8.5
Release: 8.%{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}
Requires: python-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
%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 Jan 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 8.5-8.20170701gita9a4ec75db12
- Remove obsolete scriptlets
* Sat Aug 26 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-7.20170701gita9a4ec75db12
- Use non-versioning Requires: for python-svg-path.
* Thu Aug 24 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-6.20170701gita9a4ec75db12
- Add direct Requires instead of %%{py2_dist svg-path} macro.
* Thu Aug 24 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-5.20170701gita9a4ec75db12
- Switch to use python2dist macros,
- Add upstream link to AppData patch.
* Tue Aug 22 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-4.20170701gita9a4ec75db12
- Drop patches upstream merged,
- Add AppData metadata.
* Wed May 31 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-3.20170519git58f66ca8664b
- Install .desktop and icons files.
* Sat May 27 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.5-2.20170519git58f66ca8664b
- Fix startup script.
* Tue May 23 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 8.4.20151026-1
- Initial RPM release.