File solvespace.spec of Package solvespace

#
# spec file for package solvespace
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define soname 1
Name:           solvespace
Version:        3.0+git20210418.0e0b025
Release:        0
Summary:        Parametric 3d CAD
License:        GPL-3.0+
Group:          Productivity/Graphics/CAD
Url:            http://solvespace.com/
Source0:        https://github.com/solvespace/solvespace/archive/%{name}-%{version}.tar.gz
BuildRequires:  cmake >= 3.1.0
BuildRequires:  gcc-c++
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  perl(GD::Image)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(gtkmm-2.4)
BuildRequires:  pkgconfig(json-c)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(pangomm-1.4)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  gtkmm3-devel
BuildRequires:  libspnav-devel

%description
Applications include:
  * modeling 3d parts
  * modeling 2d parts
  * 3d-printed parts
  * preparing CAM data
  * mechanism design
  * plane and solid geometry

%package -n     libslvs%{soname}
Summary:        Geometric kernel of %{name}
Group:          System/Libraries

%description -n libslvs%{soname}
Parametric 2d/3d CAD.

Contains the geometric kernel of %{name}, built as a library.

%prep
%setup -q 

sed -i '/GetGitCommitHash/d' $(grep -rl GetGitCommitHash)

# Do not compile in DATE and TIME
BUILDTIME=$(LC_ALL=C date -ur %{_sourcedir}/%{name}.changes +'%H:%M')
BUILDDATE=$(LC_ALL=C date -ur %{_sourcedir}/%{name}.changes +'%b %d %Y')
sed -e "s/__DATE__/\"$BUILDDATE\"/" \
    -e "s/__TIME__/\"$BUILDTIME\"/" \
    -i $(grep -rl '__DATE__\|__TIME__') || :

%build
%cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev

make %{?_smp_mflags}

%install
%cmake_install

%suse_update_desktop_file -r %{name} Graphics 3DGraphics Engineering

# Used fork of libdxfrw
find %{buildroot} \( -name \*.so -o -name \*.h \) -exec rm -rf {} \;

%fdupes -s %{buildroot}%{_datadir}

%post
%icon_theme_cache_post
%desktop_database_post

%postun
%icon_theme_cache_postun
%desktop_database_postun

%post -n libslvs%{soname} -p /sbin/ldconfig

%postun -n libslvs%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING* CHANGELOG.md
%{_bindir}/%{name}
%{_bindir}/%{name}-cli
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/*/apps/*%{name}.*
%{_datadir}/icons/hicolor/*/mimetypes/*%{name}.*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/com.solvespace.SolveSpace.metainfo.xml
%{_datadir}/mime/packages/%{name}-slvs.xml

%files -n libslvs%{soname}
%defattr(-,root,root)
%{_libdir}/libslvs.so.*

%changelog
openSUSE Build Service is sponsored by