]> git.pld-linux.org Git - packages/fpc.git/blame_incremental - fpc.spec
- attempt at fixing 64bit arch inconsistency
[packages/fpc.git] / fpc.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without ide # build with ide
4%bcond_without doc # build without doc
5
6Summary: 32-bit compiler for the i386 and m68k processors
7Summary(pl.UTF-8): 32 bitowy kompilator dla procesorów i386 i m68k
8Summary(ru.UTF-8): Свободный компилятор Pascal
9Summary(uk.UTF-8): Вільний компілятор Pascal
10Name: fpc
11Version: 2.6.4
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: 403da132aed194fd841d46c3b33b022a
17Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
18# Source1-md5: 915f799dd58b5429f06a48d4bd84a9c2
19Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
20# Source2-md5: ffc3cae4a72b60efb6873b9ce5c8a0f2
21Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar
22# Source3-md5: 28eb428bfaa8a72e49be05ed0efa0081
23Patch0: %{name}-skip-dev-dot.patch
24Patch1: %{name}-link.patch
25Patch2: %{name}-gdb.patch
26Patch3: %{name}-r22920.patch
27URL: http://www.freepascal.org/
28BuildRequires: binutils-devel >= 3:2.17.50
29BuildRequires: gpm-devel
30BuildRequires: ncurses-devel
31BuildRequires: rpmbuild(macros) >= 1.213
32%if %{with ide}
33BuildRequires: babeltrace-devel
34BuildRequires: expat-devel
35BuildRequires: gdb-lib >= 7.2-7
36BuildRequires: guile-devel
37BuildRequires: python-devel
38BuildRequires: readline-devel
39BuildRequires: libselinux-devel
40BuildRequires: xz-devel
41BuildRequires: zlib-devel
42%endif
43%if %{with doc}
44BuildRequires: tetex-fonts-jknappen
45BuildRequires: tetex-format-pdflatex
46BuildRequires: tetex-makeindex
47BuildRequires: tetex-metafont
48BuildRequires: texlive-xetex
49%endif
50Requires: binutils
51Provides: fpc-bootstrap
52ExclusiveArch: %{ix86} %{x8664} ppc
53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55%description
56Free Pascal is a 32-bit compiler for the i386 and m68k processors.
57Free Pascal is designed to be, as much as possible, source compatible
58with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
59attained), but it also enhances these languages with elements like
60function overloading. And, unlike these ancestors, it supports
61multiple platforms.
62
63%description -l pl.UTF-8
64Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
65Free Pascal został zaprojektowany by być (jak tylko to możliwe)
66kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
67rozszerza te języki elementami takimi jak przeciążanie funkcji.
68
69%description -l ru.UTF-8
70FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
71Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
72(библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
73mysql, postgres, ibase.
74
75%description -l uk.UTF-8
76FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
77Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
78(бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
79mysql, postgres, ibase.
80
81%package src
82Summary: Free Pascal Compiler source files
83Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
84Group: Development
85Requires: %{name} = %{version}-%{release}
86Provides: fpcsrc
87
88%description src
89Free Pascal Compiler source files.
90
91%description src -l pl.UTF-8
92Pliki źródłowe kompilatora Free Pascal.
93
94%package examples
95Summary: Free Pascal Compiler exaple programs
96Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
97Group: Documentation
98Requires: %{name} = %{version}-%{release}
99
100%description examples
101Free Pascal Compiler exaple programs.
102
103%description examples -l pl.UTF-8
104Przykładowe programy do kompilatora Free Pascal.
105
106%package doc
107Summary: Free Pascal Compiler documentation
108Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
109Group: Documentation
110# doesn't require base
111
112%description doc
113Documentation for fpc in PDF format.
114
115%description doc -l pl.UTF-8
116Dokumentacja do fpc w formacie PDF.
117
118%prep
119%setup -q -n %{name}build-%{version}
120%patch0 -p1
121%patch1 -p1
122%patch2 -p1
123%patch3 -p0
124
125%ifarch %{ix86}
126tar xf %{SOURCE1}
127%define _bver %{version}
128%define _bname 386
129%define _barch i386
130%endif
131%ifarch %{x8664}
132tar xf %{SOURCE2}
133%define _bver %{version}
134%define _bname x64
135%define _barch x86_64
136%endif
137%ifarch ppc
138tar xf %{SOURCE3}
139%define _bver %{version}
140%define _bname ppc
141%define _barch powepc
142%endif
143
144cd %{name}-%{version}.%{_barch}-linux
145tar xf binary.*-linux.tar
146cd ..
147
148mkdir bin
149cd bin
150for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
151 tar xzf $i
152done
153ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
154cd ..
155
156find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
157 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
158
159# save for fpc-src
160install -d fpc-src
161cp -af fpcsrc/* fpc-src
162rm -r fpc-src/{ide,tests}
163
164%if 0%{?debug:1}
165find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
166%endif
167
168%build
169# use ld.bfd
170[ -d our-ld ] || install -d our-ld
171ln -sf %{_bindir}/ld.bfd our-ld/ld
172export PATH=$(pwd)/our-ld:$PATH
173
174PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
175NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
176NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
177DATA2INC=`pwd`/fpcsrc/utils/data2inc
178
179# DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
180case "%{_build_cpu}" in
181 i386) OPTF="-OG2p1" ;;
182 i486) OPTF="-OG2p1" ;;
183 i586) OPTF="-OG2p2" ;;
184 i686) OPTF="-Og2p3" ;;
185 athlon) OPTF="-Og2p3" ;;
186 *) OPTF="-O2" ;;
187esac
188
189%{__make} -C fpcsrc compiler_cycle \
190 OPT="$OPTF %{!?debug:-Xs} -n" \
191 RELEASE="1" \
192 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
193 BININSTALLDIR=%{_bindir} \
194 DATA2INC="$DATA2INC" \
195 PP="$PP" \
196 FPC="$PP" \
197 LINKSMART=YES
198
199%{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
200 RELEASE="1" \
201 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
202 BININSTALLDIR=%{_bindir} \
203 GDBLIBDIR=%{_libdir} \
204 DATA2INC="$DATA2INC" \
205 PP="$NEWPP" \
206 FPC="$NEWPP" \
207 FPDOC=$NEWFPDOC \
208 LINKSMART=YES \
209 NODOCS=YES \
210 rtl_clean \
211 packages_clean \
212 utils_clean \
213 %{?with_ide: ide_clean installer_clean} \
214 rtl_all \
215 packages_all \
216 utils_all %{?with_ide:ide_all installer_all}
217
218%if %{with doc}
219export save_size=10000
220%{__make} -j1 -C fpcdocs \
221 FPDOC=$NEWFPDOC \
222 FPC="$NEWPP" \
223 pdf
224%endif
225
226%install
227rm -rf $RPM_BUILD_ROOT
228install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
229
230cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
231
232NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
233FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
234%{__make} -j1 -C fpcsrc \
235 compiler_distinstall \
236 rtl_distinstall \
237 packages_distinstall \
238 %{?with_ide:ide_distinstall} \
239 utils_distinstall \
240 PP="$NEWPP" \
241 FPCMAKE="$FPCMAKE" \
242 SMARTLINK=YES \
243 FPCDIR=%{_libdir}/%{name}/%{version} \
244 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
245 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
246 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
247 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
248 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
249 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
250 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
251 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
252 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
253
254%{__make} -j1 -C install/man installman \
255 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
256
257ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
258
259ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
260
261sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
262%{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
263
264# I have no idea why some units are installed to /usr/lib - baggins
265%if "%{_lib}" != "lib"
266cd $RPM_BUILD_ROOT/usr/lib/%{name}/%{version}/units
267for d in * ; do
268 %{__mv} $d/* $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/units/$d/
269done
270%endif
271
272%clean
273rm -rf $RPM_BUILD_ROOT
274
275%files
276%defattr(644,root,root,755)
277%attr(755,root,root) %{_bindir}/*
278%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
279%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
280%dir %{_sysconfdir}/fppkg
281%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
282%dir %{_libdir}/%{name}
283%dir %{_libdir}/%{name}/%{version}
284%dir %{_libdir}/%{name}/lexyacc
285%{_libdir}/%{name}/%{version}/msg
286%{_libdir}/%{name}/%{version}/units
287%if %{with ide}
288%{_libdir}/%{name}/%{version}/ide
289%endif
290%{_libdir}/%{name}/lexyacc/*
291%attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
292%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
293%attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
294%{_mandir}/man*/*
295
296%files src
297%defattr(644,root,root,755)
298%{_datadir}/fpcsrc
299
300%files examples
301%defattr(644,root,root,755)
302%{_examplesdir}/fpc
303
304%if %{with doc}
305%files doc
306%defattr(644,root,root,755)
307%doc fpcdocs/*.pdf
308%endif
This page took 0.027597 seconds and 4 git commands to generate.