]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without ide # build with ide | |
4 | %bcond_without doc # build without doc | |
5 | ||
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 | |
10 | Name: fpc | |
11 | Version: 2.6.4 | |
12 | Release: 2 | |
13 | License: GPL v2+ | |
14 | Group: Development/Languages | |
15 | Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz | |
16 | # Source0-md5: 403da132aed194fd841d46c3b33b022a | |
17 | Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar | |
18 | # Source1-md5: 915f799dd58b5429f06a48d4bd84a9c2 | |
19 | Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar | |
20 | # Source2-md5: ffc3cae4a72b60efb6873b9ce5c8a0f2 | |
21 | Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar | |
22 | # Source3-md5: 28eb428bfaa8a72e49be05ed0efa0081 | |
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 | |
32 | %if %{with ide} | |
33 | BuildRequires: babeltrace-devel | |
34 | BuildRequires: expat-devel | |
35 | BuildRequires: gdb-lib >= 7.2-7 | |
36 | BuildRequires: guile-devel | |
37 | BuildRequires: python-devel | |
38 | BuildRequires: readline-devel | |
39 | BuildRequires: libselinux-devel | |
40 | BuildRequires: xz-devel | |
41 | BuildRequires: zlib-devel | |
42 | %endif | |
43 | %if %{with doc} | |
44 | BuildRequires: tetex-fonts-jknappen | |
45 | BuildRequires: tetex-format-pdflatex | |
46 | BuildRequires: tetex-makeindex | |
47 | BuildRequires: tetex-metafont | |
48 | BuildRequires: texlive-xetex | |
49 | %endif | |
50 | Requires: binutils | |
51 | Provides: fpc-bootstrap | |
52 | ExclusiveArch: %{ix86} %{x8664} ppc | |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
56 | Free Pascal is a 32-bit compiler for the i386 and m68k processors. | |
57 | Free Pascal is designed to be, as much as possible, source compatible | |
58 | with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet | |
59 | attained), but it also enhances these languages with elements like | |
60 | function overloading. And, unlike these ancestors, it supports | |
61 | multiple platforms. | |
62 | ||
63 | %description -l pl.UTF-8 | |
64 | Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k. | |
65 | Free Pascal został zaprojektowany by być (jak tylko to możliwe) | |
66 | kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również | |
67 | rozszerza te języki elementami takimi jak przeciążanie funkcji. | |
68 | ||
69 | %description -l ru.UTF-8 | |
70 | FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и | |
71 | Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL | |
72 | (библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib, | |
73 | mysql, postgres, ibase. | |
74 | ||
75 | %description -l uk.UTF-8 | |
76 | FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та | |
77 | Delphi. Постачається із RTL (бібліотекою часу виконання), FCL | |
78 | (бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib, | |
79 | mysql, postgres, ibase. | |
80 | ||
81 | %package src | |
82 | Summary: Free Pascal Compiler source files | |
83 | Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal | |
84 | Group: Development | |
85 | Requires: %{name} = %{version}-%{release} | |
86 | Provides: fpcsrc | |
87 | ||
88 | %description src | |
89 | Free Pascal Compiler source files. | |
90 | ||
91 | %description src -l pl.UTF-8 | |
92 | Pliki źródłowe kompilatora Free Pascal. | |
93 | ||
94 | %package examples | |
95 | Summary: Free Pascal Compiler exaple programs | |
96 | Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal | |
97 | Group: Documentation | |
98 | Requires: %{name} = %{version}-%{release} | |
99 | ||
100 | %description examples | |
101 | Free Pascal Compiler exaple programs. | |
102 | ||
103 | %description examples -l pl.UTF-8 | |
104 | Przykładowe programy do kompilatora Free Pascal. | |
105 | ||
106 | %package doc | |
107 | Summary: Free Pascal Compiler documentation | |
108 | Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal | |
109 | Group: Documentation | |
110 | # doesn't require base | |
111 | ||
112 | %description doc | |
113 | Documentation for fpc in PDF format. | |
114 | ||
115 | %description doc -l pl.UTF-8 | |
116 | Dokumentacja 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} | |
126 | tar xf %{SOURCE1} | |
127 | %define _bver %{version} | |
128 | %define _bname 386 | |
129 | %define _barch i386 | |
130 | %endif | |
131 | %ifarch %{x8664} | |
132 | tar xf %{SOURCE2} | |
133 | %define _bver %{version} | |
134 | %define _bname x64 | |
135 | %define _barch x86_64 | |
136 | %endif | |
137 | %ifarch ppc | |
138 | tar xf %{SOURCE3} | |
139 | %define _bver %{version} | |
140 | %define _bname ppc | |
141 | %define _barch powepc | |
142 | %endif | |
143 | ||
144 | cd %{name}-%{version}.%{_barch}-linux | |
145 | tar xf binary.*-linux.tar | |
146 | cd .. | |
147 | ||
148 | mkdir bin | |
149 | cd bin | |
150 | for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do | |
151 | tar xzf $i | |
152 | done | |
153 | ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin | |
154 | cd .. | |
155 | ||
156 | find 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 | |
160 | install -d fpc-src | |
161 | cp -af fpcsrc/* fpc-src | |
162 | rm -r fpc-src/{ide,tests} | |
163 | ||
164 | %if 0%{?debug:1} | |
165 | find 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 | |
171 | ln -sf %{_bindir}/ld.bfd our-ld/ld | |
172 | export PATH=$(pwd)/our-ld:$PATH | |
173 | ||
174 | PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname} | |
175 | NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} | |
176 | NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc | |
177 | DATA2INC=`pwd`/fpcsrc/utils/data2inc | |
178 | ||
179 | # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins | |
180 | case "%{_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" ;; | |
187 | esac | |
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} | |
219 | export save_size=10000 | |
220 | %{__make} -j1 -C fpcdocs \ | |
221 | FPDOC=$NEWFPDOC \ | |
222 | FPC="$NEWPP" \ | |
223 | ||
224 | %endif | |
225 | ||
226 | %install | |
227 | rm -rf $RPM_BUILD_ROOT | |
228 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc} | |
229 | ||
230 | cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc | |
231 | ||
232 | NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} | |
233 | FPCMAKE=`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 | ||
257 | ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir} | |
258 | ||
259 | ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld | |
260 | ||
261 | sh 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" | |
266 | cd $RPM_BUILD_ROOT/usr/lib/%{name}/%{version}/units | |
267 | for d in * ; do | |
268 | %{__mv} $d/* $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/units/$d/ | |
269 | done | |
270 | %endif | |
271 | ||
272 | %clean | |
273 | rm -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 |