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