3 %bcond_without ide # FPC IDE
4 %bcond_with gdb # GDB support in FPC IDE
5 %bcond_without doc # documentation
7 Summary: Free Pascal - 32-bit Pascal compiler
8 Summary(pl.UTF-8): Free Pascal - 32-bitowy kompilator języka Pascal
9 Summary(ru.UTF-8): Свободный компилятор Pascal
10 Summary(uk.UTF-8): Вільний компілятор Pascal
15 Group: Development/Languages
16 Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
17 # Source0-md5: c0fc1662dbe45c1e3f66ed780a443849
18 Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
19 # Source1-md5: a58c3a2d7f8625d434abe9518e4ca38c
20 Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
21 # Source2-md5: e5721c1843cff301c5b46abfee17c890
22 Patch0: %{name}-skip-dev-dot.patch
23 Patch1: %{name}-link.patch
24 Patch2: %{name}-gdb.patch
25 Patch3: fpc-r32374.patch
26 Patch4: fpcdocs-r1260.patch
28 Patch6: fpc-r34749.patch
29 URL: http://www.freepascal.org/
30 BuildRequires: binutils-devel >= 3:2.17.50
31 BuildRequires: gpm-devel
32 BuildRequires: ncurses-devel
33 BuildRequires: rpmbuild(macros) >= 1.213
35 BuildRequires: babeltrace-devel
36 BuildRequires: expat-devel
37 %{?with_gdb:BuildRequires: gdb-lib >= 7.2-7}
38 BuildRequires: guile-devel
39 BuildRequires: python-devel
40 BuildRequires: readline-devel
41 BuildRequires: libselinux-devel
42 BuildRequires: xz-devel
43 BuildRequires: zlib-devel
46 BuildRequires: tetex-fonts-jknappen
47 BuildRequires: tetex-format-pdflatex
48 BuildRequires: tetex-makeindex
49 BuildRequires: tetex-metafont
50 BuildRequires: texlive-xetex
53 Provides: fpc-bootstrap
54 ExclusiveArch: %{ix86} %{x8664}
56 # %{arm} ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/arm-linux/fpc-3.0.0.arm-linux-raspberry1wq.tar
57 # ppc64 ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/powerpc64-linux/fpc-3.0.0.powerpc64-linux.tar
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 Free Pascal is a 32-bit Pascal compiler. Free Pascal is designed to
62 be, as much as possible, source compatible with Turbo Pascal 7.0 and
63 Delphi 4 (although this goal is not yet attained), but it also
64 enhances these languages with elements like function overloading. And,
65 unlike these ancestors, it supports multiple platforms.
67 %description -l pl.UTF-8
68 Free Pascal to 32-bitowy kompilator języka Pascal. Free Pascal został
69 zaprojektowany by być (na ile to tylko możliwe) kompatybilnym z Turbo
70 Pascalem 7.0 oraz Delphi 4. Free Pascal również rozszerza te języki
71 elementami takimi jak przeciążanie funkcji.
73 %description -l ru.UTF-8
74 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
75 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
76 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
77 mysql, postgres, ibase.
79 %description -l uk.UTF-8
80 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
81 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
82 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
83 mysql, postgres, ibase.
86 Summary: Free Pascal IDE (integrated development environment)
87 Summary(pl.UTF-8): Zintegrowane środowisko programistyczne (IDE) Free Pascala
88 Group: Development/Tools
89 Requires: %{name} = %{version}-%{release}
92 Free Pascal IDE (integrated development environment).
94 %description ide -l pl.UTF-8
95 Zintegrowane środowisko programistyczne (IDE) Free Pascala.
98 Summary: Free Pascal Compiler source files
99 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
101 Requires: %{name} = %{version}-%{release}
105 Free Pascal Compiler source files.
107 %description src -l pl.UTF-8
108 Pliki źródłowe kompilatora Free Pascal.
111 Summary: Free Pascal Compiler exaple programs
112 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
114 Requires: %{name} = %{version}-%{release}
116 %description examples
117 Free Pascal Compiler exaple programs.
119 %description examples -l pl.UTF-8
120 Przykładowe programy do kompilatora Free Pascal.
123 Summary: Free Pascal Compiler documentation
124 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
126 # doesn't require base
129 Documentation for fpc in PDF format.
131 %description doc -l pl.UTF-8
132 Dokumentacja do fpc w formacie PDF.
135 %setup -q -n %{name}build-%{version}
146 %define _bver %{version}
152 %define _bver %{version}
154 %define _barch x86_64
157 %define _bver %{version}
164 %define _barch powerpc
167 %define _bver %{version}
169 %define _barch powerpc64
171 %ifarch sparc sparcv9
177 cd %{name}-%{version}.%{_barch}-linux
178 tar xf binary.*-linux.tar
183 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
186 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
189 find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
190 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
192 # remove precompiled objects from fpc-src
193 %{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o}
197 cp -af fpcsrc/* fpc-src
198 rm -r fpc-src/{ide,tests}
201 find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
206 [ -d our-ld ] || install -d our-ld
207 ln -sf %{_bindir}/ld.bfd our-ld/ld
208 export PATH=$(pwd)/our-ld:$PATH
210 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
211 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
212 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
213 DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
214 FPCSRCDIR=`pwd`/fpcsrc
216 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
217 case "%{_build_cpu}" in
218 i386|i486) OPTF="-OG2p1" ;;
219 i586) OPTF="-OG2p2" ;;
220 i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;;
224 %{__make} -C fpcsrc compiler_cycle \
225 OPT="$OPTF %{!?debug:-Xs} -n" \
227 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
228 BININSTALLDIR=%{_bindir} \
229 DATA2INC="$DATA2INC" \
234 %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
236 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
237 BININSTALLDIR=%{_bindir} \
238 %{?with_gdb:GDBLIBDIR=%{_libdir}} \
239 %{!?with_gdb:NOGDB=YES} \
240 DATA2INC="$DATA2INC" \
249 %{?with_ide: ide_clean installer_clean} \
252 utils_all %{?with_ide:ide_all installer_all}
255 export save_size=10000
256 %{__make} -j1 -C fpcdocs \
259 FPCSRCDIR="$FPCSRCDIR" \
264 rm -rf $RPM_BUILD_ROOT
265 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
267 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
269 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
270 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
271 %{__make} -j1 -C fpcsrc \
272 compiler_distinstall \
274 packages_distinstall \
275 %{?with_ide:ide_distinstall} \
280 FPCDIR=%{_libdir}/%{name}/%{version} \
281 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
282 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
283 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
284 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
285 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
286 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
287 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
288 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
289 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
291 %{__make} -j1 -C install/man installman \
292 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
294 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
296 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
298 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
299 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
301 %if "%{_lib}" != "lib"
302 %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
305 # Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
306 %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
309 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1
312 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1
315 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1
317 %ifnarch sparc sparcv9
318 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1
321 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1
325 rm -rf $RPM_BUILD_ROOT
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_bindir}/bin2obj
330 %attr(755,root,root) %{_bindir}/chmcmd
331 %attr(755,root,root) %{_bindir}/chmls
332 %attr(755,root,root) %{_bindir}/cldrparser
333 %attr(755,root,root) %{_bindir}/data2inc
334 %attr(755,root,root) %{_bindir}/delp
335 %attr(755,root,root) %{_bindir}/fd2pascal
336 %attr(755,root,root) %{_bindir}/fpc*
337 %attr(755,root,root) %{_bindir}/fpdoc
338 %attr(755,root,root) %{_bindir}/fppkg
339 %attr(755,root,root) %{_bindir}/fprcp
340 %attr(755,root,root) %{_bindir}/grab_vcsa
341 %attr(755,root,root) %{_bindir}/h2pas
342 %attr(755,root,root) %{_bindir}/h2paspp
343 %attr(755,root,root) %{_bindir}/instantfpc
344 %attr(755,root,root) %{_bindir}/makeskel
345 %attr(755,root,root) %{_bindir}/mkarmins
346 %attr(755,root,root) %{_bindir}/mkinsadd
347 %attr(755,root,root) %{_bindir}/mkx86ins
348 %attr(755,root,root) %{_bindir}/pas2fpm
349 %attr(755,root,root) %{_bindir}/pas2jni
350 %attr(755,root,root) %{_bindir}/pas2ut
351 %attr(755,root,root) %{_bindir}/plex
352 %attr(755,root,root) %{_bindir}/postw32
353 %attr(755,root,root) %{_bindir}/ppc%{_bname}
354 %attr(755,root,root) %{_bindir}/ppdep
355 %attr(755,root,root) %{_bindir}/ppudump
356 %attr(755,root,root) %{_bindir}/ppufiles
357 %attr(755,root,root) %{_bindir}/ppumove
358 %attr(755,root,root) %{_bindir}/ptop
359 %attr(755,root,root) %{_bindir}/pyacc
360 %attr(755,root,root) %{_bindir}/rmcvsdir
361 %attr(755,root,root) %{_bindir}/rstconv
362 %attr(755,root,root) %{_bindir}/unihelper
363 %attr(755,root,root) %{_bindir}/unitdiff
364 # TODO: move the below files to data dir
365 # - JSON resources(?)
366 %{_bindir}/makeskel.rsj
368 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
369 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
370 %dir %{_sysconfdir}/fppkg
371 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
372 %dir %{_libdir}/%{name}
373 %dir %{_libdir}/%{name}/%{version}
374 %dir %{_libdir}/%{name}/lexyacc
375 %{_libdir}/%{name}/%{version}/msg
376 %{_libdir}/%{name}/%{version}/units
377 %{_libdir}/%{name}/%{version}/fpmkinst
378 %{_libdir}/%{name}/lexyacc/*
379 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
380 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
381 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
382 %{_mandir}/man1/bin2obj.1*
383 %{_mandir}/man1/chmcmd.1*
384 %{_mandir}/man1/chmls.1*
385 %{_mandir}/man1/data2inc.1*
386 %{_mandir}/man1/delp.1*
387 %{_mandir}/man1/fd2pascal.1*
388 %{_mandir}/man1/fp.1*
389 %{_mandir}/man1/fpc*.1*
390 %{_mandir}/man1/fpdoc.1*
391 %{_mandir}/man1/fppkg.1*
392 %{_mandir}/man1/fprcp.1*
393 %{_mandir}/man1/grab_vcsa.1*
394 %{_mandir}/man1/h2pas.1*
395 %{_mandir}/man1/h2paspp.1*
396 %{_mandir}/man1/makeskel.1*
397 %{_mandir}/man1/pas2fpm.1*
398 %{_mandir}/man1/pas2jni.1*
399 %{_mandir}/man1/pas2ut.1*
400 %{_mandir}/man1/plex.1*
401 %{_mandir}/man1/postw32.1*
403 %{_mandir}/man1/ppcppc.1*
405 %{_mandir}/man1/ppc%{_bname}.1*
407 %{_mandir}/man1/ppdep.1*
408 %{_mandir}/man1/ppudump.1*
409 %{_mandir}/man1/ppufiles.1*
410 %{_mandir}/man1/ppumove.1*
411 %{_mandir}/man1/ptop.1*
412 %{_mandir}/man1/pyacc.1*
413 %{_mandir}/man1/rmcvsdir.1*
414 %{_mandir}/man1/rstconv.1*
415 %{_mandir}/man1/unitdiff.1*
416 %{_mandir}/man5/fpc.cfg.5*
417 %{_mandir}/man5/fpcmake.5*
418 %{_mandir}/man5/ptop.cfg.5*
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_bindir}/fp
424 # TODO: move the below files to data dir
425 # - ANSI art file used by fp binary
427 # - IDE command templates
429 %{_bindir}/cvsdiff.tdf
432 %{_bindir}/tpgrep.tdf
433 # - Pascal code skeletons
434 %{_bindir}/gplprog.pt
435 %{_bindir}/gplunit.pt
436 %{_bindir}/program.pt
438 %{_libdir}/%{name}/%{version}/ide
442 %defattr(644,root,root,755)
446 %defattr(644,root,root,755)
451 %defattr(644,root,root,755)