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: bb7d17ef5c7c007466368262c0779cb7
17 Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18 # Source1-md5: 41e0bcb7c11b7edf311142079ba2defa
19 Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20 # Source2-md5: db2ae45b0d1846e01b61ba52f03e60b2
21 Patch0: %{name}-skip-dev-dot.patch
22 Patch1: %{name}-link.patch
23 Patch2: %{name}-gdb.patch
24 Patch3: fpc-r32374.patch
25 Patch4: fpcdocs-r1260.patch
26 URL: http://www.freepascal.org/
27 BuildRequires: binutils-devel >= 3:2.17.50
28 BuildRequires: gpm-devel
29 BuildRequires: ncurses-devel
30 BuildRequires: rpmbuild(macros) >= 1.213
32 BuildRequires: babeltrace-devel
33 BuildRequires: expat-devel
34 BuildRequires: gdb-lib >= 7.2-7
35 BuildRequires: guile-devel
36 BuildRequires: python-devel
37 BuildRequires: readline-devel
38 BuildRequires: libselinux-devel
39 BuildRequires: xz-devel
40 BuildRequires: zlib-devel
43 BuildRequires: tetex-fonts-jknappen
44 BuildRequires: tetex-format-pdflatex
45 BuildRequires: tetex-makeindex
46 BuildRequires: tetex-metafont
47 BuildRequires: texlive-xetex
50 Provides: fpc-bootstrap
51 ExclusiveArch: %{ix86} %{x8664}
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
56 Free Pascal is designed to be, as much as possible, source compatible
57 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
58 attained), but it also enhances these languages with elements like
59 function overloading. And, unlike these ancestors, it supports
62 %description -l pl.UTF-8
63 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
64 Free Pascal został zaprojektowany by być (jak tylko to możliwe)
65 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
66 rozszerza te języki elementami takimi jak przeciążanie funkcji.
68 %description -l ru.UTF-8
69 FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
70 Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
71 (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
72 mysql, postgres, ibase.
74 %description -l uk.UTF-8
75 FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
76 Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
77 (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
78 mysql, postgres, ibase.
81 Summary: Free Pascal Compiler source files
82 Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
84 Requires: %{name} = %{version}-%{release}
88 Free Pascal Compiler source files.
90 %description src -l pl.UTF-8
91 Pliki źródłowe kompilatora Free Pascal.
94 Summary: Free Pascal Compiler exaple programs
95 Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
97 Requires: %{name} = %{version}-%{release}
100 Free Pascal Compiler exaple programs.
102 %description examples -l pl.UTF-8
103 Przykładowe programy do kompilatora Free Pascal.
106 Summary: Free Pascal Compiler documentation
107 Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
109 # doesn't require base
112 Documentation for fpc in PDF format.
114 %description doc -l pl.UTF-8
115 Dokumentacja do fpc w formacie PDF.
118 %setup -q -n %{name}build-%{version}
127 %define _bver %{version}
133 %define _bver %{version}
135 %define _barch x86_64
138 cd %{name}-%{version}.%{_barch}-linux
139 tar xf binary.*-linux.tar
144 for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
147 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
150 find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
151 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
155 cp -af fpcsrc/* fpc-src
156 rm -r fpc-src/{ide,tests}
159 find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
164 [ -d our-ld ] || install -d our-ld
165 ln -sf %{_bindir}/ld.bfd our-ld/ld
166 export PATH=$(pwd)/our-ld:$PATH
168 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
169 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
170 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
171 DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
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} \
188 DATA2INC="$DATA2INC" \
193 %{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
195 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
196 BININSTALLDIR=%{_bindir} \
197 GDBLIBDIR=%{_libdir} \
198 DATA2INC="$DATA2INC" \
207 %{?with_ide: ide_clean installer_clean} \
210 utils_all %{?with_ide:ide_all installer_all}
213 export save_size=10000
214 %{__make} -j1 -C fpcdocs \
221 rm -rf $RPM_BUILD_ROOT
222 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
224 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
226 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
227 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
228 %{__make} -j1 -C fpcsrc \
229 compiler_distinstall \
231 packages_distinstall \
232 %{?with_ide:ide_distinstall} \
237 FPCDIR=%{_libdir}/%{name}/%{version} \
238 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
239 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
240 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
241 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
242 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
243 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
244 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
245 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
246 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
248 %{__make} -j1 -C install/man installman \
249 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
251 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
253 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
255 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
256 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
258 %if "%{_lib}" != "lib"
259 %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
262 # Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
263 %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
266 rm -rf $RPM_BUILD_ROOT
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/*
271 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
272 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
273 %dir %{_sysconfdir}/fppkg
274 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
275 %dir %{_libdir}/%{name}
276 %dir %{_libdir}/%{name}/%{version}
277 %dir %{_libdir}/%{name}/lexyacc
278 %{_libdir}/%{name}/%{version}/msg
279 %{_libdir}/%{name}/%{version}/units
280 %{_libdir}/%{name}/%{version}/fpmkinst
282 %{_libdir}/%{name}/%{version}/ide
284 %{_libdir}/%{name}/lexyacc/*
285 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
286 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
287 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
291 %defattr(644,root,root,755)
295 %defattr(644,root,root,755)
300 %defattr(644,root,root,755)