File openscad-nightly.spec of Package OpenSCAD

Name:		openscad-nightly
Version:	0
Release:	0
Summary:	The Programmers Solid 3D CAD Modeller
License:	GPL-2.0+
Source:		https://github.com/openscad/openscad/archive/HEAD/openscad-%{version}.tar.gz
BuildRequires:	curl
BuildRequires:	make
BuildRequires:	ccache
BuildRequires:	gcc-c++
BuildRequires:	flex
BuildRequires:	bison
BuildRequires:	pkgconfig
BuildRequires:	gettext
BuildRequires:	glew-devel
BuildRequires:	boost-devel
BuildRequires:	opencsg-devel
BuildRequires:	libxml2-devel
BuildRequires:	fontconfig-devel
BuildRequires:	freetype-devel
BuildRequires:	harfbuzz-devel
BuildRequires:	double-conversion-devel
%if 0%{?suse_version}
BuildRequires:	libeigen3-devel
BuildRequires:	libcgal-devel
BuildRequires:	libqt5-qtbase-devel
BuildRequires:  libqt5-qtmultimedia-devel
BuildRequires:	libQt5OpenGL-devel
BuildRequires:	libqscintilla-qt5-devel
BuildRequires:	Mesa-devel
BuildRequires:	update-desktop-files
%endif
%if 0%{?suse_version} >= 1500
BuildRequires:	libboost_filesystem-devel
BuildRequires:	libboost_system-devel
BuildRequires:	libboost_regex-devel
BuildRequires:	libboost_thread-devel
BuildRequires:	libboost_program_options-devel
%endif
%if 0%{?fedora_version}
BuildRequires:	glib2-devel
BuildRequires:	eigen3-devel
BuildRequires:	CGAL-devel
BuildRequires:	qt5-qtbase-devel
BuildRequires:	qt5-qtmultimedia-devel
BuildRequires:	qscintilla-qt5-devel
BuildRequires:	mesa-libGL-devel
BuildRequires:	mesa-libGLU-devel
BuildRequires:	mpfr-devel
BuildRequires:	gmp-devel
BuildRequires:	libXmu-devel
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%global debug_package %{nil}

%description
OpenSCAD is a software for creating solid 3D CAD models. It is
free software and available for Linux/UNIX, Windows and Mac OS X.
Unlike most free software for creating 3D models (such as Blender)
it does not focus on the artistic aspects of 3D modelling but
instead on the CAD aspects. Thus it might be the application you
are looking for when you are planning to create 3D models of machine
parts but pretty sure is not what you are looking for when you are
more interested in creating computer-animated movies.

%prep
%setup -c -T
gzip -dc /home/abuild/rpmbuild/SOURCES/openscad-%{version}.tar.gz | tar -x --strip-components=1 -f -
if [ $? -ne 0 ]; then
  exit $?
fi

%build
OPENSCAD_VERSION=`echo "%{version}" | sed -e 's/^\(....\)\(..\)\(..\).*/\1.\2.\3.nightly/'`
OPENSCAD_COMMIT=`echo "%{version}" | cut -b 20-26`
%if 0%{?suse_version}
qmake-qt5 openscad.pro CONFIG+=experimental CONFIG-=debug PREFIX=%{_prefix} QMAKE_CXXFLAGS="%{optflags}" SUFFIX=-nightly VERSION="$OPENSCAD_VERSION" OPENSCAD_COMMIT="$OPENSCAD_COMMIT"
%endif
%if 0%{?fedora_version}
qmake-qt5 openscad.pro CONFIG+=experimental CONFIG-=debug PREFIX=%{_prefix} SUFFIX=-nightly VERSION="$OPENSCAD_VERSION" OPENSCAD_COMMIT="$OPENSCAD_COMMIT"
%endif
make

%install
make INSTALL_ROOT=%{buildroot} install
%if 0%{?suse_version}
%suse_update_desktop_file openscad-nightly Graphics 3DGraphics
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc COPYING README.md RELEASE_NOTES.md doc/*.pdf
%{_bindir}/openscad-nightly
%{_datadir}/openscad-nightly/
%{_datadir}/applications/openscad-nightly.desktop
%{_datadir}/pixmaps/openscad-nightly.png
%{_datadir}/mime/packages/openscad-nightly.xml
%{_mandir}/man1/*
%dir %{_datadir}/metainfo
%{_datadir}/metainfo/org.openscad.OpenSCAD-nightly.appdata.xml

%changelog