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: 89c7e60db6280f3d5cc006a4a9ff43a9
17 Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18 # Source1-md5: 3474affc41d6106c498fc5b79f883588
19 Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20 # Source2-md5: c32c4c8e94aed6f84b34407e7ea84ecd
21 Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar
22 # Source3-md5: 07f891e7552aeb21908940b05c3062a3
23 Patch0: %{name}-skip-dev-dot.patch
24 Patch1: %{name}-link.patch
25 Patch2: %{name}-gdb.patch
26 URL: http://www.freepascal.org/
27 BuildRequires: binutils-static >= 3:2.17.50
28 BuildRequires: gpm-devel
29 BuildRequires: ncurses-devel
30 BuildRequires: rpmbuild(macros) >= 1.213
32 BuildRequires: gdb-lib >= 7.2-7
33 BuildRequires: python-static
34 BuildRequires: readline-static
35 BuildRequires: libselinux-static
36 BuildRequires: libsepol-static
37 BuildRequires: zlib-static
38 BuildRequires: xz-static
41 BuildRequires: tetex-fonts-jknappen
42 BuildRequires: tetex-format-pdflatex
43 BuildRequires: tetex-makeindex
44 BuildRequires: tetex-metafont
45 BuildRequires: texlive-xetex
48 Provides: fpc-bootstrap
49 ExclusiveArch: %{ix86} %{x8664} ppc
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
54 Free Pascal is designed to be, as much as possible, source compatible
55 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
56 attained), but it also enhances these languages with elements like
57 function overloading. And, unlike these ancestors, it supports
60 %description -l pl.UTF-8
61 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
62 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
63 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
64 rozszerza te języki elementami takimi jak przeciążanie funkcji.
66 %description -l ru.UTF-8
67 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
68 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
69 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
70 mysql, postgres, ibase.
72 %description -l uk.UTF-8
73 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
74 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
75 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
76 mysql, postgres, ibase.
79 Summary: Free Pascal Compiler source files
80 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
82 Requires: %{name} = %{version}-%{release}
86 Free Pascal Compiler source files.
88 %description src -l pl.UTF-8
89 Pliki źródłowe kompilatora Free Pascal.
92 Summary: Free Pascal Compiler exaple programs
93 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
95 Requires: %{name} = %{version}-%{release}
98 Free Pascal Compiler exaple programs.
100 %description examples -l pl.UTF-8
101 Przykładowe programy do kompilatora Free Pascal.
104 Summary: Free Pascal Compiler documentation
105 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
107 # doesn't require base
110 Documentation for fpc in PDF format.
112 %description doc -l pl.UTF-8
113 Dokumentacja do fpc w formacie PDF.
116 %setup -q -n %{name}build-%{version}
123 %define _bver %{version}
129 %define _bver %{version}
131 %define _barch x86_64
135 %define _bver %{version}
137 %define _barch powepc
140 cd %{name}-%{version}.%{_barch}-linux
141 tar xf binary.*-linux.tar
146 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
149 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
154 cp -af fpcsrc/* fpc-src
155 rm -r fpc-src/{ide,tests}
159 [ -d our-ld ] || install -d our-ld
160 ln -sf %{_bindir}/ld.bfd our-ld/ld
161 export PATH=$(pwd)/our-ld:$PATH
163 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
164 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
165 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
167 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
168 case "%{_build_cpu}" in
169 i386) OPTF="-OG2p1" ;;
170 i486) OPTF="-OG2p1" ;;
171 i586) OPTF="-OG2p2" ;;
172 i686) OPTF="-Og2p3" ;;
173 athlon) OPTF="-Og2p3" ;;
177 %{__make} -C fpcsrc compiler_cycle \
180 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
181 BININSTALLDIR=%{_bindir} \
186 %{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
188 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
189 BININSTALLDIR=%{_bindir} \
190 GDBLIBDIR=%{_libdir} \
194 DATA2INC=`pwd`/utils/data2inc \
200 %{?with_ide: ide_clean installer_clean} \
203 utils_all %{?with_ide:ide_all installer_all}
206 export save_size=10000
207 %{__make} -j1 -C fpcdocs \
214 rm -rf $RPM_BUILD_ROOT
215 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
217 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
219 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
220 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
221 %{__make} -j1 -C fpcsrc \
222 compiler_distinstall \
224 packages_distinstall \
225 %{?with_ide:ide_distinstall} \
230 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
231 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
232 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
233 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
234 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
235 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
236 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
237 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
238 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
240 %{__make} -j1 -C install/man installman \
241 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
243 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
245 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
247 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
248 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
251 rm -rf $RPM_BUILD_ROOT
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_bindir}/*
256 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
257 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
258 %dir %{_sysconfdir}/fppkg
259 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
260 %dir %{_libdir}/%{name}
261 %dir %{_libdir}/%{name}/%{version}
262 %dir %{_libdir}/%{name}/lexyacc
263 %{_libdir}/%{name}/%{version}/msg
264 %{_libdir}/%{name}/%{version}/units
266 %{_libdir}/%{name}/%{version}/ide
268 %{_libdir}/%{name}/lexyacc/*
269 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
270 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
271 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
275 %defattr(644,root,root,755)
279 %defattr(644,root,root,755)
284 %defattr(644,root,root,755)