2 # - check why it builds all static..
3 # - doesn't build on ppc :/ 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 Patch0: %{name}-skip-dev-dot.patch
28 Patch1: %{name}-makedocs.patch
29 Patch2: %{name}-avoid-RE.patch
30 URL: http://www.freepascal.org/
31 BuildRequires: binutils-static >= 3:2.17.50
32 BuildRequires: gdb-lib
33 BuildRequires: gpm-devel
34 BuildRequires: ncurses-devel
35 %{?with_ide:BuildRequires: readline-static}
36 BuildRequires: rpmbuild(macros) >= 1.213
37 %{?with_doc:BuildRequires: tetex-fonts-jknappen}
38 %{?with_doc:BuildRequires: tetex-format-pdflatex}
39 %{?with_doc:BuildRequires: tetex-makeindex}
40 %{?with_doc:BuildRequires: tetex-metafont}
42 Provides: fpc-bootstrap
43 ExclusiveArch: %{ix86} %{x8664} ppc
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
48 Free Pascal is designed to be, as much as possible, source compatible
49 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
50 attained), but it also enhances these languages with elements like
51 function overloading. And, unlike these ancestors, it supports
54 %description -l pl.UTF-8
55 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
56 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
57 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
58 rozszerza te języki elementami takimi jak przeciążanie funkcji.
60 %description -l ru.UTF-8
61 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
62 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
63 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
64 mysql, postgres, ibase.
66 %description -l uk.UTF-8
67 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
68 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
69 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
70 mysql, postgres, ibase.
73 Summary: Free Pascal Compiler source files
74 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
76 Requires: %{name} = %{version}-%{release}
80 Free Pascal Compiler source files.
82 %description src -l pl.UTF-8
83 Pliki źródłowe kompilatora Free Pascal.
86 Summary: Free Pascal Compiler exaple programs
87 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
89 Requires: %{name} = %{version}-%{release}
92 Free Pascal Compiler exaple programs.
94 %description examples -l pl.UTF-8
95 Przykładowe programy do kompilatora Free Pascal.
98 Summary: Free Pascal Compiler documentation
99 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
101 Requires: %{name} = %{version}-%{release}
104 Documentation for fpc in PDF format.
106 %description doc -l pl.UTF-8
107 Dokumentacja do fpc w formacie PDF.
110 %setup -q -n %{name}build-%{version}
117 %define _bver %{version}
122 %define _bver %{version}
127 %define _bver %{version}
131 tar xf binary.*-linux.tar
135 for i in ../*.tar.gz ; do
138 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
143 cp -af fpcsrc/* fpc-src
145 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
146 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
147 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
149 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
150 case "%{_build_cpu}" in
151 i386) OPTF="-OG2p1" ;;
152 i486) OPTF="-OG2p1" ;;
153 i586) OPTF="-OG2p2" ;;
154 i686) OPTF="-Og2p3" ;;
155 athlon) OPTF="-Og2p3" ;;
159 %{__make} -C fpcsrc compiler_cycle \
162 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
163 BININSTALLDIR=%{_bindir} \
168 %{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
170 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
171 BININSTALLDIR=%{_bindir} \
172 GDBLIBDIR=%{_libdir} \
176 DATA2INC=`pwd`/utils/data2inc \
182 %{?with_ide: ide_clean installer_clean} \
185 utils_all %{?with_ide:installer_all}
187 # %{?with_ide:IDE=YES} \
189 %{__make} -C fpcsrc/ide OPT="$OPTF -Xs -n" \
191 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
192 BININSTALLDIR=%{_bindir} \
193 GDBLIBDIR=%{_libdir} \
197 DATA2INC=`pwd`/utils/data2inc \
203 # %{?with_ide:installer_clean} \
204 # %{?with_ide:installer_all}
207 export save_size=10000
208 %{__make} -C fpcdocs \
215 rm -rf $RPM_BUILD_ROOT
216 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
218 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
220 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
221 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
222 %{__make} -C fpcsrc \
223 compiler_distinstall \
225 packages_distinstall \
226 %{?with_ide:ide_distinstall} \
231 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
232 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
233 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
234 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
235 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
236 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
237 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
238 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
239 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
241 %{__make} -C install/man installman \
242 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
244 ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
246 sh fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
249 rm -rf $RPM_BUILD_ROOT
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/*
254 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
255 %dir %{_libdir}/%{name}
256 %dir %{_libdir}/%{name}/%{version}
257 %dir %{_libdir}/%{name}/lexyacc
258 %{_libdir}/%{name}/%{version}/msg
259 %{_libdir}/%{name}/%{version}/units
261 %{_libdir}/%{name}/%{version}/ide
263 %{_libdir}/%{name}/lexyacc/*
264 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
265 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
269 %defattr(644,root,root,755)
273 %defattr(644,root,root,755)
278 %defattr(644,root,root,755)