]> git.pld-linux.org Git - packages/fpc.git/blame_incremental - fpc.spec
- fixes from fedora, rel 2
[packages/fpc.git] / fpc.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with gdb # GDB support in FPC IDE
4%bcond_without doc # documentation
5
6Summary: Free Pascal - 32-bit Pascal compiler
7Summary(pl.UTF-8): Free Pascal - 32-bitowy kompilator języka Pascal
8Summary(ru.UTF-8): Свободный компилятор Pascal
9Summary(uk.UTF-8): Вільний компілятор Pascal
10Name: fpc
11Version: 3.2.2
12Release: 2
13License: GPL v2+
14Group: Development/Languages
15Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
16# Source0-md5: 3681ae4a208be4f64ec65e832a9a702d
17Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18# Source1-md5: 18354e51309a34b0efe7702633568a1e
19Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20# Source2-md5: 0186779de0c9caee073fc1394afbee56
21Patch0: %{name}-skip-dev-dot.patch
22Patch1: %{name}-link.patch
23Patch2: glibc-2.34.patch
24Patch3: dwarf-debug.patch
25Patch4: fpcdocs-r1260.patch
26Patch5: fpc-man.patch
27URL: http://www.freepascal.org/
28BuildRequires: babeltrace-devel
29BuildRequires: binutils-devel >= 3:2.17.50
30BuildRequires: expat-devel
31BuildRequires: gpm-devel
32BuildRequires: guile-devel
33BuildRequires: libselinux-devel
34BuildRequires: ncurses-devel
35BuildRequires: readline-devel
36BuildRequires: rpmbuild(macros) >= 1.213
37BuildRequires: xz-devel
38BuildRequires: zlib-devel
39%if %{with gdb}
40BuildRequires: gdb-lib >= 7.2-7}
41BuildRequires: python-devel
42%endif
43%if %{with doc}
44BuildRequires: tetex-fonts-jknappen
45BuildRequires: tetex-format-pdflatex
46BuildRequires: tetex-latex-imakeidx
47BuildRequires: tetex-makeindex
48BuildRequires: tetex-metafont
49BuildRequires: texlive-latex-enumitem
50BuildRequires: texlive-latex-ucs
51BuildRequires: texlive-tex-xkeyval
52BuildRequires: texlive-xetex
53%endif
54Requires: binutils
55Provides: fpc-bootstrap
56ExclusiveArch: %{ix86} %{x8664}
57# TODO:
58# %{arm} ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/arm-linux/fpc-3.0.0.arm-linux-raspberry1wq.tar
59# ppc64 ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/powerpc64-linux/fpc-3.0.0.powerpc64-linux.tar
60BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62%description
63Free Pascal is a 32-bit Pascal compiler. Free Pascal is designed to
64be, as much as possible, source compatible with Turbo Pascal 7.0 and
65Delphi 4 (although this goal is not yet attained), but it also
66enhances these languages with elements like function overloading. And,
67unlike these ancestors, it supports multiple platforms.
68
69%description -l pl.UTF-8
70Free Pascal to 32-bitowy kompilator języka Pascal. Free Pascal został
71zaprojektowany by być (na ile to tylko możliwe) kompatybilnym z Turbo
72Pascalem 7.0 oraz Delphi 4. Free Pascal również rozszerza te języki
73elementami takimi jak przeciążanie funkcji.
74
75%description -l ru.UTF-8
76FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
77Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
78(библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
79mysql, postgres, ibase.
80
81%description -l uk.UTF-8
82FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
83Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
84(бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
85mysql, postgres, ibase.
86
87%package ide
88Summary: Free Pascal IDE (integrated development environment)
89Summary(pl.UTF-8): Zintegrowane środowisko programistyczne (IDE) Free Pascala
90Group: Development/Tools
91Requires: %{name} = %{version}-%{release}
92
93%description ide
94Free Pascal IDE (integrated development environment).
95
96%description ide -l pl.UTF-8
97Zintegrowane środowisko programistyczne (IDE) Free Pascala.
98
99%package src
100Summary: Free Pascal Compiler source files
101Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
102Group: Development
103Requires: %{name} = %{version}-%{release}
104Provides: fpcsrc
105
106%description src
107Free Pascal Compiler source files.
108
109%description src -l pl.UTF-8
110Pliki źródłowe kompilatora Free Pascal.
111
112%package examples
113Summary: Free Pascal Compiler exaple programs
114Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
115Group: Documentation
116Requires: %{name} = %{version}-%{release}
117
118%description examples
119Free Pascal Compiler exaple programs.
120
121%description examples -l pl.UTF-8
122Przykładowe programy do kompilatora Free Pascal.
123
124%package doc
125Summary: Free Pascal Compiler documentation
126Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
127Group: Documentation
128# doesn't require base
129
130%description doc
131Documentation for fpc in PDF format.
132
133%description doc -l pl.UTF-8
134Dokumentacja do fpc w formacie PDF.
135
136%prep
137%setup -q -n %{name}build-%{version}
138%patch0 -p1
139%patch1 -p1
140cd fpcsrc
141%patch2 -p1
142%patch3 -p0
143cd ..
144%patch4 -p0
145%patch5 -p1
146
147%ifarch %{ix86}
148tar xf %{SOURCE1}
149%define _bver %{version}
150%define _bname 386
151%define _barch i386
152%endif
153%ifarch %{x8664}
154tar xf %{SOURCE2}
155%define _bver %{version}
156%define _bname x64
157%define _barch x86_64
158%endif
159%ifarch %{arm}
160%define _bver %{version}
161%define _bname arm
162%define _barch arm
163%endif
164%ifarch ppc
165%define _bver ?
166%define _bname ppc
167%define _barch powerpc
168%endif
169%ifarch ppc64
170%define _bver %{version}
171%define _bname ppc64
172%define _barch powerpc64
173%endif
174%ifarch sparc sparcv9
175%define _bver ?
176%define _bname sparc
177%define _barch sparc
178%endif
179
180cd %{name}-%{version}.%{_barch}-linux
181tar xf binary.*-linux.tar
182cd ..
183
184mkdir bin
185cd bin
186for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
187 tar xzf $i
188done
189ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
190cd ..
191
192find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
193 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
194
195# remove precompiled objects from fpc-src
196%{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o}
197
198# save for fpc-src
199install -d fpc-src
200cp -af fpcsrc/* fpc-src
201rm -r fpc-src/tests
202
203%if 0%{?debug:1}
204find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
205%endif
206
207%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\1,' \
208 fpc-src/packages/fpmkunit/examples/ppu2fpmake.sh \
209 fpc-src/packages/gdbint/gen-gdblib-inc.sh \
210 fpc-src/packages/gtk2/src/gtk2x11/scripts/gdkx11_h2pas.sh \
211 fpc-src/rtl/unix/scripts/check_consts.sh \
212 fpc-src/rtl/unix/scripts/check_errno.sh \
213 fpc-src/rtl/unix/scripts/check_errnostr.sh \
214 fpc-src/rtl/unix/scripts/check_sys.sh
215
216%build
217PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
218NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
219NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
220DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
221FPCSRCDIR=`pwd`/fpcsrc
222
223# DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
224case "%{_build_cpu}" in
225 i386|i486) OPTF="-OG2p1" ;;
226 i586) OPTF="-OG2p2" ;;
227 i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;;
228 *) OPTF="-O2" ;;
229esac
230
231%{__make} -C fpcsrc compiler_cycle \
232 OPT="$OPTF -k--build-id -gl -gw %{!?debug:-Xs} -n" \
233 RELEASE="1" \
234 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
235 BININSTALLDIR=%{_bindir} \
236 DATA2INC="$DATA2INC" \
237 PP="$PP" \
238 FPC="$PP" \
239 LINKSMART=YES
240
241%{__make} -C fpcsrc \
242 OPT="$OPTF -k--build-id -gl -gw %{!?debug:-Xs} -n" \
243 RELEASE="1" \
244 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
245 BININSTALLDIR=%{_bindir} \
246 %{?with_gdb:GDBLIBDIR=%{_libdir}} \
247 %{!?with_gdb:NOGDB=YES} \
248 DATA2INC="$DATA2INC" \
249 PP="$NEWPP" \
250 FPC="$NEWPP" \
251 FPDOC=$NEWFPDOC \
252 LINKSMART=YES \
253 NODOCS=YES \
254 rtl_clean \
255 packages_clean \
256 utils_clean \
257 installer_clean \
258 rtl_all \
259 packages_all \
260 utils_all \
261 installer_all
262
263%if %{with doc}
264export save_size=10000
265%{__make} -j1 -C fpcdocs \
266 FPDOC=$NEWFPDOC \
267 FPC="$NEWPP" \
268 FPCSRCDIR="$FPCSRCDIR" \
269 pdf
270%endif
271
272%install
273rm -rf $RPM_BUILD_ROOT
274install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
275
276cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
277
278NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
279FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
280%{__make} -j1 -C fpcsrc \
281 compiler_distinstall \
282 rtl_distinstall \
283 packages_distinstall \
284 utils_distinstall \
285 PP="$NEWPP" \
286 FPCMAKE="$FPCMAKE" \
287 SMARTLINK=YES \
288 FPCDIR=%{_libdir}/%{name}/%{version} \
289 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
290 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
291 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
292 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
293 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
294 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
295 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
296 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
297 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
298
299%{__make} -j1 -C install/man installman \
300 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
301
302ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
303
304sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
305%{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
306
307%if "%{_lib}" != "lib"
308%{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
309%endif
310
311# Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
312%{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
313
314%ifnarch %{ix86}
315%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1
316%endif
317%ifnarch %{arm}
318%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1
319%endif
320%ifnarch ppc ppc64
321%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1
322%endif
323%ifnarch sparc sparcv9
324%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1
325%endif
326%ifnarch %{x8664}
327%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1
328%endif
329
330%clean
331rm -rf $RPM_BUILD_ROOT
332
333%files
334%defattr(644,root,root,755)
335%attr(755,root,root) %{_bindir}/bin2obj
336%attr(755,root,root) %{_bindir}/chmcmd
337%attr(755,root,root) %{_bindir}/chmls
338%attr(755,root,root) %{_bindir}/cldrparser
339%attr(755,root,root) %{_bindir}/compileserver
340%attr(755,root,root) %{_bindir}/data2inc
341%attr(755,root,root) %{_bindir}/delp
342%attr(755,root,root) %{_bindir}/fd2pascal
343%attr(755,root,root) %{_bindir}/fpc*
344%attr(755,root,root) %{_bindir}/fpdoc
345%attr(755,root,root) %{_bindir}/fppkg
346%attr(755,root,root) %{_bindir}/fprcp
347%attr(755,root,root) %{_bindir}/grab_vcsa
348%attr(755,root,root) %{_bindir}/h2pas
349%attr(755,root,root) %{_bindir}/h2paspp
350%attr(755,root,root) %{_bindir}/instantfpc
351%attr(755,root,root) %{_bindir}/json2pas
352%attr(755,root,root) %{_bindir}/makeskel
353%attr(755,root,root) %{_bindir}/mka64ins
354%attr(755,root,root) %{_bindir}/mkarmins
355%attr(755,root,root) %{_bindir}/mkinsadd
356%attr(755,root,root) %{_bindir}/mkx86ins
357%attr(755,root,root) %{_bindir}/pas2fpm
358%attr(755,root,root) %{_bindir}/pas2jni
359%attr(755,root,root) %{_bindir}/pas2js
360%attr(755,root,root) %{_bindir}/pas2ut
361%attr(755,root,root) %{_bindir}/plex
362%attr(755,root,root) %{_bindir}/postw32
363%attr(755,root,root) %{_bindir}/ppc%{_bname}
364%attr(755,root,root) %{_bindir}/ppdep
365%attr(755,root,root) %{_bindir}/ppudump
366%attr(755,root,root) %{_bindir}/ppufiles
367%attr(755,root,root) %{_bindir}/ppumove
368%attr(755,root,root) %{_bindir}/ptop
369%attr(755,root,root) %{_bindir}/pyacc
370%attr(755,root,root) %{_bindir}/rmcvsdir
371%attr(755,root,root) %{_bindir}/rstconv
372%attr(755,root,root) %{_bindir}/unihelper
373%attr(755,root,root) %{_bindir}/unitdiff
374%attr(755,root,root) %{_bindir}/webidl2pas
375# TODO: move the below files to data dir
376# - JSON resources(?)
377%{_bindir}/makeskel.rsj
378%{_bindir}/ptop.rsj
379%{_bindir}/pas2ut.rsj
380%{_bindir}/rstconv.rsj
381%{_bindir}/unitdiff.rsj
382%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
383%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
384%dir %{_sysconfdir}/fppkg
385%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
386%dir %{_libdir}/%{name}
387%dir %{_libdir}/%{name}/%{version}
388%dir %{_libdir}/%{name}/lexyacc
389%{_libdir}/%{name}/%{version}/msg
390%{_libdir}/%{name}/%{version}/units
391%{_libdir}/%{name}/%{version}/fpmkinst
392%{_libdir}/%{name}/lexyacc/*
393%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
394%attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
395%attr(755,root,root) %{_libdir}/libpas2jslib.so
396%{_mandir}/man1/bin2obj.1*
397%{_mandir}/man1/chmcmd.1*
398%{_mandir}/man1/chmls.1*
399%{_mandir}/man1/data2inc.1*
400%{_mandir}/man1/delp.1*
401%{_mandir}/man1/fd2pascal.1*
402%{_mandir}/man1/fp.1*
403%{_mandir}/man1/fpc*.1*
404%{_mandir}/man1/fpdoc.1*
405%{_mandir}/man1/fppkg.1*
406%{_mandir}/man1/fprcp.1*
407%{_mandir}/man1/grab_vcsa.1*
408%{_mandir}/man1/h2pas.1*
409%{_mandir}/man1/h2paspp.1*
410%{_mandir}/man1/makeskel.1*
411%{_mandir}/man1/pas2fpm.1*
412%{_mandir}/man1/pas2jni.1*
413%{_mandir}/man1/pas2ut.1*
414%{_mandir}/man1/plex.1*
415%{_mandir}/man1/postw32.1*
416%ifarch ppc64
417%{_mandir}/man1/ppcppc.1*
418%else
419%{_mandir}/man1/ppc%{_bname}.1*
420%endif
421%{_mandir}/man1/ppdep.1*
422%{_mandir}/man1/ppudump.1*
423%{_mandir}/man1/ppufiles.1*
424%{_mandir}/man1/ppumove.1*
425%{_mandir}/man1/ptop.1*
426%{_mandir}/man1/pyacc.1*
427%{_mandir}/man1/rmcvsdir.1*
428%{_mandir}/man1/rstconv.1*
429%{_mandir}/man1/unitdiff.1*
430%{_mandir}/man5/fpc.cfg.5*
431%{_mandir}/man5/fpcmake.5*
432%{_mandir}/man5/ptop.cfg.5*
433
434%files ide
435%defattr(644,root,root,755)
436%attr(755,root,root) %{_bindir}/fp
437# TODO: move the below files to data dir
438# - ANSI art file used by fp binary
439%{_bindir}/fp.ans
440%{_bindir}/fp.rsj
441# - IDE command templates
442%{_bindir}/cvsco.tdf
443%{_bindir}/cvsdiff.tdf
444%{_bindir}/cvsup.tdf
445%{_bindir}/grep.tdf
446%{_bindir}/tpgrep.tdf
447# - Pascal code skeletons
448%{_bindir}/gplprog.pt
449%{_bindir}/gplunit.pt
450%{_bindir}/program.pt
451%{_bindir}/unit.pt
452%{_libdir}/%{name}/%{version}/ide
453
454%files src
455%defattr(644,root,root,755)
456%{_datadir}/fpcsrc
457
458%files examples
459%defattr(644,root,root,755)
460%{_examplesdir}/fpc
461
462%if %{with doc}
463%files doc
464%defattr(644,root,root,755)
465%doc fpcdocs/*.pdf
466%endif
This page took 0.0847250000000001 seconds and 4 git commands to generate.