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: 403da132aed194fd841d46c3b33b022a
17 Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18 # Source1-md5: 915f799dd58b5429f06a48d4bd84a9c2
19 Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20 # Source2-md5: ffc3cae4a72b60efb6873b9ce5c8a0f2
21 Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar
22 # Source3-md5: 28eb428bfaa8a72e49be05ed0efa0081
23 Patch0: %{name}-skip-dev-dot.patch
24 Patch1: %{name}-link.patch
25 Patch2: %{name}-gdb.patch
26 Patch3: %{name}-r22920.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} ppc
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
57 Free Pascal is designed to be, as much as possible, source compatible
58 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
59 attained), but it also enhances these languages with elements like
60 function overloading. And, unlike these ancestors, it supports
63 %description -l pl.UTF-8
64 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
65 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
66 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
67 rozszerza te języki elementami takimi jak przeciążanie funkcji.
69 %description -l ru.UTF-8
70 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
71 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
72 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
73 mysql, postgres, ibase.
75 %description -l uk.UTF-8
76 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
77 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
78 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
79 mysql, postgres, ibase.
82 Summary: Free Pascal Compiler source files
83 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
85 Requires: %{name} = %{version}-%{release}
89 Free Pascal Compiler source files.
91 %description src -l pl.UTF-8
92 Pliki źródłowe kompilatora Free Pascal.
95 Summary: Free Pascal Compiler exaple programs
96 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
98 Requires: %{name} = %{version}-%{release}
100 %description examples
101 Free Pascal Compiler exaple programs.
103 %description examples -l pl.UTF-8
104 Przykładowe programy do kompilatora Free Pascal.
107 Summary: Free Pascal Compiler documentation
108 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
110 # doesn't require base
113 Documentation for fpc in PDF format.
115 %description doc -l pl.UTF-8
116 Dokumentacja do fpc w formacie PDF.
119 %setup -q -n %{name}build-%{version}
127 %define _bver %{version}
133 %define _bver %{version}
135 %define _barch x86_64
139 %define _bver %{version}
141 %define _barch powepc
144 cd %{name}-%{version}.%{_barch}-linux
145 tar xf binary.*-linux.tar
150 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
153 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
158 cp -af fpcsrc/* fpc-src
159 rm -r fpc-src/{ide,tests}
161 find fpcsrc -name Makefile -o -name fpcmake.ini | \
166 -e 's|/usr/lib/|%{_libdir}/|g'
170 [ -d our-ld ] || install -d our-ld
171 ln -sf %{_bindir}/ld.bfd our-ld/ld
172 export PATH=$(pwd)/our-ld:$PATH
174 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
175 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
176 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
177 DATA2INC=`pwd`/fpcsrc/utils/data2inc
179 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
180 case "%{_build_cpu}" in
181 i386) OPTF="-OG2p1" ;;
182 i486) OPTF="-OG2p1" ;;
183 i586) OPTF="-OG2p2" ;;
184 i686) OPTF="-Og2p3" ;;
185 athlon) OPTF="-Og2p3" ;;
189 %{__make} -C fpcsrc compiler_cycle \
190 OPT="$OPTF %{!?debug:-Xs} -n" \
192 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
193 BININSTALLDIR=%{_bindir} \
194 DATA2INC="$DATA2INC" \
199 %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
201 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
202 BININSTALLDIR=%{_bindir} \
203 GDBLIBDIR=%{_libdir} \
204 DATA2INC="$DATA2INC" \
213 %{?with_ide: ide_clean installer_clean} \
216 utils_all %{?with_ide:ide_all installer_all}
219 export save_size=10000
220 %{__make} -j1 -C fpcdocs \
227 rm -rf $RPM_BUILD_ROOT
228 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
230 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
232 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
233 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
234 %{__make} -j1 -C fpcsrc \
235 compiler_distinstall \
237 packages_distinstall \
238 %{?with_ide:ide_distinstall} \
243 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
244 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
245 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
246 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
247 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
248 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
249 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
250 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
251 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
253 %{__make} -j1 -C install/man installman \
254 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
256 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
258 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
260 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
261 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
264 rm -rf $RPM_BUILD_ROOT
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_bindir}/*
269 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
270 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
271 %dir %{_sysconfdir}/fppkg
272 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
273 %dir %{_libdir}/%{name}
274 %dir %{_libdir}/%{name}/%{version}
275 %dir %{_libdir}/%{name}/lexyacc
276 %{_libdir}/%{name}/%{version}/msg
277 %{_libdir}/%{name}/%{version}/units
279 %{_libdir}/%{name}/%{version}/ide
281 %{_libdir}/%{name}/lexyacc/*
282 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
283 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
284 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
288 %defattr(644,root,root,755)
292 %defattr(644,root,root,755)
297 %defattr(644,root,root,755)