1 |
# limit parallel builds on aarch64 |
2 |
%ifarch aarch64 |
3 |
%global _smp_ncpus_max 4 |
4 |
%endif |
5 |
|
6 |
%define Werror_cflags %nil |
7 |
|
8 |
%define docname kicad-doc |
9 |
%define symname kicad-symbols |
10 |
%define p3dname kicad-packages3D |
11 |
%define templname kicad-templates |
12 |
%define fpname kicad-footprints |
13 |
%define i18nname kicad-i18n |
14 |
|
15 |
%define branch 5.0 |
16 |
|
17 |
|
18 |
Name: kicad |
19 |
Summary: An open source program for the creation of electronic schematic diagrams |
20 |
Epoch: 1 |
21 |
Version: 5.1.4 |
22 |
Release: %mkrel 2 |
23 |
License: GPLv3+ |
24 |
Group: Sciences/Computer science |
25 |
Url: http://kicad-pcb.org/ |
26 |
Source0: https://launchpad.net/%{name}/%{branch}/%{version}/+download/%{name}-%{version}.tar.xz |
27 |
Source1: https://github.com/KiCad/%{docname}/archive/%{version}/%{docname}-%{version}.tar.gz |
28 |
Source2: https://github.com/KiCad/%{symname}/archive/%{version}/%{symname}-%{version}.tar.gz |
29 |
Source3: https://github.com/KiCad/%{p3dname}/archive/%{version}/%{p3dname}-%{version}.tar.gz |
30 |
Source4: https://github.com/KiCad/%{templname}/archive/%{version}/%{templname}-%{version}.tar.gz |
31 |
Source5: https://github.com/KiCad/%{fpname}/archive/%{version}/%{fpname}-%{version}.tar.gz |
32 |
Source6: https://github.com/KiCad/%{i18nname}/archive/%{version}/%{i18nname}-%{version}.tar.gz |
33 |
|
34 |
# This needs to be aligned with kicad-library-*/template/fp-lib-table.for-pretty |
35 |
|
36 |
Patch1: kicad-5.1.0-nostrip.patch |
37 |
|
38 |
BuildRequires: wxgtk3.0-devel |
39 |
BuildRequires: mesa-common-devel |
40 |
BuildRequires: imagemagick |
41 |
BuildRequires: boost-devel |
42 |
BuildRequires: glm-devel |
43 |
BuildRequires: oce-devel |
44 |
BuildRequires: ngspice-devel |
45 |
BuildRequires: pkgconfig(glew) |
46 |
BuildRequires: pkgconfig(cairo) |
47 |
BuildRequires: pkgconfig(openssl) >= 1.1 |
48 |
BuildRequires: libgomp-devel |
49 |
BuildRequires: pkgconfig(libcurl) |
50 |
BuildRequires: cmake |
51 |
# doc |
52 |
BuildRequires: dblatex |
53 |
BuildRequires: po4a |
54 |
BuildRequires: asciidoc |
55 |
BuildRequires: git |
56 |
BuildRequires: perl(Unicode::LineBreak) |
57 |
BuildRequires: source-highlight |
58 |
# python scripting |
59 |
BuildRequires: pkgconfig(python3) |
60 |
BuildRequires: python3-wxpython4 |
61 |
BuildRequires: swig |
62 |
|
63 |
BuildRequires: desktop-file-utils |
64 |
Requires: %{name}-library |
65 |
Requires: %{docname} |
66 |
Requires: %{i18nname} |
67 |
Requires: python3-wxpython4 |
68 |
|
69 |
%description |
70 |
Kicad is an open source (GPL) program for the creation of electronic |
71 |
schematic diagrams and printed circuit board artwork. |
72 |
|
73 |
Kicad is a set of four programs and a project manager: |
74 |
|
75 |
* Eeschema: Schematic entry. |
76 |
* Pcbnew: Board editor. |
77 |
* Gerbview: GERBER viewer (photoplotter documents). |
78 |
* Cvpcb: footprint selector for components used in the circuit design. |
79 |
* Kicad: project manager. |
80 |
|
81 |
%package doc |
82 |
Summary: Documentation for kicad (creation of electronic schematic diagrams) |
83 |
Requires: %{name} |
84 |
BuildArch: noarch |
85 |
|
86 |
%description doc |
87 |
Kicad is an open source (GPL) program for the creation of electronic |
88 |
schematic diagrams and printed circuit board artwork. |
89 |
|
90 |
Kicad-doc is the documentation for kicad. |
91 |
|
92 |
%package i18n |
93 |
Summary: Kicad locales |
94 |
Requires: %{name} |
95 |
BuildArch: noarch |
96 |
|
97 |
Obsoletes: kicad-locales-ca |
98 |
Obsoletes: kicad-locales-cs |
99 |
Obsoletes: kicad-locales-de |
100 |
Obsoletes: kicad-locales-en |
101 |
Obsoletes: kicad-locales-es |
102 |
Obsoletes: kicad-locales-fi |
103 |
Obsoletes: kicad-locales-fr |
104 |
Obsoletes: kicad-locales-hu |
105 |
Obsoletes: kicad-locales-it |
106 |
Obsoletes: kicad-locales-ja |
107 |
Obsoletes: kicad-locales-ko |
108 |
Obsoletes: kicad-locales-lt |
109 |
Obsoletes: kicad-locales-nl |
110 |
Obsoletes: kicad-locales-pl |
111 |
Obsoletes: kicad-locales-pt |
112 |
Obsoletes: kicad-locales-ru |
113 |
Obsoletes: kicad-locales-sl |
114 |
Obsoletes: kicad-locales-sv |
115 |
Obsoletes: kicad-locales-zh-cn |
116 |
|
117 |
%description i18n |
118 |
Kicad is an open source (GPL) program for the creation of electronic |
119 |
schematic diagrams and printed circuit board artwork. |
120 |
|
121 |
Kicad-i18n provides locales for kicad. |
122 |
|
123 |
|
124 |
%package library |
125 |
Summary: Library for kicad (creation of electronic schematic diagrams) |
126 |
License: LGPLv2 |
127 |
Requires: %{name} |
128 |
BuildArch: noarch |
129 |
|
130 |
%description library |
131 |
Kicad is an open source (GPL) program for the creation of electronic |
132 |
schematic diagrams and printed circuit board artwork. |
133 |
|
134 |
Kicad-library is a set of libraries needed by kicad. |
135 |
|
136 |
%prep |
137 |
%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 |
138 |
%patch1 -p1 |
139 |
|
140 |
%build |
141 |
export LC_ALL=C |
142 |
|
143 |
# Building kicad |
144 |
# Set CMAKE_PREFIX_PATH because of a misconfiguration in opencascade |
145 |
%cmake \ |
146 |
-DBUILD_SHARED_LIBS:BOOL=OFF \ |
147 |
-DCMAKE_BUILD_TYPE=Release \ |
148 |
-DKICAD_BUILD_VERSION=%{version} \ |
149 |
-DBUILD_GITHUB_PLUGIN=ON \ |
150 |
-DKICAD_SCRIPTING=ON \ |
151 |
-DKICAD_SCRIPTING_MODULES=ON \ |
152 |
-DKICAD_SCRIPTING_WXPYTHON=ON \ |
153 |
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \ |
154 |
-DKICAD_SCRIPTING_PYTHON3=ON \ |
155 |
-DKICAD_SCRIPTING_ACTION_MENU=ON \ |
156 |
-DCPACK_DO_STRIP=OFF |
157 |
%make_build |
158 |
# for %%cmake: |
159 |
cd .. |
160 |
|
161 |
# Building kicad-doc |
162 |
pushd %{docname}-%{version} |
163 |
%cmake \ |
164 |
-DCMAKE_BUILD_TYPE=Release \ |
165 |
-DBUILD_FORMATS=html |
166 |
%make_build |
167 |
popd |
168 |
|
169 |
# Building kicad-symbols |
170 |
pushd %{symname}-%{version} |
171 |
%cmake \ |
172 |
-DCMAKE_BUILD_TYPE=Release |
173 |
%make_build |
174 |
popd |
175 |
|
176 |
# Building kicad-packages3D |
177 |
pushd %{p3dname}-%{version} |
178 |
%cmake \ |
179 |
-DCMAKE_BUILD_TYPE=Release |
180 |
%make_build |
181 |
popd |
182 |
|
183 |
# Building kicad-templates |
184 |
pushd %{templname}-%{version} |
185 |
%cmake \ |
186 |
-DCMAKE_BUILD_TYPE=Release |
187 |
%make_build |
188 |
popd |
189 |
|
190 |
# Building kicad-footprints |
191 |
pushd %{fpname}-%{version} |
192 |
%cmake \ |
193 |
-DCMAKE_BUILD_TYPE=Release |
194 |
%make_build |
195 |
popd |
196 |
|
197 |
|
198 |
# Building kicad-i18n |
199 |
pushd %{i18nname}-%{version} |
200 |
%cmake \ |
201 |
-DCMAKE_BUILD_TYPE=Release \ |
202 |
-DKICAD_I18N_UNIX_STRICT_PATH=ON |
203 |
%make_build |
204 |
popd |
205 |
|
206 |
%install |
207 |
pushd %{docname}-%{version} |
208 |
# Installing kicad-doc |
209 |
%make_install -C build |
210 |
popd |
211 |
|
212 |
# Installing kicad-symbols |
213 |
pushd %{symname}-%{version} |
214 |
%make_install -C build |
215 |
popd |
216 |
|
217 |
# Installing kicad-packages3D |
218 |
pushd %{p3dname}-%{version} |
219 |
%make_install -C build |
220 |
popd |
221 |
|
222 |
# Installing kicad-templates |
223 |
pushd %{templname}-%{version} |
224 |
%make_install -C build |
225 |
popd |
226 |
|
227 |
# Installing kicad-footprints |
228 |
pushd %{fpname}-%{version} |
229 |
%make_install -C build |
230 |
popd |
231 |
|
232 |
# Installing kicad-i18n |
233 |
pushd %{i18nname}-%{version} |
234 |
%make_install -C build |
235 |
popd |
236 |
%find_lang %{name} |
237 |
|
238 |
# Installing kicad |
239 |
%make_install -C build |
240 |
|
241 |
# create desktop file |
242 |
desktop-file-install --vendor='' \ |
243 |
--remove-category='Scientific' \ |
244 |
--add-category='Science;Electronics;Education' \ |
245 |
--dir=%buildroot%{_datadir}/applications \ |
246 |
%buildroot%{_datadir}/applications/*.desktop |
247 |
|
248 |
# remove unwanted devel files |
249 |
rm -r %{buildroot}%{_libdir}/libkicad_3dsg.so |
250 |
|
251 |
%files |
252 |
%{_bindir}/* |
253 |
%{_libdir}/libkicad_3dsg.so.* |
254 |
%{_iconsdir}/*/*/* |
255 |
%{python3_sitelib}/_pcbnew.so |
256 |
%{python3_sitelib}/pcbnew.* |
257 |
%{python3_sitelib}/__pycache__/* |
258 |
%{_datadir}/%{name}/demos/ |
259 |
%{_datadir}/%{name}/template/ |
260 |
%{_datadir}/applications/*.desktop |
261 |
%{_datadir}/mime/packages/kicad-*.xml |
262 |
%{_datadir}/appdata/kicad.*.xml |
263 |
%{_libdir}/%{name}/plugins/ |
264 |
%{_datadir}/%{name}/plugins/ |
265 |
%{_datadir}/%{name}/scripting/ |
266 |
%dir %{_libdir}/%{name} |
267 |
%dir %{_datadir}/%{name} |
268 |
|
269 |
%files doc |
270 |
%doc %{_docdir}/%{name}/ |
271 |
|
272 |
%files i18n -f %{name}.lang |
273 |
|
274 |
%files library |
275 |
%{_datadir}/%{name}/library |
276 |
%{_datadir}/%{name}/modules |