#
# Conditional build:
-%bcond_with tests # build with tests
+%bcond_without tests # build with tests
-%define upversion 2015.03-1
+%ifnarch %{x8664}
+%undefine with_tests
+%endif
Summary: The Programmers Solid 3D CAD Modeller
Name: openscad
-Version: 2015.03.1
-Release: 0.1
+Version: 2019.05
+Release: 1
# COPYING contains a linking exception for CGAL
# Appdata file is CC0
# Examples are CC0
License: GPLv2 with exceptions and CC0
Group: Applications/Engineering
-Source0: http://files.openscad.org/%{name}-%{upversion}.src.tar.gz
-# Source0-md5: c5994220078f5f5c13984da304e4a2fe
+Source0: http://files.openscad.org/%{name}-%{version}.src.tar.gz
+# Source0-md5: 2b63e249d56e2eba62ed5b042e1d82bc
Patch0: %{name}-polyclipping.patch
+Patch1: localedir.patch
URL: http://www.openscad.org/
+BuildRequires: Qt5Network-devel
+BuildRequires: Qt5Concurrent-devel
+BuildRequires: Qt5Multimedia-devel
+BuildRequires: Qt5DBus-devel
+BuildRequires: Qt5PrintSupport-devel
BuildRequires: CGAL-devel >= 3.6
BuildRequires: ImageMagick
BuildRequires: Mesa-dri-driver-swrast
BuildRequires: bison >= 2.4
BuildRequires: boost-devel >= 1.35
BuildRequires: desktop-file-utils
+BuildRequires: double-conversion-devel
BuildRequires: eigen3
BuildRequires: flex >= 2.5.35
BuildRequires: fontconfig-devel >= 2.10
BuildRequires: glib2-devel
BuildRequires: gmp-devel >= 5.0.0
BuildRequires: harfbuzz-devel >= 0.9.19
+BuildRequires: lib3mf-devel >= 1.8.1
+BuildRequires: libzip-devel
+BuildRequires: libxml2-devel
BuildRequires: mpfr-devel >= 3.0.0
BuildRequires: opencsg-devel >= 1.3.2
+BuildRequires: pkgconfig
BuildRequires: polyclipping-devel >= 6.1.3
BuildRequires: procps
BuildRequires: python
-BuildRequires: qscintilla2-devel
-BuildRequires: qt4-build >= 4.4
+BuildRequires: qscintilla2-qt5-devel >= 2.11.2
+BuildRequires: qt5-build
BuildRequires: xorg-xserver-Xvfb
Requires: font(liberationmono)
Requires: font(liberationsans)
License: LGPLv2+ and LGPLv2 and LGPLv3+ and (GPLv3 or LGPLv2) and (GPLv3+ or LGPLv2) and (CC-BY-SA or LGPLv2+) and (CC-BY-SA or LGPLv2) and CC-BY and BSD and MIT and Public Domain
URL: https://www.github.com/openscad/MCAD
Requires: %{name} = %{version}-%{release}
+%if "%{_rpmversion}" >= "5"
BuildArch: noarch
+%endif
%description MCAD
This library contains components commonly used in designing and
expect some API changes, however many things are already working.
%prep
-%setup -qn %{name}-%{upversion}
+%setup -q
%patch0 -p1
+%patch1 -p1
-rm -rf src/polyclipping
+# use system package
+%{__rm} -r src/ext/polyclipping
%build
-qmake-qt4 \
+qmake-qt5 \
PREFIX=%{_prefix}
%{__make}
-# tests
-cd tests
-install -d build
-cd build
-%{__cmake} ..
+%if %{with tests}
+mkdir -p tests/build
+cd tests/build
+%cmake ../
%{__make}
-cd ../..
+%{__make} -j1 test
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-
-%{__make} -j1 install \
+%{__make} install \
INSTALL_ROOT=$RPM_BUILD_ROOT
-rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/fonts
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/lgpl-2.1.txt
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/README.markdown
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/TODO
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}/fonts
-:> %{name}.lang
-# TODO: fix this to find the files
-#%find_lang %{name}
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/{%{name},}/locale
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/lgpl-2.1.txt
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/README.markdown
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/libraries/MCAD/TODO
+%find_lang %{name}
-%if %{with tests}
-cd tests
-ctest
-cd ..
-%endif
+%clean
+rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc README.md RELEASE_NOTES
+%doc README.md RELEASE_NOTES.md
%attr(755,root,root) %{_bindir}/%{name}
-%{_datadir}/appdata/*.xml
+%{_datadir}/metainfo/*.xml
%{_desktopdir}/%{name}.desktop
%{_pixmapsdir}/%{name}.png
%{_datadir}/mime/packages/%{name}.xml
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/examples
%{_datadir}/%{name}/color-schemes
-%dir %{_datadir}/%{name}/locale
-# drop when find_lang is fixed
-%{_datadir}/%{name}/locale/*
%dir %{_datadir}/%{name}/libraries
%{_mandir}/man1/*
%defattr(644,root,root,755)
%doc libraries/MCAD/README.markdown libraries/MCAD/TODO
%{_datadir}/%{name}/libraries/MCAD
-
-%changelog
-
-%clean
-rm -rf $RPM_BUILD_ROOT