File openscad.spec of Package openscad

%define realname openscad
%define realver  2021.01
%define srcext   tar.gz

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

%if 0%{?suse_version} < 1500
%define cxx11abi -D_GLIBCXX_USE_CXX11_ABI=0
%endif

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Productivity/Graphics/CAD
URL:           http://www.openscad.org/
Summary:       The Programmers Solid 3D CAD Modeller

# Build-time parameters
BuildRequires: cmake >= 3.3
BuildRequires: pkg-config
BuildRequires: gcc-c++
BuildRequires: bison flex
#BuildRequires: Mesa-devel
BuildRequires: libglvnd-devel libglvnd-compat-devel
BuildRequires: pkgconfig(glew)
BuildRequires: opencsg-devel
BuildRequires: cgal-devel
BuildRequires: eigen3-devel
BuildRequires: boost-devel >= 1.48
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(harfbuzz) >= 0.9.0
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(glib-2.0) >= 2.26
BuildRequires: pkgconfig(libzip)
BuildRequires: freetype2-devel >= 2.4.9
BuildRequires: pkgconfig(libxml-2.0) >= 2.9
BuildRequires: pkgconfig(Qt5Core)   pkgconfig(Qt5Widgets)    pkgconfig(Qt5Multimedia)
BuildRequires: pkgconfig(Qt5OpenGL) pkgconfig(Qt5Concurrent) pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: double-conversion-devel
%if 0%{?suse_version}
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(Qt5Gamepad)
BuildRequires: libqscintilla-qt5-devel
%else
BuildRequires: qscintilla-devel
BuildRequires: gmp-devel mpfr-devel
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://files.openscad.org/%{realname}-%{realver}%{?extraver}.src.%{srcext}

%description
OpenSCAD is a software for creating solid 3D CAD objects. It is free software
and available for Linux/UNIX, MS Windows and Mac OS X.

Unlike most free software for creating 3D models (such as the famous application
Blender), OpenSCAD focuses on the CAD aspects rather than the artistic aspects
of 3D modeling. Thus this might be the application you are looking for when you
are planning to create 3D models of machine parts but probably not the tool for
creating computer-animated movies.

OpenSCAD is not an interactive modeler. Instead it is more like a 3D-compiler
that reads a script file that describes the object and renders the 3D model from
this script file (see examples below). This gives you, the designer, complete
control over the modeling process and enables you to easily change any step
in the modeling process or make designs that are defined by
configurable parameters.

OpenSCAD provides two main modeling techniques: First there is constructive
solid geometry (aka CSG) and second there is extrusion of 2D outlines. As the
data exchange format for these 2D outlines Autocad DXF files are used.
In addition to 2D paths for extrusion it is also possible to read design
parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D
models in the STL and OFF file formats.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}

%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%{_libdir}/qt5/bin/qmake \
 PREFIX=%{_prefix} \
 LOCALE_PREFIX=%{_datadir}/locale \
 QMAKE_CFLAGS="$_CFLAGS" \
 QMAKE_CXXFLAGS="$_CFLAGS %{?cxx11abi}" \
 QMAKE_LFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}

%install
%{__make} install INSTALL_ROOT=%{buildroot}
%find_lang %{name}
%if 0%{?suse_version}
%suse_update_desktop_file -G 'Solid 3D CAD Modeller' %{name}
%endif

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING README.md RELEASE_NOTES.md
%doc doc/*.pdf doc/*.txt doc/hacking.md
%doc %{_mandir}/man1/openscad.1*
%{_bindir}/openscad
%{_datadir}/openscad/
%dir %{_datadir}/metainfo
%dir %{_datadir}/mime/packages
%dir %{_datadir}/mime
%{_datadir}/applications/openscad.desktop
%{_datadir}/icons/hicolor/*/apps/openscad.png
%{_datadir}/metainfo/org.openscad.OpenSCAD.appdata.xml
%{_datadir}/mime/packages/openscad.xml

%post
%{_bindir}/update-desktop-database --quiet "%{_datadir}/applications" || :
%{_bindir}/update-mime-database -n "%{_datadir}/mime" || :

%postun
%{_bindir}/update-desktop-database --quiet "%{_datadir}/applications" || :
%{_bindir}/update-mime-database -n "%{_datadir}/mime" || :

%changelog
openSUSE Build Service is sponsored by