# TODO:
# - fix mimelnk installation
#
+# Conditional build:
+%bcond_without packages3D #do not build packages3D
+
Summary: KiCad - is a GPL'd suite of programs for EDA
Summary(pl.UTF-8): KiCad - zestaw programów na licencji GPL zaliczany do kategorii EDA
Name: kicad
-Version: 5.1.0
+Version: 5.1.8
Release: 1
Epoch: 1
License: GPL v2+
Group: X11/Applications
-Source0: https://launchpad.net/kicad/5.0/%{version}/+download/%{name}-%{version}.tar.xz
-# Source0-md5: 735cb4d87d3819bf309495746eb13792
-Source1: https://github.com/KiCad/kicad-doc/archive/%{version}/%{name}-doc-%{version}.tar.gz
-# Source1-md5: 47142ec31256c1dea25bcd6f4dcd7071
-Source2: https://github.com/KiCad/kicad-i18n/archive/%{version}/%{name}-i18n-%{version}.tar.gz
-# Source2-md5: c1e8fdd7bf4d1377f7ee0968fb5ab1d6
-Source3: https://github.com/KiCad/kicad-symbols/archive/%{version}/%{name}-symbols-%{version}.tar.gz
-# Source3-md5: f78847a49329c9d8bfd4f5aac7dc36b1
-Source4: https://github.com/KiCad/kicad-footprints/archive/%{version}/%{name}-footprints-%{version}.tar.gz
-# Source4-md5: cbdc858a0657878df24cec5eb0ab64a0
-Source5: https://github.com/KiCad/kicad-packages3D/archive/%{version}/%{name}-packages3D-%{version}.tar.gz
-# Source5-md5: dde395e19f69881930a8820a922f239a
-Source6: https://github.com/KiCad/kicad-templates/archive/%{version}/%{name}-templates-%{version}.tar.gz
-# Source6-md5: 451fc7de145ff122f1de08dfcef368d6
+Source0: https://gitlab.com/kicad/code/kicad/-/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: c573140e521e29441d71f1a39b79752f
+Source1: https://gitlab.com/kicad/services/kicad-doc/-/archive/%{version}/%{name}-doc-%{version}.tar.gz
+# Source1-md5: 32fcae80e827453f6a71bba837fdfd0f
+Source2: https://gitlab.com/kicad/code/kicad-i18n/-/archive/%{version}/%{name}-i18n-%{version}.tar.gz
+# Source2-md5: 792388e3a74410786085314d4069d408
+Source3: https://gitlab.com/kicad/libraries/kicad-symbols/-/archive/%{version}/%{name}-symbols-%{version}.tar.bz2
+# Source3-md5: 35065c2ccd6f08a38a5557caf3ce26e2
+Source4: https://gitlab.com/kicad/libraries/kicad-footprints/-/archive/%{version}/%{name}-footprints-%{version}.tar.bz2
+# Source4-md5: 7e6b08b971adba172fff71f3b50f3bdb
+Source5: https://gitlab.com/kicad/libraries/kicad-packages3D/-/archive/%{version}/%{name}-packages3D-%{version}.tar.bz2
+# Source5-md5: c67bde6af35417e665ade4696d8adb16
+Source6: https://gitlab.com/kicad/libraries/kicad-templates/-/archive/%{version}/%{name}-templates-%{version}.tar.bz2
+# Source6-md5: 24ae4642eeb0a3c08448d4aa878a5163
Patch0: nostrip.patch
-Patch1: lto.patch
+Patch1: gerbview.patch
URL: http://www.kicad-pcb.org/
BuildRequires: GLM >= 0.9.9.4
BuildRequires: OCE-devel
BuildRequires: wxWidgets-devel >= 3.0.0
BuildRequires: zlib-devel
Obsoletes: kicad-doc-hu < 1:4.0.6-1
+Obsoletes: kicad-doc-nl < 1:5.1.0-1
Obsoletes: kicad-doc-pt < 1:4.0.6-1
Obsoletes: kicad-doc-zh_CN < 1:4.0.6-1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Documentation and tutorials for Kicad in Chinese.
%prep
-%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6
-%patch0 -p1
+%setup -q -a 1 -a 2 -a 3 -a 4 %{?with_packages3D:-a 5} -a 6
%patch1 -p1
+%patch0 -p1
%build
build_library %{name}-symbols-%{version}
build_library %{name}-footprints-%{version}
build_library %{name}-templates-%{version}
+%if %{with packages3D}
build_library %{name}-packages3D-%{version}
+%endif
# Documentation
mkdir %{name}-doc-%{version}/build
install_library %{name}-symbols-%{version}
install_library %{name}-footprints-%{version}
install_library %{name}-templates-%{version}
+%if %{with packages3D}
install_library %{name}-packages3D-%{version}
+%else
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/modules/packages3d
+%endif
# Documentation
%{__make} -C %{name}-doc-%{version}/build install \
%attr(755,root,root) %{_bindir}/idfcyl
%attr(755,root,root) %{_bindir}/idfrect
%attr(755,root,root) %{_bindir}/kicad
-%attr(755,root,root) %{_bindir}/kicad-ogltest
%attr(755,root,root) %{_bindir}/kicad2step
%attr(755,root,root) %{_bindir}/pcb_calculator
%attr(755,root,root) %{_bindir}/_pcb_calculator.kiface
%{_datadir}/%{name}/modules/*.pretty
%{_datadir}/%{name}/template/*
+%if %{with packages3D}
%files packages3D
%defattr(644,root,root,755)
%{_datadir}/%{name}/modules/packages3d/*
+%endif
%files doc
%defattr(644,root,root,755)