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 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: expat-devel
34 BuildRequires: gdb-lib >= 7.2-7
35 BuildRequires: python-devel
36 BuildRequires: readline-devel
37 BuildRequires: libselinux-devel
38 BuildRequires: xz-devel
39 BuildRequires: zlib-devel
42 BuildRequires: tetex-fonts-jknappen
43 BuildRequires: tetex-format-pdflatex
44 BuildRequires: tetex-makeindex
45 BuildRequires: tetex-metafont
46 BuildRequires: texlive-xetex
49 Provides: fpc-bootstrap
50 ExclusiveArch: %{ix86} %{x8664} ppc
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
55 Free Pascal is designed to be, as much as possible, source compatible
56 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
57 attained), but it also enhances these languages with elements like
58 function overloading. And, unlike these ancestors, it supports
61 %description -l pl.UTF-8
62 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
63 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
64 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
65 rozszerza te języki elementami takimi jak przeciążanie funkcji.
67 %description -l ru.UTF-8
68 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
69 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
70 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
71 mysql, postgres, ibase.
73 %description -l uk.UTF-8
74 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
75 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
76 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
77 mysql, postgres, ibase.
80 Summary: Free Pascal Compiler source files
81 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
83 Requires: %{name} = %{version}-%{release}
87 Free Pascal Compiler source files.
89 %description src -l pl.UTF-8
90 Pliki źródłowe kompilatora Free Pascal.
93 Summary: Free Pascal Compiler exaple programs
94 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
96 Requires: %{name} = %{version}-%{release}
99 Free Pascal Compiler exaple programs.
101 %description examples -l pl.UTF-8
102 Przykładowe programy do kompilatora Free Pascal.
105 Summary: Free Pascal Compiler documentation
106 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
108 # doesn't require base
111 Documentation for fpc in PDF format.
113 %description doc -l pl.UTF-8
114 Dokumentacja do fpc w formacie PDF.
117 %setup -q -n %{name}build-%{version}
125 %define _bver %{version}
131 %define _bver %{version}
133 %define _barch x86_64
137 %define _bver %{version}
139 %define _barch powepc
142 cd %{name}-%{version}.%{_barch}-linux
143 tar xf binary.*-linux.tar
148 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
151 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
156 cp -af fpcsrc/* fpc-src
157 rm -r fpc-src/{ide,tests}
160 find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
165 [ -d our-ld ] || install -d our-ld
166 ln -sf %{_bindir}/ld.bfd our-ld/ld
167 export PATH=$(pwd)/our-ld:$PATH
169 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
170 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
171 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
173 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
174 case "%{_build_cpu}" in
175 i386) OPTF="-OG2p1" ;;
176 i486) OPTF="-OG2p1" ;;
177 i586) OPTF="-OG2p2" ;;
178 i686) OPTF="-Og2p3" ;;
179 athlon) OPTF="-Og2p3" ;;
183 %{__make} -C fpcsrc compiler_cycle \
184 OPT="$OPTF %{!?debug:-Xs} -n" \
186 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
187 BININSTALLDIR=%{_bindir} \
192 %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
194 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
195 BININSTALLDIR=%{_bindir} \
196 GDBLIBDIR=%{_libdir} \
200 DATA2INC=`pwd`/utils/data2inc \
206 %{?with_ide: ide_clean installer_clean} \
209 utils_all %{?with_ide:ide_all installer_all}
212 export save_size=10000
213 %{__make} -j1 -C fpcdocs \
220 rm -rf $RPM_BUILD_ROOT
221 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
223 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
225 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
226 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
227 %{__make} -j1 -C fpcsrc \
228 compiler_distinstall \
230 packages_distinstall \
231 %{?with_ide:ide_distinstall} \
236 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
237 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
238 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
239 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
240 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
241 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
242 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
243 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
244 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
246 %{__make} -j1 -C install/man installman \
247 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
249 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
251 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
253 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
254 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
257 rm -rf $RPM_BUILD_ROOT
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_bindir}/*
262 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
263 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
264 %dir %{_sysconfdir}/fppkg
265 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
266 %dir %{_libdir}/%{name}
267 %dir %{_libdir}/%{name}/%{version}
268 %dir %{_libdir}/%{name}/lexyacc
269 %{_libdir}/%{name}/%{version}/msg
270 %{_libdir}/%{name}/%{version}/units
272 %{_libdir}/%{name}/%{version}/ide
274 %{_libdir}/%{name}/lexyacc/*
275 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
276 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
277 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
281 %defattr(644,root,root,755)
285 %defattr(644,root,root,755)
290 %defattr(644,root,root,755)