kicad/kicad.spec

206 lines
7.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package kicad
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: kicad
Version: 5.0.0
Release: 0
Summary: EDA software suite for the creation of schematics and PCB
License: GPL-2.0-or-later AND GPL-3.0-or-later
Group: Productivity/Scientific/Electronics
Url: http://kicad-pcb.org
Source: https://launchpad.net/kicad/5.0/%{version}/+download/kicad-%{version}.tar.xz
# License file was removed due to GPL-3.0+ code
# https://github.com/KiCad/kicad-source-mirror/commit/681090b8ef3a362af75e8ca4417e18622747b63b
Source2: COPYRIGHT.txt
# PATCH-FEATURE-OPENSUSE kicad-user-library.patch -- add user library path
Patch1: kicad-user-library.patch
# PATCH-FEATURE-OPENSUSE kicad-library-repos-install.patch
Patch2: kicad-library-repos-install.patch
# PATCH-FIX-OPENSUSE davejplater@gmail.com -kicad-suse-help-path.patch - kicad looks in /usr/share/doc/kicad for help files and doesn't find them.
# this patch adds packges/ befor kicad.
Patch3: kicad-suse-help-path.patch
%if 0%{?suse_version} > 1325
BuildRequires: libboost_context-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_iostreams-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_test-devel
BuildRequires: libboost_thread-devel
%else
BuildRequires: boost-devel >= 1.56
%endif
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libcurl-devel
BuildRequires: libngspice-devel
BuildRequires: oce-devel
BuildRequires: pkg-config
BuildRequires: python-devel
BuildRequires: update-desktop-files
BuildRequires: cmake(glm)
# Use direct version to avoid problems with wx 3.2
BuildRequires: wxWidgets-3_0-devel >= 3
# Fix bug in old python-wxWidgets-3_0-devel
BuildRequires: python-wxWidgets-3_0 >= 3
BuildRequires: python-wxWidgets-3_0-devel >= 3
BuildRequires: swig
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
# Fix directory owner
BuildRequires: hicolor-icon-theme
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: python-wxWidgets-3_0 >= 3
# The help function doesn't work without the doc package
Requires: %{name}-doc = %{version}
Requires: %{name}-symbols = %{version}
Recommends: %{name}-library-install = %{version}
Recommends: %{name}-footprints = %{version}
Recommends: %{name}-packages3D
Obsoletes: kicad = 20140120
%description
Kicad is an open source (GPL) software for the creation of electronic schematic
diagrams and printed circuit with up to 32 copper layers and additional techinical layers.
KiCad includes a project manager and four main independent software tools:
- Eeschema: schematic editor.
- Pcbnew: printed circuit board editor.
- Gerbview: GERBER file viewer (photoplotter documents).
- Cvpcb: footprint selector for components association.
%package library-install
Summary: Script for KiCad libraries downloading
Group: Productivity/Scientific/Electronics
Requires: %{name} = %{version}
Requires: curl
Requires: git-core
Requires: sed
%description library-install
Kicad is an open source (GPL) software for the creation of electronic schematic
diagrams and printed circuit with up to 32 copper layers and additional techinical layers.
This package contains script for KiCad libraries downloading.
%prep
%setup -q -n kicad-%{version}
%patch1 -p0
%patch2 -p1
%patch3
cp %{SOURCE2} .
# Fix plugin directory
sed -i 's|KICAD_PLUGINS lib/kicad/plugins|KICAD_PLUGINS %{_lib}/kicad/plugins|' CMakeLists.txt
# Fix documentation directory
sed -i 's|KICAD_DOCS share/doc/kicad|KICAD_DOCS share/doc/packages/kicad|' CMakeLists.txt
# Fix python shebangs
for i in `grep -rl "/usr/bin/env python"`;do sed -i '1s/^#!.*/#!\/usr\/bin\/python2/' ${i} ;done
for i in `grep -rl "/usr/bin/env python2"`;do sed -i '1s/^#!.*/#!\/usr\/bin\/python2/' ${i} ;done
%build
Accepting request 520850 from home:plater - Update to version 4.0.7. - Build with fPIE. - Rebased kicad-set-cxx-version.patch. - Upstream changes: * Bugs Fixed: Fix broken links and add correct links to about dialog. Eeschema: highlight the first choice in rescue dialog. Eeschema: fix zone properties dialog level setting tooltip. Pcbnew: fix segfault when appending a board in GAL mode. Remove some useless or incorrect asserts in plot functions. Pcbnew: continue loading footprints after first failure. Eeschema: don’t apply last line width to text thickness in symbol library editor. Pcbnew: add option to plot DXF lines in outline mode. Pcbnew: add option to plot DXF editable text. Pcbnew: fix crash when dragging a track. Fix crash when dragging a track. Remove leading/trailing white space error message from field validator. * Other changes: Pcbnew: fix bug loading board files written when layers could have numeric names. Pcbnew: prevent segfault when outline has no vertices reading P-CAD file. Pcbnew: fix tooltip error in copper zones dialog. Eeschema: move BOM scripts so they are installed correctly. Apply changes from master to GOST page layouts. Save text thickness in worksheet editor. Fix default line widths for non-mm units in DXF import. Better error messages when throwing an I/O error or parse error. Cvpcb: fix incorrect assignments when using .equ files and automatic association. Fix possible crash and issues when a incorrect fp lib table is loaded. Fix crash when writing zip archive file to folder that is not writeable. Fix issues in plot functions when used from python scripts. OBS-URL: https://build.opensuse.org/request/show/520850 OBS-URL: https://build.opensuse.org/package/show/electronics/kicad?expand=0&rev=37
2017-09-04 18:36:59 +02:00
export CFLAGS="%{optflags} -fPIE"
export CXXFLAGS="$CFLAGS"
%cmake \
-DKICAD_REPO_NAME=stable \
-DKICAD_BUILD_VERSION=%{version} \
-DKICAD_SKIP_BOOST=ON \
-DBUILD_GITHUB_PLUGIN=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
Accepting request 520850 from home:plater - Update to version 4.0.7. - Build with fPIE. - Rebased kicad-set-cxx-version.patch. - Upstream changes: * Bugs Fixed: Fix broken links and add correct links to about dialog. Eeschema: highlight the first choice in rescue dialog. Eeschema: fix zone properties dialog level setting tooltip. Pcbnew: fix segfault when appending a board in GAL mode. Remove some useless or incorrect asserts in plot functions. Pcbnew: continue loading footprints after first failure. Eeschema: don’t apply last line width to text thickness in symbol library editor. Pcbnew: add option to plot DXF lines in outline mode. Pcbnew: add option to plot DXF editable text. Pcbnew: fix crash when dragging a track. Fix crash when dragging a track. Remove leading/trailing white space error message from field validator. * Other changes: Pcbnew: fix bug loading board files written when layers could have numeric names. Pcbnew: prevent segfault when outline has no vertices reading P-CAD file. Pcbnew: fix tooltip error in copper zones dialog. Eeschema: move BOM scripts so they are installed correctly. Apply changes from master to GOST page layouts. Save text thickness in worksheet editor. Fix default line widths for non-mm units in DXF import. Better error messages when throwing an I/O error or parse error. Cvpcb: fix incorrect assignments when using .equ files and automatic association. Fix possible crash and issues when a incorrect fp lib table is loaded. Fix crash when writing zip archive file to folder that is not writeable. Fix issues in plot functions when used from python scripts. OBS-URL: https://build.opensuse.org/request/show/520850 OBS-URL: https://build.opensuse.org/package/show/electronics/kicad?expand=0&rev=37
2017-09-04 18:36:59 +02:00
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -pie"
make %{?_smp_mflags}
%install
%cmake_install
find %{buildroot}%{_datadir}/kicad/scripting/plugins -name "*.py" -exec chmod 0644 "{}" "+"
#Change permissions back for executable scripts
chmod -f 0755 `find %{buildroot}%{_datadir}/kicad/scripting/plugins -name "*.py" -perm 0644 -print0|xargs -0r grep -l '#!/usr'`
# Move scripts under doc to kicad directory.
mv %{buildroot}%{_datadir}/doc/%{name}/scripts %{buildroot}%{_datadir}/%{name}
rm -rf %{buildroot}%{_datadir}/doc
chmod -f 0755 `find %{buildroot}%{_datadir}/kicad/scripts -name "*py" -perm 0644 -print0|xargs -0r grep -l '#!/usr'`
chmod -f 0755 `find %{buildroot}%{_datadir}/kicad/scripts -name "*sh" -perm 0644 -print0|xargs -0r grep -l '#!/bin'`
chmod 0644 %{buildroot}%{_datadir}/kicad/scripting/kicad_pyshell/__init__.py
%suse_update_desktop_file -r bitmap2component "Education;Engineering"
%suse_update_desktop_file -r eeschema "Education;Engineering"
%suse_update_desktop_file -r gerbview "Education;Engineering"
%suse_update_desktop_file -r kicad "Education;Engineering"
%suse_update_desktop_file -r pcbcalculator "Education;Engineering"
%suse_update_desktop_file -r pcbnew "Education;Engineering"
# Link to library libkicad_3dsg.so.2.0.0 has no use
rm -rf %{buildroot}%{_libdir}/libkicad_3dsg.so
install -D scripts/library-repos-install.sh %{buildroot}%{_bindir}/kicad-library-install.sh
%fdupes -s %{buildroot}%{_datadir}/kicad
%fdupes -s %{buildroot}%{_datadir}/icons/hicolor
%if 0%{?suse_version} < 1330
%post
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post
%mime_database_post
%postun
/sbin/ldconfig
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun
%else
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif
%files
%defattr(-,root,root)
%doc README.txt Documentation/changelogs
%license COPYRIGHT.txt
%{_bindir}/*
%exclude %{_bindir}/kicad-library-install.sh
%{_libdir}/kicad/
%{_datadir}/kicad/
%{python_sitelib}/*
%{_datadir}/appdata/kicad.appdata.xml
%{_datadir}/applications/*.desktop
%{_datadir}/mime/packages/%{name}-*.xml
%{_datadir}/icons/hicolor/*/mimetypes/application-x-*
%{_datadir}/icons/hicolor/*/apps/*.*
%{_libdir}/libkicad_3dsg.so.2.0.0
%files library-install
%defattr(-,root,root)
%{_bindir}/kicad-library-install.sh
%changelog