# 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.0.0
-Release: 2
+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: 99a39910a3f7d8320b605bb9a9ff3af8
-Source1: https://github.com/KiCad/kicad-doc/archive/%{version}/%{name}-doc-%{version}.tar.gz
-# Source1-md5: 0d6e78e1087a04c8e6385f76c0727bf7
-Source2: https://github.com/KiCad/kicad-i18n/archive/%{version}/%{name}-i18n-%{version}.tar.gz
-# Source2-md5: 1e1503b89c575c80ff51583d40667c14
-Source3: https://github.com/KiCad/kicad-symbols/archive/%{version}/%{name}-symbols-%{version}.tar.gz
-# Source3-md5: 03cb33312062571118a277bafd01c06d
-Source4: https://github.com/KiCad/kicad-footprints/archive/%{version}/%{name}-footprints-%{version}.tar.gz
-# Source4-md5: e8ce40c47b108280d7878f858899ab10
-Source5: https://github.com/KiCad/kicad-packages3D/archive/%{version}/%{name}-packages3D-%{version}.tar.gz
-# Source5-md5: aac66499bbbd9f21ad3e90af7ba854d2
-Source6: https://github.com/KiCad/kicad-templates/archive/%{version}/%{name}-templates-%{version}.tar.gz
-# Source6-md5: d8a5c09a33588a73eb8552c83bdb0381
+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
-# https://code.launchpad.net/~lkundrak/kicad/appstream-data/+merge/293391
-Patch1: lto.patch
-Patch2: python.patch
-Patch3: 3d_plugindir.patch
+Patch1: gerbview.patch
URL: http://www.kicad-pcb.org/
-BuildRequires: GLM
+BuildRequires: GLM >= 0.9.9.4
BuildRequires: OCE-devel
BuildRequires: appstream-glib
BuildRequires: asciidoc
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)
%description doc-ja
Documentation and tutorials for Kicad in Japanese.
-%package doc-nl
-Summary: Documentation for Kicad in Dutch
-Group: Documentation
-Requires: %{name}-doc = %{epoch}:%{version}-%{release}
-%if "%{_rpmversion}" >= "5"
-BuildArch: noarch
-%endif
-
-%description doc-nl
-Documentation and tutorials for Kicad in Dutch.
-
%package doc-pl
Summary: Documentation for Kicad in Polish
Summary(fr.UTF-8): Documentations pour kicad en polonais
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
-%patch2 -p1
-%patch3 -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)
%defattr(644,root,root,755)
%lang(ja) %{_docdir}/%{name}/help/ja
-%files doc-nl
-%defattr(644,root,root,755)
-%lang(nl) %{_docdir}/%{name}/help/nl
-
%files doc-pl
%defattr(644,root,root,755)
%lang(pl) %{_docdir}/%{name}/help/pl