]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without ide # FPC IDE | |
4 | %bcond_without doc # documentation | |
5 | ||
6 | Summary: Free Pascal - 32-bit Pascal compiler | |
7 | Summary(pl.UTF-8): Free Pascal - 32-bitowy kompilator języka Pascal | |
8 | Summary(ru.UTF-8): Свободный компилятор Pascal | |
9 | Summary(uk.UTF-8): Вільний компілятор Pascal | |
10 | Name: fpc | |
11 | Version: 3.0.0 | |
12 | Release: 5 | |
13 | License: GPL v2+ | |
14 | Group: Development/Languages | |
15 | Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz | |
16 | # Source0-md5: bb7d17ef5c7c007466368262c0779cb7 | |
17 | Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar | |
18 | # Source1-md5: 41e0bcb7c11b7edf311142079ba2defa | |
19 | Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar | |
20 | # Source2-md5: db2ae45b0d1846e01b61ba52f03e60b2 | |
21 | Patch0: %{name}-skip-dev-dot.patch | |
22 | Patch1: %{name}-link.patch | |
23 | Patch2: %{name}-gdb.patch | |
24 | Patch3: fpc-r32374.patch | |
25 | Patch4: fpcdocs-r1260.patch | |
26 | Patch5: fpc-man.patch | |
27 | URL: http://www.freepascal.org/ | |
28 | BuildRequires: binutils-devel >= 3:2.17.50 | |
29 | BuildRequires: gpm-devel | |
30 | BuildRequires: ncurses-devel | |
31 | BuildRequires: rpmbuild(macros) >= 1.213 | |
32 | %if %{with ide} | |
33 | BuildRequires: babeltrace-devel | |
34 | BuildRequires: expat-devel | |
35 | BuildRequires: gdb-lib >= 7.2-7 | |
36 | BuildRequires: guile-devel | |
37 | BuildRequires: python-devel | |
38 | BuildRequires: readline-devel | |
39 | BuildRequires: libselinux-devel | |
40 | BuildRequires: xz-devel | |
41 | BuildRequires: zlib-devel | |
42 | %endif | |
43 | %if %{with doc} | |
44 | BuildRequires: tetex-fonts-jknappen | |
45 | BuildRequires: tetex-format-pdflatex | |
46 | BuildRequires: tetex-makeindex | |
47 | BuildRequires: tetex-metafont | |
48 | BuildRequires: texlive-xetex | |
49 | %endif | |
50 | Requires: binutils | |
51 | Provides: fpc-bootstrap | |
52 | ExclusiveArch: %{ix86} %{x8664} | |
53 | # TODO: | |
54 | # %{arm} ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/arm-linux/fpc-3.0.0.arm-linux-raspberry1wq.tar | |
55 | # ppc64 ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/powerpc64-linux/fpc-3.0.0.powerpc64-linux.tar | |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
58 | %description | |
59 | Free Pascal is a 32-bit Pascal compiler. Free Pascal is designed to | |
60 | be, as much as possible, source compatible with Turbo Pascal 7.0 and | |
61 | Delphi 4 (although this goal is not yet attained), but it also | |
62 | enhances these languages with elements like function overloading. And, | |
63 | unlike these ancestors, it supports multiple platforms. | |
64 | ||
65 | %description -l pl.UTF-8 | |
66 | Free Pascal to 32-bitowy kompilator języka Pascal. Free Pascal został | |
67 | zaprojektowany by być (na ile to tylko możliwe) kompatybilnym z Turbo | |
68 | Pascalem 7.0 oraz Delphi 4. Free Pascal również rozszerza te języki | |
69 | elementami takimi jak przeciążanie funkcji. | |
70 | ||
71 | %description -l ru.UTF-8 | |
72 | FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и | |
73 | Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL | |
74 | (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib, | |
75 | mysql, postgres, ibase. | |
76 | ||
77 | %description -l uk.UTF-8 | |
78 | FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та | |
79 | Delphi. Постачається із RTL (бібліотекою часу виконання), FCL | |
80 | (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib, | |
81 | mysql, postgres, ibase. | |
82 | ||
83 | %package ide | |
84 | Summary: Free Pascal IDE (integrated development environment) | |
85 | Summary(pl.UTF-8): Zintegrowane środowisko programistyczne (IDE) Free Pascala | |
86 | Group: Development/Tools | |
87 | Requires: %{name} = %{version}-%{release} | |
88 | ||
89 | %description ide | |
90 | Free Pascal IDE (integrated development environment). | |
91 | ||
92 | %description ide -l pl.UTF-8 | |
93 | Zintegrowane środowisko programistyczne (IDE) Free Pascala. | |
94 | ||
95 | %package src | |
96 | Summary: Free Pascal Compiler source files | |
97 | Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal | |
98 | Group: Development | |
99 | Requires: %{name} = %{version}-%{release} | |
100 | Provides: fpcsrc | |
101 | ||
102 | %description src | |
103 | Free Pascal Compiler source files. | |
104 | ||
105 | %description src -l pl.UTF-8 | |
106 | Pliki źródłowe kompilatora Free Pascal. | |
107 | ||
108 | %package examples | |
109 | Summary: Free Pascal Compiler exaple programs | |
110 | Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal | |
111 | Group: Documentation | |
112 | Requires: %{name} = %{version}-%{release} | |
113 | ||
114 | %description examples | |
115 | Free Pascal Compiler exaple programs. | |
116 | ||
117 | %description examples -l pl.UTF-8 | |
118 | Przykładowe programy do kompilatora Free Pascal. | |
119 | ||
120 | %package doc | |
121 | Summary: Free Pascal Compiler documentation | |
122 | Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal | |
123 | Group: Documentation | |
124 | # doesn't require base | |
125 | ||
126 | %description doc | |
127 | Documentation for fpc in PDF format. | |
128 | ||
129 | %description doc -l pl.UTF-8 | |
130 | Dokumentacja do fpc w formacie PDF. | |
131 | ||
132 | %prep | |
133 | %setup -q -n %{name}build-%{version} | |
134 | %patch0 -p1 | |
135 | %patch1 -p1 | |
136 | %patch2 -p1 | |
137 | %patch3 -p0 | |
138 | %patch4 -p0 | |
139 | %patch5 -p1 | |
140 | ||
141 | %ifarch %{ix86} | |
142 | tar xf %{SOURCE1} | |
143 | %define _bver %{version} | |
144 | %define _bname 386 | |
145 | %define _barch i386 | |
146 | %endif | |
147 | %ifarch %{x8664} | |
148 | tar xf %{SOURCE2} | |
149 | %define _bver %{version} | |
150 | %define _bname x64 | |
151 | %define _barch x86_64 | |
152 | %endif | |
153 | %ifarch %{arm} | |
154 | %define _bver %{version} | |
155 | %define _bname arm | |
156 | %define _barch arm | |
157 | %endif | |
158 | %ifarch ppc | |
159 | %define _bver ? | |
160 | %define _bname ppc | |
161 | %define _barch powerpc | |
162 | %endif | |
163 | %ifarch ppc64 | |
164 | %define _bver %{version} | |
165 | %define _bname ppc64 | |
166 | %define _barch powerpc64 | |
167 | %endif | |
168 | %ifarch sparc sparcv9 | |
169 | %define _bver ? | |
170 | %define _bname sparc | |
171 | %define _barch sparc | |
172 | %endif | |
173 | ||
174 | cd %{name}-%{version}.%{_barch}-linux | |
175 | tar xf binary.*-linux.tar | |
176 | cd .. | |
177 | ||
178 | mkdir bin | |
179 | cd bin | |
180 | for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do | |
181 | tar xzf $i | |
182 | done | |
183 | ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin | |
184 | cd .. | |
185 | ||
186 | find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \ | |
187 | xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g' | |
188 | ||
189 | # remove precompiled objects from fpc-src | |
190 | %{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o} | |
191 | ||
192 | # save for fpc-src | |
193 | install -d fpc-src | |
194 | cp -af fpcsrc/* fpc-src | |
195 | rm -r fpc-src/{ide,tests} | |
196 | ||
197 | %if 0%{?debug:1} | |
198 | find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//' | |
199 | %endif | |
200 | ||
201 | %build | |
202 | # use ld.bfd | |
203 | [ -d our-ld ] || install -d our-ld | |
204 | ln -sf %{_bindir}/ld.bfd our-ld/ld | |
205 | export PATH=$(pwd)/our-ld:$PATH | |
206 | ||
207 | PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname} | |
208 | NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} | |
209 | NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc | |
210 | DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc | |
211 | ||
212 | # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins | |
213 | case "%{_build_cpu}" in | |
214 | i386|i486) OPTF="-OG2p1" ;; | |
215 | i586) OPTF="-OG2p2" ;; | |
216 | i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;; | |
217 | *) OPTF="-O2" ;; | |
218 | esac | |
219 | ||
220 | %{__make} -C fpcsrc compiler_cycle \ | |
221 | OPT="$OPTF %{!?debug:-Xs} -n" \ | |
222 | RELEASE="1" \ | |
223 | BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \ | |
224 | BININSTALLDIR=%{_bindir} \ | |
225 | DATA2INC="$DATA2INC" \ | |
226 | PP="$PP" \ | |
227 | FPC="$PP" \ | |
228 | LINKSMART=YES | |
229 | ||
230 | %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \ | |
231 | RELEASE="1" \ | |
232 | BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \ | |
233 | BININSTALLDIR=%{_bindir} \ | |
234 | GDBLIBDIR=%{_libdir} \ | |
235 | DATA2INC="$DATA2INC" \ | |
236 | PP="$NEWPP" \ | |
237 | FPC="$NEWPP" \ | |
238 | FPDOC=$NEWFPDOC \ | |
239 | LINKSMART=YES \ | |
240 | NODOCS=YES \ | |
241 | rtl_clean \ | |
242 | packages_clean \ | |
243 | utils_clean \ | |
244 | %{?with_ide: ide_clean installer_clean} \ | |
245 | rtl_all \ | |
246 | packages_all \ | |
247 | utils_all %{?with_ide:ide_all installer_all} | |
248 | ||
249 | %if %{with doc} | |
250 | export save_size=10000 | |
251 | %{__make} -j1 -C fpcdocs \ | |
252 | FPDOC=$NEWFPDOC \ | |
253 | FPC="$NEWPP" \ | |
254 | ||
255 | %endif | |
256 | ||
257 | %install | |
258 | rm -rf $RPM_BUILD_ROOT | |
259 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc} | |
260 | ||
261 | cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc | |
262 | ||
263 | NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} | |
264 | FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake | |
265 | %{__make} -j1 -C fpcsrc \ | |
266 | compiler_distinstall \ | |
267 | rtl_distinstall \ | |
268 | packages_distinstall \ | |
269 | %{?with_ide:ide_distinstall} \ | |
270 | utils_distinstall \ | |
271 | PP="$NEWPP" \ | |
272 | FPCMAKE="$FPCMAKE" \ | |
273 | SMARTLINK=YES \ | |
274 | FPCDIR=%{_libdir}/%{name}/%{version} \ | |
275 | INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \ | |
276 | INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \ | |
277 | INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ | |
278 | INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \ | |
279 | INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \ | |
280 | INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \ | |
281 | INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \ | |
282 | INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \ | |
283 | CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc | |
284 | ||
285 | %{__make} -j1 -C install/man installman \ | |
286 | INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} | |
287 | ||
288 | ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir} | |
289 | ||
290 | ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld | |
291 | ||
292 | sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir} | |
293 | %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default} | |
294 | ||
295 | %if "%{_lib}" != "lib" | |
296 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name} | |
297 | %endif | |
298 | ||
299 | # Fix examples, make seems to ignore INSTALL_EXAMPLEDIR | |
300 | %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/ | |
301 | ||
302 | %ifnarch %{ix86} | |
303 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1 | |
304 | %endif | |
305 | %ifnarch %{arm} | |
306 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1 | |
307 | %endif | |
308 | %ifnarch ppc ppc64 | |
309 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1 | |
310 | %endif | |
311 | %ifnarch sparc sparcv9 | |
312 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1 | |
313 | %endif | |
314 | %ifnarch %{x8664} | |
315 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1 | |
316 | %endif | |
317 | ||
318 | %clean | |
319 | rm -rf $RPM_BUILD_ROOT | |
320 | ||
321 | %files | |
322 | %defattr(644,root,root,755) | |
323 | %attr(755,root,root) %{_bindir}/bin2obj | |
324 | %attr(755,root,root) %{_bindir}/chmcmd | |
325 | %attr(755,root,root) %{_bindir}/chmls | |
326 | %attr(755,root,root) %{_bindir}/cldrparser | |
327 | %attr(755,root,root) %{_bindir}/data2inc | |
328 | %attr(755,root,root) %{_bindir}/delp | |
329 | %attr(755,root,root) %{_bindir}/fd2pascal | |
330 | %attr(755,root,root) %{_bindir}/fpc* | |
331 | %attr(755,root,root) %{_bindir}/fpdoc | |
332 | %attr(755,root,root) %{_bindir}/fppkg | |
333 | %attr(755,root,root) %{_bindir}/fprcp | |
334 | %attr(755,root,root) %{_bindir}/grab_vcsa | |
335 | %attr(755,root,root) %{_bindir}/h2pas | |
336 | %attr(755,root,root) %{_bindir}/h2paspp | |
337 | %attr(755,root,root) %{_bindir}/instantfpc | |
338 | %attr(755,root,root) %{_bindir}/makeskel | |
339 | %attr(755,root,root) %{_bindir}/mkarmins | |
340 | %attr(755,root,root) %{_bindir}/mkinsadd | |
341 | %attr(755,root,root) %{_bindir}/mkx86ins | |
342 | %attr(755,root,root) %{_bindir}/pas2fpm | |
343 | %attr(755,root,root) %{_bindir}/pas2jni | |
344 | %attr(755,root,root) %{_bindir}/pas2ut | |
345 | %attr(755,root,root) %{_bindir}/plex | |
346 | %attr(755,root,root) %{_bindir}/postw32 | |
347 | %attr(755,root,root) %{_bindir}/ppc%{_bname} | |
348 | %attr(755,root,root) %{_bindir}/ppdep | |
349 | %attr(755,root,root) %{_bindir}/ppudump | |
350 | %attr(755,root,root) %{_bindir}/ppufiles | |
351 | %attr(755,root,root) %{_bindir}/ppumove | |
352 | %attr(755,root,root) %{_bindir}/ptop | |
353 | %attr(755,root,root) %{_bindir}/pyacc | |
354 | %attr(755,root,root) %{_bindir}/rmcvsdir | |
355 | %attr(755,root,root) %{_bindir}/rstconv | |
356 | %attr(755,root,root) %{_bindir}/unihelper | |
357 | %attr(755,root,root) %{_bindir}/unitdiff | |
358 | # TODO: move the below files to data dir | |
359 | # - JSON resources(?) | |
360 | %{_bindir}/makeskel.rsj | |
361 | %{_bindir}/ptop.rsj | |
362 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg | |
363 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg | |
364 | %dir %{_sysconfdir}/fppkg | |
365 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default | |
366 | %dir %{_libdir}/%{name} | |
367 | %dir %{_libdir}/%{name}/%{version} | |
368 | %dir %{_libdir}/%{name}/lexyacc | |
369 | %{_libdir}/%{name}/%{version}/msg | |
370 | %{_libdir}/%{name}/%{version}/units | |
371 | %{_libdir}/%{name}/%{version}/fpmkinst | |
372 | %{_libdir}/%{name}/lexyacc/* | |
373 | %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld | |
374 | %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname} | |
375 | %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg | |
376 | %{_mandir}/man1/bin2obj.1* | |
377 | %{_mandir}/man1/chmcmd.1* | |
378 | %{_mandir}/man1/chmls.1* | |
379 | %{_mandir}/man1/data2inc.1* | |
380 | %{_mandir}/man1/delp.1* | |
381 | %{_mandir}/man1/fd2pascal.1* | |
382 | %{_mandir}/man1/fp.1* | |
383 | %{_mandir}/man1/fpc*.1* | |
384 | %{_mandir}/man1/fpdoc.1* | |
385 | %{_mandir}/man1/fppkg.1* | |
386 | %{_mandir}/man1/fprcp.1* | |
387 | %{_mandir}/man1/grab_vcsa.1* | |
388 | %{_mandir}/man1/h2pas.1* | |
389 | %{_mandir}/man1/h2paspp.1* | |
390 | %{_mandir}/man1/makeskel.1* | |
391 | %{_mandir}/man1/pas2fpm.1* | |
392 | %{_mandir}/man1/pas2jni.1* | |
393 | %{_mandir}/man1/pas2ut.1* | |
394 | %{_mandir}/man1/plex.1* | |
395 | %{_mandir}/man1/postw32.1* | |
396 | %ifarch ppc64 | |
397 | %{_mandir}/man1/ppcppc.1* | |
398 | %else | |
399 | %{_mandir}/man1/ppc%{_bname}.1* | |
400 | %endif | |
401 | %{_mandir}/man1/ppdep.1* | |
402 | %{_mandir}/man1/ppudump.1* | |
403 | %{_mandir}/man1/ppufiles.1* | |
404 | %{_mandir}/man1/ppumove.1* | |
405 | %{_mandir}/man1/ptop.1* | |
406 | %{_mandir}/man1/pyacc.1* | |
407 | %{_mandir}/man1/rmcvsdir.1* | |
408 | %{_mandir}/man1/rstconv.1* | |
409 | %{_mandir}/man1/unitdiff.1* | |
410 | %{_mandir}/man5/fpc.cfg.5* | |
411 | %{_mandir}/man5/fpcmake.5* | |
412 | %{_mandir}/man5/ptop.cfg.5* | |
413 | ||
414 | %if %{with ide} | |
415 | %files ide | |
416 | %defattr(644,root,root,755) | |
417 | %attr(755,root,root) %{_bindir}/fp | |
418 | # TODO: move the below files to data dir | |
419 | # - ANSI art file used by fp binary | |
420 | %{_bindir}/fp.ans | |
421 | # - IDE command templates | |
422 | %{_bindir}/cvsco.tdf | |
423 | %{_bindir}/cvsdiff.tdf | |
424 | %{_bindir}/cvsup.tdf | |
425 | %{_bindir}/grep.tdf | |
426 | %{_bindir}/tpgrep.tdf | |
427 | # - Pascal code skeletons | |
428 | %{_bindir}/gplprog.pt | |
429 | %{_bindir}/gplunit.pt | |
430 | %{_bindir}/program.pt | |
431 | %{_bindir}/unit.pt | |
432 | %{_libdir}/%{name}/%{version}/ide | |
433 | %endif | |
434 | ||
435 | %files src | |
436 | %defattr(644,root,root,755) | |
437 | %{_datadir}/fpcsrc | |
438 | ||
439 | %files examples | |
440 | %defattr(644,root,root,755) | |
441 | %{_examplesdir}/fpc | |
442 | ||
443 | %if %{with doc} | |
444 | %files doc | |
445 | %defattr(644,root,root,755) | |
446 | %doc fpcdocs/*.pdf | |
447 | %endif |