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