File fritzing.spec of Package fritzing
#
# spec file for package fritzing
#
# Copyright (c) 2024 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/
#
# Fritzing does not provide tags: gh#fritzing/fritzing-app#4086
# pick these commits manually for every update
%define app_commit b9add9eaa7c426963de20c8514a69d3f15e83bdf
%define parts_commit 4f7d39b22a6c307e6cca62c7f78eae96696e8b2c
Name: fritzing
Version: 1.0.5
Release: 0
Summary: Electronic Design Automation platform featuring prototype to product
License: GPL-3.0-or-later
Group: Productivity/Scientific/Electronics
URL: https://fritzing.org/
# SourceRepository0: https://github.com/fritzing/fritzing-app
# No branch, just the last commit before the release
Source0: https://github.com/fritzing/fritzing-app/archive/%{app_commit}/fritzing-app-%{app_commit}.tar.gz#/fritzing-app-%{version}-%{app_commit}.tar.gz
# SourceRepository1: https://github.com/fritzing/fritzing-parts
# Branch "1.0.5" not merged into "devlop"!
Source1: https://github.com/fritzing/fritzing-parts/archive/%{parts_commit}/fritzing-parts-%{parts_commit}.tar.gz#/fritzing-parts-%{version}-%{parts_commit}.tar.gz
# PATCH-FIX-FEDORA 0000-disable-autoupdate.patch -- https://src.fedoraproject.org/rpms/fritzing/blob/rawhide/f/0000-disable-autoupdate.patch
Patch0: 0000-disable-autoupdate.patch
# PATCH-FIX-OPENSUSE 0001-openSUSE-Relax-Qt6-clamps.patch -- allow other Qt6 than upstream
Patch1: 0001-openSUSE-Relax-Qt6-clamps.patch
# PATCH-FIX-OPENSUSE 0002-Fix-appdata.xml-url-type.patch -- fix appdata url type
Patch2: 0002-Fix-appdata.xml-url-type.patch
# PATCH-FIX-FEDORA 0003-Remove-TwitterSaurus-examples.patch -- remove incompatible twitter4j examples
Patch3: https://src.fedoraproject.org/rpms/fritzing/raw/rawhide/f/0002-remove-twitter4j.patch#/0003-Remove-TwitterSaurus-examples.patch
# PATCH-FIX-FEDORA 0004-Work-around-build-issues-with-Qt-6.9.patch -- work around build issues with Qt 6.9
Patch4: https://src.fedoraproject.org/rpms/fritzing/raw/rawhide/f/0004-Work-around-build-issues-with-Qt-6.9.patch
BuildRequires: appstream-glib
BuildRequires: fdupes
BuildRequires: libboost_headers-devel
BuildRequires: libgit2-devel >= 0.23
BuildRequires: libngspice-devel
BuildRequires: pkgconfig
BuildRequires: qt6-concurrent-devel
BuildRequires: qt6-network-devel
BuildRequires: qt6-openglwidgets-devel
BuildRequires: qt6-printsupport-devel
BuildRequires: qt6-serialport-devel
BuildRequires: qt6-sql-devel
BuildRequires: qt6-svg-devel
BuildRequires: qt6-tools-devel
BuildRequires: qt6-xml-devel
BuildRequires: svgpp-devel
BuildRequires: zlib-devel
BuildRequires: pkgconfig(polyclipping)
BuildRequires: pkgconfig(quazip1-qt6)
Requires: fritzing-parts >= %{version}
Requires(post): desktop-file-utils
Requires(post): shared-mime-info
Requires(postun): desktop-file-utils
Requires(postun): shared-mime-info
%description
Fritzing is an initiative to support designers, artists,
researchers and hobbyists to take the step from physical prototyping
to an actual product. It is in the spirit of Processing and Arduino which
allow users to document their Arduino and other electronic-based
prototypes, and to create a PCB layout for manufacturing.
%package parts
Summary: Electronic components for use in the Fritzing app (aka the parts library)
License: CC-BY-SA-3.0
BuildArch: noarch
%description parts
This packages contains the parts definitions for the electronic
components used in the Fritzing app.
%prep
%autosetup -p1 -n fritzing-app-%{app_commit} -a1
mv fritzing-parts-%{parts_commit} parts
# remove upstream bundling detections and hardware optimization
sed -e /include.*clipper1detect.pri/d \
-e /include.*libgit2detect.pri/d \
-e /include.*quazipdetect.pri/d \
-e /include.*spicedetect.pri/d \
-e /include.*svgppdetect.pri/d \
-e /QMAKE_CXXFLAGS/d \
-i phoenix.pro
rm pri/clipper1detect.pri \
pri/libgit2detect.pri \
pri/quazipdetect.pri \
pri/spicedetect.pri \
pri/svgppdetect.pri
rm -r .github parts/.github parts/.gitignore
find parts -name placeholder.txt -delete
sed -i '1{/^#!/d}' parts/scripts/batch_obsolete_modified.py
sed -i 's/\r$//' LICENSE.CC-BY-SA
chmod -x LICENSE* README.md Fritzing.1
# Remove TwitterSaurus examples which use a bundled twitter4j library,
# the license of which is incompatible wit OSS (See also Patch3).
rm -f sketches/core/Fritzing\ Creator\ Kit\ DE+EN/creator-kit-*/Fritzing/TwitterSaurus.fzz
rm -r sketches/core/Fritzing\ Creator\ Kit\ DE+EN/creator-kit-*/Processing/TwitterSaurus*
rm -f sketches/core/obsolete/TwitterSaurus.fzz
%build
%{qmake6} \
PKGCONFIG+=quazip1-qt6 \
PKGCONFIG+=polyclipping \
PKGCONFIG+=libgit2 \
phoenix.pro
%{qmake6_build}
# Generate the parts database
./Fritzing -platform minimal -f ./parts -db ./parts/parts.db
%install
%{qmake6_install}
find %{buildroot}%{_datadir}/fritzing/ -type f -exec chmod -x {} \;
appstream-util validate-relax --nonet org.fritzing.Fritzing.appdata.xml
# make deduplication of docs and licenses possible
mkdir -p %{buildroot}%{_docdir}/fritzing-parts/
mkdir -p %{buildroot}%{_licensedir}/fritzing-parts/
cp parts/README.md %{buildroot}%{_docdir}/fritzing-parts/
cp parts/LICENSE.txt %{buildroot}%{_licensedir}/fritzing-parts/
%fdupes %{buildroot}%{_datadir}
%files
%license LICENSE.GPL2 LICENSE.GPL3 LICENSE.CC-BY-SA
%doc README.md
%{_bindir}/Fritzing
%{_datadir}/pixmaps/fritzing.png
%{_datadir}/applications/org.fritzing.Fritzing.desktop
%{_mandir}/man1/Fritzing.*
%{_datadir}/mime/packages/*.xml
%{_datadir}/metainfo/org.fritzing.Fritzing.appdata.xml
%files parts
%license %{_licensedir}/fritzing-parts
%license LICENSE.CC-BY-SA
%doc %{_docdir}/fritzing-parts
%{_datadir}/fritzing
%changelog