3 %bcond_without ide # build with ide
4 %bcond_without doc # build without doc
6 Summary: 32-bit compiler for the i386 and m68k processors
7 Summary(pl.UTF-8): 32 bitowy kompilator dla procesorów i386 i m68k
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: 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
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
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
44 BuildRequires: tetex-fonts-jknappen
45 BuildRequires: tetex-format-pdflatex
46 BuildRequires: tetex-makeindex
47 BuildRequires: tetex-metafont
48 BuildRequires: texlive-xetex
51 Provides: fpc-bootstrap
52 ExclusiveArch: %{ix86} %{x8664}
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)
59 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
60 Free Pascal is designed to be, as much as possible, source compatible
61 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
62 attained), but it also enhances these languages with elements like
63 function overloading. And, unlike these ancestors, it supports
66 %description -l pl.UTF-8
67 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
68 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
69 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
70 rozszerza te języki elementami takimi jak przeciążanie funkcji.
72 %description -l ru.UTF-8
73 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
74 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
75 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
76 mysql, postgres, ibase.
78 %description -l uk.UTF-8
79 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
80 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
81 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
82 mysql, postgres, ibase.
85 Summary: Free Pascal Compiler source files
86 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
88 Requires: %{name} = %{version}-%{release}
92 Free Pascal Compiler source files.
94 %description src -l pl.UTF-8
95 Pliki źródłowe kompilatora Free Pascal.
98 Summary: Free Pascal Compiler exaple programs
99 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
101 Requires: %{name} = %{version}-%{release}
103 %description examples
104 Free Pascal Compiler exaple programs.
106 %description examples -l pl.UTF-8
107 Przykładowe programy do kompilatora Free Pascal.
110 Summary: Free Pascal Compiler documentation
111 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
113 # doesn't require base
116 Documentation for fpc in PDF format.
118 %description doc -l pl.UTF-8
119 Dokumentacja do fpc w formacie PDF.
122 %setup -q -n %{name}build-%{version}
132 %define _bver %{version}
138 %define _bver %{version}
140 %define _barch x86_64
143 %define _bver %{version}
150 %define _barch powerpc
153 %define _bver %{version}
155 %define _barch powerpc64
157 %ifarch sparc sparcv9
163 cd %{name}-%{version}.%{_barch}-linux
164 tar xf binary.*-linux.tar
169 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
172 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
175 find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
176 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
178 # remove precompiled objects from fpc-src
179 %{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o}
183 cp -af fpcsrc/* fpc-src
184 rm -r fpc-src/{ide,tests}
187 find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
192 [ -d our-ld ] || install -d our-ld
193 ln -sf %{_bindir}/ld.bfd our-ld/ld
194 export PATH=$(pwd)/our-ld:$PATH
196 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
197 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
198 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
199 DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
201 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
202 case "%{_build_cpu}" in
203 i386|i486) OPTF="-OG2p1" ;;
204 i586) OPTF="-OG2p2" ;;
205 i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;;
209 %{__make} -C fpcsrc compiler_cycle \
210 OPT="$OPTF %{!?debug:-Xs} -n" \
212 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
213 BININSTALLDIR=%{_bindir} \
214 DATA2INC="$DATA2INC" \
219 %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
221 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
222 BININSTALLDIR=%{_bindir} \
223 GDBLIBDIR=%{_libdir} \
224 DATA2INC="$DATA2INC" \
233 %{?with_ide: ide_clean installer_clean} \
236 utils_all %{?with_ide:ide_all installer_all}
239 export save_size=10000
240 %{__make} -j1 -C fpcdocs \
247 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
250 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
252 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
253 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
254 %{__make} -j1 -C fpcsrc \
255 compiler_distinstall \
257 packages_distinstall \
258 %{?with_ide:ide_distinstall} \
263 FPCDIR=%{_libdir}/%{name}/%{version} \
264 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
265 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
266 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
267 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
268 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
269 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
270 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
271 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
272 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
274 %{__make} -j1 -C install/man installman \
275 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
277 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
279 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
281 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
282 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
284 %if "%{_lib}" != "lib"
285 %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
288 # Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
289 %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
292 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1
295 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1
298 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1
300 %ifnarch sparc sparcv9
301 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1
304 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1
308 rm -rf $RPM_BUILD_ROOT
311 %defattr(644,root,root,755)
312 %attr(755,root,root) %{_bindir}/bin2obj
313 %attr(755,root,root) %{_bindir}/chmcmd
314 %attr(755,root,root) %{_bindir}/chmls
315 %attr(755,root,root) %{_bindir}/cldrparser
316 %attr(755,root,root) %{_bindir}/data2inc
317 %attr(755,root,root) %{_bindir}/delp
318 %attr(755,root,root) %{_bindir}/fd2pascal
319 %attr(755,root,root) %{_bindir}/fp
320 %attr(755,root,root) %{_bindir}/fpc*
321 %attr(755,root,root) %{_bindir}/fpdoc
322 %attr(755,root,root) %{_bindir}/fppkg
323 %attr(755,root,root) %{_bindir}/fprcp
324 %attr(755,root,root) %{_bindir}/grab_vcsa
325 %attr(755,root,root) %{_bindir}/h2pas
326 %attr(755,root,root) %{_bindir}/h2paspp
327 %attr(755,root,root) %{_bindir}/instantfpc
328 %attr(755,root,root) %{_bindir}/makeskel
329 %attr(755,root,root) %{_bindir}/mkarmins
330 %attr(755,root,root) %{_bindir}/mkinsadd
331 %attr(755,root,root) %{_bindir}/mkx86ins
332 %attr(755,root,root) %{_bindir}/pas2fpm
333 %attr(755,root,root) %{_bindir}/pas2jni
334 %attr(755,root,root) %{_bindir}/pas2ut
335 %attr(755,root,root) %{_bindir}/plex
336 %attr(755,root,root) %{_bindir}/postw32
337 %attr(755,root,root) %{_bindir}/ppc%{_bname}
338 %attr(755,root,root) %{_bindir}/ppdep
339 %attr(755,root,root) %{_bindir}/ppudump
340 %attr(755,root,root) %{_bindir}/ppufiles
341 %attr(755,root,root) %{_bindir}/ppumove
342 %attr(755,root,root) %{_bindir}/ptop
343 %attr(755,root,root) %{_bindir}/pyacc
344 %attr(755,root,root) %{_bindir}/rmcvsdir
345 %attr(755,root,root) %{_bindir}/rstconv
346 %attr(755,root,root) %{_bindir}/unihelper
347 %attr(755,root,root) %{_bindir}/unitdiff
348 # TODO: move the below files to datadir
349 # - ANSI art file used by fp binary
351 # - IDE command templates
353 %{_bindir}/cvsdiff.tdf
356 %{_bindir}/tpgrep.tdf
357 # - Pascal code skeletons
358 %{_bindir}/gplprog.pt
359 %{_bindir}/gplunit.pt
360 %{_bindir}/program.pt
362 # - JSON resources(?)
363 %{_bindir}/makeskel.rsj
365 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
366 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
367 %dir %{_sysconfdir}/fppkg
368 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
369 %dir %{_libdir}/%{name}
370 %dir %{_libdir}/%{name}/%{version}
371 %dir %{_libdir}/%{name}/lexyacc
372 %{_libdir}/%{name}/%{version}/msg
373 %{_libdir}/%{name}/%{version}/units
374 %{_libdir}/%{name}/%{version}/fpmkinst
376 %{_libdir}/%{name}/%{version}/ide
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*
421 %defattr(644,root,root,755)
425 %defattr(644,root,root,755)
430 %defattr(644,root,root,755)