2 # - check why it builds all static..
3 # - doesn't build on ppc/sparc :/ hgw why - drop this ?
7 %bcond_with ide # build with ide
8 %bcond_without doc # build without doc
10 Summary: 32-bit compiler for the i386 and m68k processors
11 Summary(pl.UTF-8): 32 bitowy kompilator dla procesorów i386 i m68k
12 Summary(ru.UTF-8): Свободный компилятор Pascal
13 Summary(uk.UTF-8): Вільний компілятор Pascal
18 Group: Development/Languages
19 Source0: ftp://ftp.freepascal.org/fpc/dist/source-%{version}/%{name}build-%{version}.tar.gz
20 # Source0-md5: ec3d463ec9859da4122e9edfa2ab992d
21 Source1: ftp://ftp.freepascal.org/fpc/dist/i386-linux-%{version}/%{name}-%{version}.i386-linux.tar
22 # Source1-md5: ee7ddbf3ad50f6c6f237439e3ecd83d6
23 Source2: ftp://ftp.freepascal.org/fpc/dist/x86_64-linux-%{version}/%{name}-%{version}.x86_64-linux.tar
24 # Source2-md5: 9671bb9f89fd64fd8db4de6c76393c62
25 Source3: ftp://ftp.freepascal.org/fpc/dist/powerpc-linux-%{version}/%{name}-%{version}.powerpc-linux.tar
26 # Source3-md5: e83013af5e6fd8272c6d26b41234f288
27 # no 2.0.4 binary for sparc, 2.0.0 only
28 #Source4: ftp://ftp.freepascal.org/fpc/dist/sparc-linux-2.0.0/%{name}-2.0.0.sparc-linux.tar
29 #ftp://ftp.freepascal.org/fpc/dist/sparc-linux-2.2.2/deb/fpc_2.2.2-0.tar.gz
30 # Source4-md5: dd8925ce8ce93309456c3072e6e4d14d
31 Patch0: %{name}-skip-dev-dot.patch
32 Patch1: %{name}-makedocs.patch
33 Patch2: %{name}-avoid-RE.patch
34 URL: http://www.freepascal.org/
35 BuildRequires: binutils-static >= 3:2.17.50
36 BuildRequires: gdb-lib
37 BuildRequires: gpm-devel
38 BuildRequires: ncurses-devel
39 %{?with_ide:BuildRequires: readline-static}
40 BuildRequires: rpmbuild(macros) >= 1.213
41 %{?with_doc:BuildRequires: tetex-fonts-jknappen}
42 %{?with_doc:BuildRequires: tetex-format-pdflatex}
43 %{?with_doc:BuildRequires: tetex-makeindex}
44 %{?with_doc:BuildRequires: tetex-metafont}
46 Provides: fpc-bootstrap
47 ExclusiveArch: %{ix86} %{x8664} ppc sparc
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
52 Free Pascal is designed to be, as much as possible, source compatible
53 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
54 attained), but it also enhances these languages with elements like
55 function overloading. And, unlike these ancestors, it supports
58 %description -l pl.UTF-8
59 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
60 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
61 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
62 rozszerza te języki elementami takimi jak przeciążanie funkcji.
64 %description -l ru.UTF-8
65 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
66 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
67 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
68 mysql, postgres, ibase.
70 %description -l uk.UTF-8
71 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
72 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
73 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
74 mysql, postgres, ibase.
77 Summary: Free Pascal Compiler source files
78 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
80 Requires: %{name} = %{version}-%{release}
84 Free Pascal Compiler source files.
86 %description src -l pl.UTF-8
87 Pliki źródłowe kompilatora Free Pascal.
90 Summary: Free Pascal Compiler exaple programs
91 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
93 Requires: %{name} = %{version}-%{release}
96 Free Pascal Compiler exaple programs.
98 %description examples -l pl.UTF-8
99 Przykładowe programy do kompilatora Free Pascal.
102 Summary: Free Pascal Compiler documentation
103 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
105 Requires: %{name} = %{version}-%{release}
108 Documentation for fpc in PDF format.
110 %description doc -l pl.UTF-8
111 Dokumentacja do fpc w formacie PDF.
114 %setup -q -n %{name}build-%{version}
121 %define _bver %{version}
126 %define _bver %{version}
131 %define _bver %{version}
140 tar xf binary.*-linux.tar
144 for i in ../*.tar.gz ; do
147 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
152 cp -af fpcsrc/* fpc-src
154 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
155 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
156 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
158 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
159 case "%{_build_cpu}" in
160 i386) OPTF="-OG2p1" ;;
161 i486) OPTF="-OG2p1" ;;
162 i586) OPTF="-OG2p2" ;;
163 i686) OPTF="-Og2p3" ;;
164 athlon) OPTF="-Og2p3" ;;
168 %{__make} -C fpcsrc compiler_cycle \
171 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
172 BININSTALLDIR=%{_bindir} \
177 %{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
179 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
180 BININSTALLDIR=%{_bindir} \
181 GDBLIBDIR=%{_libdir} \
185 DATA2INC=`pwd`/utils/data2inc \
191 %{?with_ide: ide_clean installer_clean} \
194 utils_all %{?with_ide:installer_all}
196 # %{?with_ide:IDE=YES} \
198 %{__make} -C fpcsrc/ide OPT="$OPTF -Xs -n" \
200 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
201 BININSTALLDIR=%{_bindir} \
202 GDBLIBDIR=%{_libdir} \
206 DATA2INC=`pwd`/utils/data2inc \
212 # %{?with_ide:installer_clean} \
213 # %{?with_ide:installer_all}
216 export save_size=10000
217 %{__make} -C fpcdocs \
224 rm -rf $RPM_BUILD_ROOT
225 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
227 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
229 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
230 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
231 %{__make} -C fpcsrc \
232 compiler_distinstall \
234 packages_distinstall \
235 %{?with_ide:ide_distinstall} \
240 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
241 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
242 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
243 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
244 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
245 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
246 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
247 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
248 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
250 %{__make} -C install/man installman \
251 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
253 ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
255 sh fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
258 rm -rf $RPM_BUILD_ROOT
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/*
263 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
264 %dir %{_libdir}/%{name}
265 %dir %{_libdir}/%{name}/%{version}
266 %dir %{_libdir}/%{name}/lexyacc
267 %{_libdir}/%{name}/%{version}/msg
268 %{_libdir}/%{name}/%{version}/units
270 %{_libdir}/%{name}/%{version}/ide
272 %{_libdir}/%{name}/lexyacc/*
273 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
274 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
278 %defattr(644,root,root,755)
282 %defattr(644,root,root,755)
287 %defattr(644,root,root,755)