File librepcb.spec of Package librepcb

#
# spec file for package librepcb
#
# Copyright (c) 2020-2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#

%if 0%{?sle_version} >= 1506000
%define gcc_ver 13
%else
%define gcc_ver 12
%endif

Name:           librepcb
Version:        1.2.0
Release:        0
Summary:        Electronic design automation (EDA) software package
License:        GPL-3.0-or-later AND CC-BY-4.0 AND CC-BY-SA-4.0
URL:            https://librepcb.org/
Source:         https://download.librepcb.org/releases/%{version}/librepcb-%{version}-source.zip
BuildRequires:  cmake
BuildRequires:  fdupes
%if 0%{?suse_version} >= 1600
BuildRequires:  gcc-c++
%else
BuildRequires:  gcc%{gcc_ver}-c++
%endif
BuildRequires:  hicolor-icon-theme
#BuildRequires:  fontobene-qt5-devel
BuildRequires:  unzip
BuildRequires:  update-desktop-files
BuildRequires:  fontconfig-devel
BuildRequires:  freetype2-devel
BuildRequires:  glu-devel
BuildRequires:  libpolyclipping-devel
BuildRequires:  occt-devel
BuildRequires:  quazip-qt6-devel
BuildRequires:  qt6-concurrent-devel
BuildRequires:  qt6-linguist-devel
BuildRequires:  qt6-network-devel
BuildRequires:  qt6-openglwidgets-devel
BuildRequires:  qt6-printsupport-devel
BuildRequires:  qt6-quick-devel
BuildRequires:  qt6-quickcontrols2-devel
BuildRequires:  qt6-sql-devel
BuildRequires:  qt6-svg-devel
BuildRequires:  qt6-test-devel
BuildRequires:  qt6-widgets-devel
BuildRequires:  qt6-xml-devel
BuildRequires:  zlib-devel
Requires:       noto-sans-fonts
Requires:       noto-sans-mono-fonts
Obsoletes:      %{name}-libs <= 0.1.5

%description
LibrePCB is a free software to design printed circuit boards
Core

%lang_package

%prep
%setup -q

%build
%cmake \
%if 0%{?suse_version} < 1600
    -DCMAKE_CXX_COMPILER=/usr/bin/g++-%{gcc_ver} \
%endif
    -DUNBUNDLE_POLYCLIPPING=1 \
    -DUNBUNDLE_QUAZIP=1
#    -DUNBUNDLE_FONTOBENE_QT5=1
%cmake_build

%install
%cmake_install
%find_lang %{name} --with-qt
%suse_update_desktop_file -r org.librepcb.LibrePCB "Education Engineering"
# we use system Noto fonts
rm -rf %{buildroot}%{_datadir}/librepcb/fonts
# remove duplicates
rm -rf %{buildroot}%{_datadir}/librepcb/licenses
# remove .so files
rm -f %{buildroot}%{_libdir}/liblibrepcb*.so
# unneeded
rm -f %{buildroot}%{_datadir}/%{name}/fontobene/README.md
# maybe create a patch for this
rm -rf %{buildroot}%{_includedir}/fontobene-qt5
%fdupes %{buildroot}%{_datadir}

%files
### something is missing here, check libs
%license LICENSE.txt
%license share/librepcb/licenses/cc-by-4.0.txt share/librepcb/licenses/cc-by-sa-4.0.txt
%doc README.md
%{_bindir}/librepcb
%{_bindir}/librepcb-cli
%{_datadir}/applications/org.librepcb.LibrePCB.desktop
%{_datadir}/icons/hicolor/*/apps/org.librepcb.LibrePCB.png
%{_datadir}/icons/hicolor/scalable/apps/org.librepcb.LibrePCB.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/org.librepcb.LibrePCB-file.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/org.librepcb.LibrePCB-project.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/org.librepcb.LibrePCB-archive.svg
%dir %{_datadir}/librepcb
%dir %{_datadir}/librepcb/fontobene
%dir %{_datadir}/librepcb/library
%dir %{_datadir}/librepcb/opengl
%dir %{_datadir}/librepcb/project
%dir %{_datadir}/librepcb/qml
%{_datadir}/librepcb/README.md
%{_datadir}/librepcb/fontobene/newstroke.bene
%{_datadir}/librepcb/library/default_image.png
%{_datadir}/librepcb/library/gitattributes_template
%{_datadir}/librepcb/library/gitignore_template
%{_datadir}/librepcb/library/readme_template
%{_datadir}/librepcb/opengl/*.glsl
%{_datadir}/librepcb/project/gitattributes_template
%{_datadir}/librepcb/project/gitignore_template
%{_datadir}/librepcb/project/readme_template
%{_datadir}/librepcb/qml/testwindow.qml
%{_datadir}/metainfo/org.librepcb.LibrePCB.metainfo.xml
%{_datadir}/mime/packages/org.librepcb.LibrePCB.xml

%files lang -f %{name}.lang
%dir %{_datadir}/librepcb/i18n
%{_datadir}/librepcb/i18n/librepcb*.qm

%changelog
openSUSE Build Service is sponsored by