3 %bcond_with gdb # GDB support in FPC IDE
4 %bcond_without doc # documentation
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
14 Group: Development/Languages
15 Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
16 # Source0-md5: 3681ae4a208be4f64ec65e832a9a702d
17 Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18 # Source1-md5: 18354e51309a34b0efe7702633568a1e
19 Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20 # Source2-md5: 0186779de0c9caee073fc1394afbee56
21 Patch0: %{name}-skip-dev-dot.patch
22 Patch1: %{name}-link.patch
23 Patch2: glibc-2.34.patch
24 Patch3: dwarf-debug.patch
25 Patch4: fpcdocs-r1260.patch
27 URL: http://www.freepascal.org/
28 BuildRequires: babeltrace-devel
29 BuildRequires: binutils-devel >= 3:2.17.50
30 BuildRequires: expat-devel
31 BuildRequires: gpm-devel
32 BuildRequires: guile-devel
33 BuildRequires: libselinux-devel
34 BuildRequires: ncurses-devel
35 BuildRequires: readline-devel
36 BuildRequires: rpmbuild(macros) >= 1.213
37 BuildRequires: xz-devel
38 BuildRequires: zlib-devel
40 BuildRequires: gdb-lib >= 7.2-7}
41 BuildRequires: python-devel
44 BuildRequires: tetex-fonts-jknappen
45 BuildRequires: tetex-format-pdflatex
46 BuildRequires: tetex-latex-imakeidx
47 BuildRequires: tetex-makeindex
48 BuildRequires: tetex-metafont
49 BuildRequires: texlive-latex-enumitem
50 BuildRequires: texlive-latex-ucs
51 BuildRequires: texlive-tex-xkeyval
52 BuildRequires: texlive-xetex
55 Provides: fpc-bootstrap
56 ExclusiveArch: %{ix86} %{x8664}
58 # %{arm} ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/arm-linux/fpc-3.0.0.arm-linux-raspberry1wq.tar
59 # ppc64 ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/powerpc64-linux/fpc-3.0.0.powerpc64-linux.tar
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 Free Pascal is a 32-bit Pascal compiler. Free Pascal is designed to
64 be, as much as possible, source compatible with Turbo Pascal 7.0 and
65 Delphi 4 (although this goal is not yet attained), but it also
66 enhances these languages with elements like function overloading. And,
67 unlike these ancestors, it supports multiple platforms.
69 %description -l pl.UTF-8
70 Free Pascal to 32-bitowy kompilator języka Pascal. Free Pascal został
71 zaprojektowany by być (na ile to tylko możliwe) kompatybilnym z Turbo
72 Pascalem 7.0 oraz Delphi 4. Free Pascal również rozszerza te języki
73 elementami takimi jak przeciążanie funkcji.
75 %description -l ru.UTF-8
76 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
77 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
78 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
79 mysql, postgres, ibase.
81 %description -l uk.UTF-8
82 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
83 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
84 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
85 mysql, postgres, ibase.
88 Summary: Free Pascal IDE (integrated development environment)
89 Summary(pl.UTF-8): Zintegrowane środowisko programistyczne (IDE) Free Pascala
90 Group: Development/Tools
91 Requires: %{name} = %{version}-%{release}
94 Free Pascal IDE (integrated development environment).
96 %description ide -l pl.UTF-8
97 Zintegrowane środowisko programistyczne (IDE) Free Pascala.
100 Summary: Free Pascal Compiler source files
101 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
103 Requires: %{name} = %{version}-%{release}
107 Free Pascal Compiler source files.
109 %description src -l pl.UTF-8
110 Pliki źródłowe kompilatora Free Pascal.
113 Summary: Free Pascal Compiler exaple programs
114 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
116 Requires: %{name} = %{version}-%{release}
118 %description examples
119 Free Pascal Compiler exaple programs.
121 %description examples -l pl.UTF-8
122 Przykładowe programy do kompilatora Free Pascal.
125 Summary: Free Pascal Compiler documentation
126 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
128 # doesn't require base
131 Documentation for fpc in PDF format.
133 %description doc -l pl.UTF-8
134 Dokumentacja do fpc w formacie PDF.
137 %setup -q -n %{name}build-%{version}
149 %define _bver %{version}
155 %define _bver %{version}
157 %define _barch x86_64
160 %define _bver %{version}
167 %define _barch powerpc
170 %define _bver %{version}
172 %define _barch powerpc64
174 %ifarch sparc sparcv9
180 cd %{name}-%{version}.%{_barch}-linux
181 tar xf binary.*-linux.tar
186 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
189 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
192 find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
193 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
195 # remove precompiled objects from fpc-src
196 %{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o}
200 cp -af fpcsrc/* fpc-src
204 find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
207 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\1,' \
208 fpc-src/packages/fpmkunit/examples/ppu2fpmake.sh \
209 fpc-src/packages/gdbint/gen-gdblib-inc.sh \
210 fpc-src/packages/gtk2/src/gtk2x11/scripts/gdkx11_h2pas.sh \
211 fpc-src/rtl/unix/scripts/check_consts.sh \
212 fpc-src/rtl/unix/scripts/check_errno.sh \
213 fpc-src/rtl/unix/scripts/check_errnostr.sh \
214 fpc-src/rtl/unix/scripts/check_sys.sh
217 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
218 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
219 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
220 DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
221 FPCSRCDIR=`pwd`/fpcsrc
223 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
224 case "%{_build_cpu}" in
225 i386|i486) OPTF="-OG2p1" ;;
226 i586) OPTF="-OG2p2" ;;
227 i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;;
231 %{__make} -C fpcsrc compiler_cycle \
232 OPT="$OPTF -k--build-id -gl -gw %{!?debug:-Xs} -n" \
234 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
235 BININSTALLDIR=%{_bindir} \
236 DATA2INC="$DATA2INC" \
241 %{__make} -C fpcsrc \
242 OPT="$OPTF -k--build-id -gl -gw %{!?debug:-Xs} -n" \
244 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
245 BININSTALLDIR=%{_bindir} \
246 %{?with_gdb:GDBLIBDIR=%{_libdir}} \
247 %{!?with_gdb:NOGDB=YES} \
248 DATA2INC="$DATA2INC" \
264 export save_size=10000
265 %{__make} -j1 -C fpcdocs \
268 FPCSRCDIR="$FPCSRCDIR" \
273 rm -rf $RPM_BUILD_ROOT
274 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
276 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
278 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
279 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
280 %{__make} -j1 -C fpcsrc \
281 compiler_distinstall \
283 packages_distinstall \
288 FPCDIR=%{_libdir}/%{name}/%{version} \
289 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
290 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
291 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
292 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
293 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
294 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
295 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
296 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
297 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
299 %{__make} -j1 -C install/man installman \
300 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
302 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
304 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
305 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
307 %if "%{_lib}" != "lib"
308 %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
311 # Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
312 %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
315 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1
318 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1
321 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1
323 %ifnarch sparc sparcv9
324 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1
327 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1
331 rm -rf $RPM_BUILD_ROOT
334 %defattr(644,root,root,755)
335 %attr(755,root,root) %{_bindir}/bin2obj
336 %attr(755,root,root) %{_bindir}/chmcmd
337 %attr(755,root,root) %{_bindir}/chmls
338 %attr(755,root,root) %{_bindir}/cldrparser
339 %attr(755,root,root) %{_bindir}/compileserver
340 %attr(755,root,root) %{_bindir}/data2inc
341 %attr(755,root,root) %{_bindir}/delp
342 %attr(755,root,root) %{_bindir}/fd2pascal
343 %attr(755,root,root) %{_bindir}/fpc*
344 %attr(755,root,root) %{_bindir}/fpdoc
345 %attr(755,root,root) %{_bindir}/fppkg
346 %attr(755,root,root) %{_bindir}/fprcp
347 %attr(755,root,root) %{_bindir}/grab_vcsa
348 %attr(755,root,root) %{_bindir}/h2pas
349 %attr(755,root,root) %{_bindir}/h2paspp
350 %attr(755,root,root) %{_bindir}/instantfpc
351 %attr(755,root,root) %{_bindir}/json2pas
352 %attr(755,root,root) %{_bindir}/makeskel
353 %attr(755,root,root) %{_bindir}/mka64ins
354 %attr(755,root,root) %{_bindir}/mkarmins
355 %attr(755,root,root) %{_bindir}/mkinsadd
356 %attr(755,root,root) %{_bindir}/mkx86ins
357 %attr(755,root,root) %{_bindir}/pas2fpm
358 %attr(755,root,root) %{_bindir}/pas2jni
359 %attr(755,root,root) %{_bindir}/pas2js
360 %attr(755,root,root) %{_bindir}/pas2ut
361 %attr(755,root,root) %{_bindir}/plex
362 %attr(755,root,root) %{_bindir}/postw32
363 %attr(755,root,root) %{_bindir}/ppc%{_bname}
364 %attr(755,root,root) %{_bindir}/ppdep
365 %attr(755,root,root) %{_bindir}/ppudump
366 %attr(755,root,root) %{_bindir}/ppufiles
367 %attr(755,root,root) %{_bindir}/ppumove
368 %attr(755,root,root) %{_bindir}/ptop
369 %attr(755,root,root) %{_bindir}/pyacc
370 %attr(755,root,root) %{_bindir}/rmcvsdir
371 %attr(755,root,root) %{_bindir}/rstconv
372 %attr(755,root,root) %{_bindir}/unihelper
373 %attr(755,root,root) %{_bindir}/unitdiff
374 %attr(755,root,root) %{_bindir}/webidl2pas
375 # TODO: move the below files to data dir
376 # - JSON resources(?)
377 %{_bindir}/makeskel.rsj
379 %{_bindir}/pas2ut.rsj
380 %{_bindir}/rstconv.rsj
381 %{_bindir}/unitdiff.rsj
382 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
383 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
384 %dir %{_sysconfdir}/fppkg
385 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
386 %dir %{_libdir}/%{name}
387 %dir %{_libdir}/%{name}/%{version}
388 %dir %{_libdir}/%{name}/lexyacc
389 %{_libdir}/%{name}/%{version}/msg
390 %{_libdir}/%{name}/%{version}/units
391 %{_libdir}/%{name}/%{version}/fpmkinst
392 %{_libdir}/%{name}/lexyacc/*
393 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
394 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
395 %attr(755,root,root) %{_libdir}/libpas2jslib.so
396 %{_mandir}/man1/bin2obj.1*
397 %{_mandir}/man1/chmcmd.1*
398 %{_mandir}/man1/chmls.1*
399 %{_mandir}/man1/data2inc.1*
400 %{_mandir}/man1/delp.1*
401 %{_mandir}/man1/fd2pascal.1*
402 %{_mandir}/man1/fp.1*
403 %{_mandir}/man1/fpc*.1*
404 %{_mandir}/man1/fpdoc.1*
405 %{_mandir}/man1/fppkg.1*
406 %{_mandir}/man1/fprcp.1*
407 %{_mandir}/man1/grab_vcsa.1*
408 %{_mandir}/man1/h2pas.1*
409 %{_mandir}/man1/h2paspp.1*
410 %{_mandir}/man1/makeskel.1*
411 %{_mandir}/man1/pas2fpm.1*
412 %{_mandir}/man1/pas2jni.1*
413 %{_mandir}/man1/pas2ut.1*
414 %{_mandir}/man1/plex.1*
415 %{_mandir}/man1/postw32.1*
417 %{_mandir}/man1/ppcppc.1*
419 %{_mandir}/man1/ppc%{_bname}.1*
421 %{_mandir}/man1/ppdep.1*
422 %{_mandir}/man1/ppudump.1*
423 %{_mandir}/man1/ppufiles.1*
424 %{_mandir}/man1/ppumove.1*
425 %{_mandir}/man1/ptop.1*
426 %{_mandir}/man1/pyacc.1*
427 %{_mandir}/man1/rmcvsdir.1*
428 %{_mandir}/man1/rstconv.1*
429 %{_mandir}/man1/unitdiff.1*
430 %{_mandir}/man5/fpc.cfg.5*
431 %{_mandir}/man5/fpcmake.5*
432 %{_mandir}/man5/ptop.cfg.5*
435 %defattr(644,root,root,755)
436 %attr(755,root,root) %{_bindir}/fp
437 # TODO: move the below files to data dir
438 # - ANSI art file used by fp binary
441 # - IDE command templates
443 %{_bindir}/cvsdiff.tdf
446 %{_bindir}/tpgrep.tdf
447 # - Pascal code skeletons
448 %{_bindir}/gplprog.pt
449 %{_bindir}/gplunit.pt
450 %{_bindir}/program.pt
452 %{_libdir}/%{name}/%{version}/ide
455 %defattr(644,root,root,755)
459 %defattr(644,root,root,755)
464 %defattr(644,root,root,755)