File librepcb.spec of Package librepcb

#
# spec file for package librepcb
#
# Copyright (c) 2021 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/
#

Name:           librepcb
Version:        0.1.6
Release:        0
Summary:        Electronic design automation (EDA) software package
# hoedown is conditional on qt version, also other libraries vendored only on 15.2: see to it
License:        GPL-3.0-or-later AND CC0-1.0 AND CC-BY-4.0 AND CC-BY-SA-4.0 AND ISC AND MIT
URL:            https://librepcb.org/
Source:         %{name}-%{version}.tar.xz
#
###Patch0: dxflib.patch
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
%if 0%{?sle_version} == 150200
BuildRequires:  update-desktop-files
%endif
%if (0%{?suse_version} > 1500)
BuildRequires:  pkgconfig(polyclipping)
%endif
BuildRequires:  dxflib-devel
%if (0%{?suse_version} > 1500 || 0%{?sle_version} == 150300)
BuildRequires:  pkgconfig(fontobene-qt5)
BuildRequires:  pkgconfig(quazip1-qt5)
%endif
%if (0%{?sle_version} == 150200 && 0%{?is_opensuse})
BuildRequires:  pkgconfig(quazip)
%endif
BuildRequires:  pkgconfig
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(muparser)
BuildRequires:  pkgconfig(zlib)
Requires:       noto-sans-fonts
Requires:       noto-sans-mono-fonts

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

%lang_package

%prep
%autosetup -p1

%build
%cmake \
        -DBUILD_TESTS=OFF \
%if 0%{?suse_version} > 1500
        -DUNBUNDLE_POLYCLIPPING=ON \
%endif
%if (0%{?suse_version} > 1500 || 0%{?sle_version} == 150300)
        -DUNBUNDLE_FONTOBENE_QT5=ON \
        -DUNBUNDLE_QUAZIP=ON \
%endif
        -DUNBUNDLE_DXFLIB=ON \
        -DUNBUNDLE_MUPARSER=ON
%cmake_build

%install
%cmake_install
%find_lang %{name} --with-qt
%if 0%{?sle_version} == 150200
%suse_update_desktop_file -r org.librepcb.LibrePCB "Education Engineering"
%endif
# we use system Noto fonts
rm -rf %{buildroot}%{_datadir}/librepcb/fonts
# remove duplicates
rm -rf %{buildroot}%{_datadir}/librepcb/licenses
%fdupes %{buildroot}%{_datadir}

%files
%license LICENSE.txt libs/hoedown/LICENSE libs/type_safe/LICENSE
%license share/librepcb/licenses/cc-by-4.0.txt share/librepcb/licenses/cc-by-sa-4.0.txt
%license share/librepcb/licenses/cc0-1.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
%dir %{_datadir}/librepcb
%dir %{_datadir}/librepcb/library
%dir %{_datadir}/librepcb/project
%{_datadir}/librepcb/fontobene
%{_datadir}/librepcb/library/default_image.png
%{_datadir}/librepcb/library/gitattributes_template
%{_datadir}/librepcb/library/gitignore_template
%{_datadir}/librepcb/library/readme_template
%{_datadir}/librepcb/project/gitattributes_template
%{_datadir}/librepcb/project/gitignore_template
%{_datadir}/librepcb/project/readme_template
%if 0%{suse_version} == 1315
%dir %{_datadir}/metainfo
%endif
%{_datadir}/metainfo/org.librepcb.LibrePCB.appdata.xml
%{_datadir}/mime/packages/org.librepcb.LibrePCB.xml

%files lang -f %{name}.lang
%dir %{_datadir}/librepcb/i18n
openSUSE Build Service is sponsored by